return copy;
}
- elements_[index].clear_copied();
return FrameElement::InvalidElement();
}
// push that register on top of the frame. If it is copied,
// make the first copy the backing store and push a fresh copy
// on top of the frame.
- FrameElement copy = original.is_copied()
- ? AdjustCopies(index)
- : FrameElement::InvalidElement();
+ FrameElement copy = AdjustCopies(index);
if (copy.is_valid()) {
// The original element was a copy. Push the copy of the new
// backing store.
// If the element is not copied, push it on top of the frame.
// If it is copied, make the first copy be the new backing store
// and push a fresh copy on top of the frame.
- FrameElement copy = original.is_copied()
- ? AdjustCopies(index)
- : FrameElement::InvalidElement();
+ FrameElement copy = AdjustCopies(index);
if (copy.is_valid()) {
// The original element was a copy. Push the copy of the new
// backing store.
FrameElement original = elements_[index];
// If the stored-to slot may be copied, adjust to preserve the
// copy-on-write semantics of copied elements.
- if (original.is_copied() &&
- (original.is_register() || original.is_memory())) {
+ if (original.is_register() || original.is_memory()) {
FrameElement ignored = AdjustCopies(index);
}
case FrameElement::REGISTER:
// All copies are backed by memory or register locations.
result.type_ =
- FrameElement::TypeField::encode(FrameElement::COPY)
- | FrameElement::IsCopiedField::encode(false)
- | FrameElement::SyncField::encode(FrameElement::NOT_SYNCED);
+ FrameElement::TypeField::encode(FrameElement::COPY) |
+ FrameElement::SyncField::encode(FrameElement::NOT_SYNCED);
result.data_.index_ = index;
- elements_[index].set_copied();
break;
case FrameElement::INVALID:
// If the original may be a copy, adjust to preserve the copy-on-write
// semantics of copied elements.
- if (original.is_copied() &&
- (original.is_register() || original.is_memory())) {
+ if (original.is_register() || original.is_memory()) {
FrameElement ignored = AdjustCopies(frame_index);
}
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);
- }
-
- void clear_copied() {
- type_ = (type_ & ~IsCopiedField::mask()) | IsCopiedField::encode(false);
- }
-
Register reg() const {
ASSERT(is_register());
return data_.reg_;
// BitField is <type, shift, size>.
class SyncField : public BitField<SyncFlag, 0, 1> {};
- class IsCopiedField : public BitField<bool, 1, 1> {};
- class TypeField : public BitField<Type, 2, 32 - 2> {};
+ class TypeField : public BitField<Type, 1, 32 - 1> {};
Type type() const { return TypeField::decode(type_); }
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);
namespace v8 { namespace internal {
FrameElement::FrameElement(Handle<Object> value, SyncFlag is_synced) {
- type_ = TypeField::encode(CONSTANT)
- | IsCopiedField::encode(false)
- | SyncField::encode(is_synced);
+ type_ = TypeField::encode(CONSTANT) | 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)
- | IsCopiedField::encode(false)
- | SyncField::encode(is_synced);
+ type_ = TypeField::encode(type) | SyncField::encode(is_synced);
data_.reg_ = reg;
+ next_ = VirtualFrame::kIllegalIndex;
}