Bug 1058095 - IonMonkey: Remove VirtualRegisters' block field r=bhackett
--- a/js/src/jit/LiveRangeAllocator.cpp
+++ b/js/src/jit/LiveRangeAllocator.cpp
@@ -522,32 +522,32 @@ LiveRangeAllocator<VREG, forLSRA>::init(
return false;
LBlock *block = graph.getBlock(i);
for (LInstructionIterator ins = block->begin(); ins != block->end(); ins++) {
for (size_t j = 0; j < ins->numDefs(); j++) {
LDefinition *def = ins->getDef(j);
if (def->isBogusTemp())
continue;
- if (!vregs[def].init(alloc(), block, *ins, def, /* isTemp */ false))
+ if (!vregs[def].init(alloc(), *ins, def, /* isTemp */ false))
return false;
}
for (size_t j = 0; j < ins->numTemps(); j++) {
LDefinition *def = ins->getTemp(j);
if (def->isBogusTemp())
continue;
- if (!vregs[def].init(alloc(), block, *ins, def, /* isTemp */ true))
+ if (!vregs[def].init(alloc(), *ins, def, /* isTemp */ true))
return false;
}
}
for (size_t j = 0; j < block->numPhis(); j++) {
LPhi *phi = block->getPhi(j);
LDefinition *def = phi->getDef(0);
- if (!vregs[def].init(alloc(), block, phi, def, /* isTemp */ false))
+ if (!vregs[def].init(alloc(), phi, def, /* isTemp */ false))
return false;
}
}
return true;
}
static void
--- a/js/src/jit/LiveRangeAllocator.h
+++ b/js/src/jit/LiveRangeAllocator.h
@@ -421,48 +421,46 @@ class LiveInterval
/*
* Represents all of the register allocation state associated with a virtual
* register, including all associated intervals and pointers to relevant LIR
* structures.
*/
class VirtualRegister
{
- LBlock *block_;
LInstruction *ins_;
LDefinition *def_;
Vector<LiveInterval *, 1, IonAllocPolicy> intervals_;
// Whether def_ is a temp or an output.
bool isTemp_ : 1;
void operator=(const VirtualRegister &) MOZ_DELETE;
VirtualRegister(const VirtualRegister &) MOZ_DELETE;
protected:
explicit VirtualRegister(TempAllocator &alloc)
: intervals_(alloc)
{}
public:
- bool init(TempAllocator &alloc, LBlock *block, LInstruction *ins, LDefinition *def,
+ bool init(TempAllocator &alloc, LInstruction *ins, LDefinition *def,
bool isTemp)
{
- MOZ_ASSERT(block && !block_);
- block_ = block;
+ MOZ_ASSERT(ins && !ins_);
ins_ = ins;
def_ = def;
isTemp_ = isTemp;
LiveInterval *initial = LiveInterval::New(alloc, def->virtualRegister(), 0);
if (!initial)
return false;
return intervals_.append(initial);
}
LBlock *block() {
- return block_;
+ return ins_->block();
}
LInstruction *ins() {
return ins_;
}
LDefinition *def() const {
return def_;
}
LDefinition::Type type() const {