Index: src/lithium-allocator.cc |
diff --git a/src/lithium-allocator.cc b/src/lithium-allocator.cc |
index f62a7dbc0a2708fa879ff42a3a5f0063ab641972..0dd904a1bfea0263f89785cbdfc190f2a0b17639 100644 |
--- a/src/lithium-allocator.cc |
+++ b/src/lithium-allocator.cc |
@@ -1029,6 +1029,22 @@ void LAllocator::ResolvePhis(HBasicBlock* block) { |
chunk_->AddGapMove(cur_block->last_instruction_index() - 1, |
operand, |
phi_operand); |
+ |
+ // 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 |
fschneider
2011/04/18 20:20:05
->inserting
|
+ // 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 (phi->representation().IsTagged()) { |
+ LInstruction* branch = |
+ InstructionAt(cur_block->last_instruction_index()); |
+ if (branch->HasPointerMap()) { |
+ branch->pointer_map()->RecordPointer(phi_operand); |
+ } |
+ } |
} |
LiveRange* live_range = LiveRangeFor(phi->id()); |