Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1063)

Unified Diff: src/virtual-frame.h

Issue 42324: Add a bit to a virtual frame element telling if it's been copied. Set... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/virtual-frame.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/virtual-frame.h
===================================================================
--- src/virtual-frame.h (revision 1527)
+++ src/virtual-frame.h (working copy)
@@ -101,6 +101,16 @@
bool is_constant() const { return type() == CONSTANT; }
bool is_copy() const { return type() == COPY; }
+ bool is_copied() const { return IsCopiedField::decode(type_); }
+
+ void set_copied() {
+ type_ = (type_ & ~IsCopiedField::mask()) | IsCopiedField::encode(true);
Erik Corry 2009/03/18 10:31:02 The BitField class feels a bit heavyweight. This
+ }
+
+ void clear_copied() {
+ type_ = (type_ & ~IsCopiedField::mask()) | IsCopiedField::encode(false);
+ }
+
Register reg() const {
ASSERT(is_register());
return data_.reg_;
@@ -129,7 +139,8 @@
// BitField is <type, shift, size>.
class SyncField : public BitField<SyncFlag, 0, 1> {};
- class TypeField : public BitField<Type, 1, 32 - 1> {};
+ class IsCopiedField : public BitField<bool, 1, 1> {};
+ class TypeField : public BitField<Type, 2, 32 - 2> {};
Type type() const { return TypeField::decode(type_); }
@@ -144,10 +155,6 @@
int index_;
} data_;
- // The index of the next element in a list of copies, or the frame's
- // illegal index if there is no next element.
- int next_;
-
// Used to construct memory and register elements.
FrameElement(Type type, Register reg, SyncFlag is_synced) {
Initialize(type, reg, is_synced);
@@ -175,16 +182,18 @@
namespace v8 { namespace internal {
FrameElement::FrameElement(Handle<Object> value, SyncFlag is_synced) {
- type_ = TypeField::encode(CONSTANT) | SyncField::encode(is_synced);
+ type_ = TypeField::encode(CONSTANT)
+ | IsCopiedField::encode(false)
+ | SyncField::encode(is_synced);
data_.handle_ = value.location();
- next_ = VirtualFrame::kIllegalIndex;
}
void FrameElement::Initialize(Type type, Register reg, SyncFlag is_synced) {
- type_ = TypeField::encode(type) | SyncField::encode(is_synced);
+ type_ = TypeField::encode(type)
+ | IsCopiedField::encode(false)
+ | SyncField::encode(is_synced);
data_.reg_ = reg;
- next_ = VirtualFrame::kIllegalIndex;
}
« no previous file with comments | « no previous file | src/virtual-frame.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698