Bug 936891 - IonMonkey: Fix safepoint handling to mind the differences between LSRA and Backtracking. r=bhackett

This commit is contained in:
Dan Gohman 2013-11-12 05:46:43 -08:00
parent d7da59c249
commit 0ebddaa032
3 changed files with 13 additions and 13 deletions

View File

@ -1132,7 +1132,7 @@ BacktrackingAllocator::populateSafepoints()
for (size_t k = 0; k < reg->numIntervals(); k++) {
LiveInterval *interval = reg->getInterval(k);
if (!interval->covers(inputOf(ins)))
if (!interval->covers(outputOf(ins)))
continue;
LAllocation *a = interval->getAllocation();

View File

@ -618,6 +618,17 @@ class LiveRangeAllocator : public RegisterAllocator
return addMove(moves, from, to);
}
size_t findFirstNonCallSafepoint(CodePosition from) const
{
size_t i = 0;
for (; i < graph.numNonCallSafepoints(); i++) {
const LInstruction *ins = graph.getNonCallSafepoint(i);
if (from <= (forLSRA ? inputOf(ins) : outputOf(ins)))
break;
}
return i;
}
void addLiveRegistersForInterval(VirtualRegister *reg, LiveInterval *interval)
{
// Fill in the live register sets for all non-call safepoints.
@ -633,7 +644,7 @@ class LiveRangeAllocator : public RegisterAllocator
size_t i = findFirstNonCallSafepoint(start);
for (; i < graph.numNonCallSafepoints(); i++) {
LInstruction *ins = graph.getNonCallSafepoint(i);
CodePosition pos = inputOf(ins);
CodePosition pos = forLSRA ? inputOf(ins) : outputOf(ins);
// Safepoints are sorted, so we can shortcut out of this loop
// if we go out of range.

View File

@ -341,17 +341,6 @@ class RegisterAllocator
return getMoveGroupAfter(pos.ins());
}
size_t findFirstNonCallSafepoint(CodePosition from) const
{
size_t i = 0;
for (; i < graph.numNonCallSafepoints(); i++) {
const LInstruction *ins = graph.getNonCallSafepoint(i);
if (from <= inputOf(ins))
break;
}
return i;
}
CodePosition minimalDefEnd(LInstruction *ins) {
// Compute the shortest interval that captures vregs defined by ins.
// Watch for instructions that are followed by an OSI point and/or Nop.