From c411adca5574a50ee89ade9c4486db31458cf5a1 Mon Sep 17 00:00:00 2001 From: "vegorov@chromium.org" Date: Fri, 18 Feb 2011 16:29:41 +0000 Subject: [PATCH] Adjust pointer maps for branches when connecting live ranges. Review URL: http://codereview.chromium.org/6541024 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6858 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/lithium-allocator.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/lithium-allocator.cc b/src/lithium-allocator.cc index 9f5f1b9..0842940 100644 --- a/src/lithium-allocator.cc +++ b/src/lithium-allocator.cc @@ -1098,6 +1098,21 @@ void LAllocator::ResolveControlFlow(LiveRange* range, } 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); } -- 2.7.4