Commit c3007697 authored by vegorov@chromium.org's avatar vegorov@chromium.org

Maintain proper pointer map for branches when resolving phis.

The same was done for gap moves connecting live ranges in r6858.

Review URL: http://codereview.chromium.org/6873053

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7650 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 26fda9bf
......@@ -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 inserting 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 (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());
......@@ -1116,7 +1132,7 @@ void LAllocator::ResolveControlFlow(LiveRange* range,
// 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
// By inserting 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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment