Reviewers: Kevin Millikin,

Description:
Change VirtualFrame::AdjustCopies to mark target as invalid.

Please review this at http://codereview.chromium.org/50012

SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/

Affected files:
   M     src/virtual-frame-ia32.cc
   M     src/virtual-frame.cc


Index: src/virtual-frame-ia32.cc
===================================================================
--- src/virtual-frame-ia32.cc   (revision 1548)
+++ src/virtual-frame-ia32.cc   (working copy)
@@ -526,7 +526,9 @@
      } else {
        // The original was in a register.
        backing_reg = original.reg();
+      Unuse(original.reg());
      }
+    elements_[index] = FrameElement::InvalidElement();
      FrameElement new_backing_element =
          FrameElement::RegisterElement(backing_reg,  
FrameElement::NOT_SYNCED);
      if (elements_[i].is_synced()) {
@@ -606,10 +608,6 @@
          // The original element was a copy.  Push the copy of the new
          // backing store.
          elements_.Add(copy);
-        // This is the only case where we have to unuse the original
-        // register.  The original is still counted and so is the new
-        // backing store of the copies.
-        Unuse(original.reg());
        } else {
          // The element was not a copy.  Push it.
          original.clear_sync();
@@ -648,8 +646,8 @@
    }

    // If the stored-to slot is a register reference, deallocate it.
-  if (original.is_register()) {
-    Unuse(original.reg());
+  if (elements_[index].is_register()) {
+    Unuse(elements_[index].reg());
    }

    int top_index = elements_.length() - 1;
Index: src/virtual-frame.cc
===================================================================
--- src/virtual-frame.cc        (revision 1548)
+++ src/virtual-frame.cc        (working copy)
@@ -384,8 +384,8 @@
    }

    // If the original is a register reference, deallocate it.
-  if (original.is_register()) {
-    Unuse(original.reg());
+  if (elements_[frame_index].is_register()) {
+    Unuse(elements_[frame_index].reg());
    }

    FrameElement new_element;



--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to