Revision: 6858
Author: [email protected]
Date: Fri Feb 18 08:29:41 2011
Log: Adjust pointer maps for branches when connecting live ranges.

Review URL: http://codereview.chromium.org/6541024
http://code.google.com/p/v8/source/detail?r=6858

Modified:
 /branches/bleeding_edge/src/lithium-allocator.cc

=======================================
--- /branches/bleeding_edge/src/lithium-allocator.cc Fri Feb 4 05:28:23 2011 +++ /branches/bleeding_edge/src/lithium-allocator.cc Fri Feb 18 08:29:41 2011
@@ -1098,6 +1098,21 @@
       } else {
         ASSERT(pred->end()->SecondSuccessor() == NULL);
         gap = GetLastGap(pred);
+
+        // We are going to insert a move before the branch instruction.
+        // Some branch instructions (e.g. loops' back edges)
+        // can potentially cause a GC so they have a pointer map.
+        // By insterting a move we essentially create a copy of a
+ // value which is invisible to PopulatePointerMaps(), because we store
+        // it into a location different from the operand of a live range
+        // covering a branch instruction.
+        // Thus we need to manually record a pointer.
+        if (HasTaggedValue(range->id())) {
+ LInstruction* branch = InstructionAt(pred->last_instruction_index());
+          if (branch->HasPointerMap()) {
+            branch->pointer_map()->RecordPointer(cur_op);
+          }
+        }
       }
       gap->GetOrCreateParallelMove(LGap::START)->AddMove(pred_op, cur_op);
     }

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

Reply via email to