Revision: 6556
Author: [email protected]
Date: Tue Feb  1 06:33:23 2011
Log: Fix control flow resolution bug in lithium register allocator.

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

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

=======================================
--- /branches/bleeding_edge/src/lithium-allocator.cc Thu Jan 20 06:37:28 2011 +++ /branches/bleeding_edge/src/lithium-allocator.cc Tue Feb 1 06:33:23 2011
@@ -1068,9 +1068,7 @@
                                     HBasicBlock* block,
                                     HBasicBlock* pred) {
   LifetimePosition pred_end =
- LifetimePosition::FromInstructionIndex(pred->last_instruction_index()).
-      PrevInstruction();
-
+ LifetimePosition::FromInstructionIndex(pred->last_instruction_index());
   LifetimePosition cur_start =
LifetimePosition::FromInstructionIndex(block->first_instruction_index());
   LiveRange* pred_cover = NULL;
@@ -1245,7 +1243,7 @@
       LifetimePosition start = LifetimePosition::FromInstructionIndex(
           block->first_instruction_index());
       LifetimePosition end = LifetimePosition::FromInstructionIndex(
-          back_edge->last_instruction_index());
+          back_edge->last_instruction_index()).NextInstruction();
       while (!iterator.Done()) {
         int operand_index = iterator.Current();
         LiveRange* range = LiveRangeFor(operand_index);
@@ -2019,6 +2017,11 @@

   if (pos.Value() <= range->Start().Value()) return range;

+  // We can't properly connect liveranges if split occured at the end
+  // of control instruction.
+  ASSERT(pos.IsInstructionStart() ||
+         !chunk_->instructions()->at(pos.InstructionIndex())->IsControl());
+
   LiveRange* result = LiveRangeFor(next_virtual_register_++);
   range->SplitAt(pos, result);
   return result;

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

Reply via email to