Revert r1529, which failed on some of the benchmarks.
authorkmillikin@chromium.org <kmillikin@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 18 Mar 2009 12:35:42 +0000 (12:35 +0000)
committerkmillikin@chromium.org <kmillikin@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 18 Mar 2009 12:35:42 +0000 (12:35 +0000)
Review URL: http://codereview.chromium.org/48128

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1533 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/virtual-frame-ia32.cc
src/virtual-frame.cc
src/virtual-frame.h

index e0ee706..b31c394 100644 (file)
@@ -550,7 +550,6 @@ FrameElement VirtualFrame::AdjustCopies(int index) {
     return copy;
   }
 
-  elements_[index].clear_copied();
   return FrameElement::InvalidElement();
 }
 
@@ -570,9 +569,7 @@ void VirtualFrame::TakeFrameSlotAt(int index) {
       // 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.
@@ -596,9 +593,7 @@ void VirtualFrame::TakeFrameSlotAt(int index) {
       // 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.
@@ -639,8 +634,7 @@ void VirtualFrame::StoreToFrameSlotAt(int index) {
   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);
   }
 
index 6761337..60fa699 100644 (file)
@@ -93,11 +93,9 @@ FrameElement VirtualFrame::CopyElementAt(int 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:
@@ -369,8 +367,7 @@ void VirtualFrame::SetElementAt(int index, Result* value) {
 
   // 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);
   }
 
index 71f21c3..f28744d 100644 (file)
@@ -101,16 +101,6 @@ class FrameElement BASE_EMBEDDED {
   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_;
@@ -139,8 +129,7 @@ class FrameElement BASE_EMBEDDED {
 
   // 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_); }
 
@@ -155,6 +144,10 @@ class FrameElement BASE_EMBEDDED {
     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);
@@ -182,18 +175,16 @@ class FrameElement BASE_EMBEDDED {
 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;
 }