Chromium Code Reviews| Index: src/virtual-frame-ia32.h |
| =================================================================== |
| --- src/virtual-frame-ia32.h (revision 861) |
| +++ src/virtual-frame-ia32.h (working copy) |
| @@ -70,14 +70,15 @@ |
| void set_sync() { |
| ASSERT(type() != MEMORY); |
| - type_ = type_ | SyncField::encode(SYNCED); |
| + type_ = (type_ & ~SyncField::mask()) | SyncField::encode(SYNCED); |
|
William Hesse
2008/11/28 10:32:45
Why isn't there a set_field accessor for bit field
Kevin Millikin (Chromium)
2008/11/28 12:19:08
I don't know why there isn't such an accessor. It
|
| } |
| void clear_sync() { |
| ASSERT(type() != MEMORY); |
| - type_ = type_ & ~SyncField::mask(); |
| + type_ = (type_ & ~SyncField::mask()) | SyncField::encode(NOT_SYNCED); |
| } |
| + bool is_memory() const { return type() == MEMORY; } |
| bool is_register() const { return type() == REGISTER; } |
| bool is_constant() const { return type() == CONSTANT; } |
| @@ -185,6 +186,12 @@ |
| return Operand(ebp, kLocal0Offset - index * kPointerSize); |
| } |
| + // Store the top value on the virtual frame into a local frame slot. The |
| + // value is left in place on top of the frame. |
| + void StoreToLocalAt(int index) { |
| + StoreToFrameSlotAt(local0_index() + index); |
| + } |
| + |
| // The function frame slot. |
| Operand Function() const { return Operand(ebp, kFunctionOffset); } |
| @@ -198,6 +205,12 @@ |
| return Operand(ebp, (1 + parameter_count_ - index) * kPointerSize); |
| } |
| + // Store the top value on the virtual frame into a parameter frame slot. |
| + // The value is left in place on top of the frame. |
| + void StoreToParameterAt(int index) { |
| + StoreToFrameSlotAt(param0_index() + index); |
| + } |
| + |
| // The receiver frame slot. |
| Operand Receiver() const { return ParameterAt(-1); } |
| @@ -248,6 +261,10 @@ |
| void Push(Register reg); |
| void Push(Handle<Object> value); |
| +#ifdef DEBUG |
| + bool IsSpilled(); |
| +#endif |
| + |
| private: |
| // An illegal index into the virtual frame. |
| static const int kIllegalIndex = -1; |
| @@ -336,6 +353,10 @@ |
| // Sync all elements in the frame. |
| void SyncAll(); |
| + // Store the value on top of the frame to a frame slot (typically a local |
| + // or parameter). |
| + void StoreToFrameSlotAt(int index); |
| + |
| // Spill the topmost elements of the frame to memory (eg, they are the |
| // arguments to a call) and all registers. |
| void PrepareForCall(int count); |