本文整理汇总了C++中VirtualRegister::backingStack方法的典型用法代码示例。如果您正苦于以下问题:C++ VirtualRegister::backingStack方法的具体用法?C++ VirtualRegister::backingStack怎么用?C++ VirtualRegister::backingStack使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VirtualRegister
的用法示例。
在下文中一共展示了VirtualRegister::backingStack方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IonSpew
bool
GreedyAllocator::buildPhiMoves(LBlock *block)
{
IonSpew(IonSpew_RegAlloc, " Merging phi state.");
phiMoves = Mover();
MBasicBlock *mblock = block->mir();
if (!mblock->successorWithPhis())
return true;
// Insert moves from our state into our successor's phi.
uint32 pos = mblock->positionInPhiSuccessor();
LBlock *successor = mblock->successorWithPhis()->lir();
for (size_t i = 0; i < successor->numPhis(); i++) {
LPhi *phi = successor->getPhi(i);
JS_ASSERT(phi->numDefs() == 1);
VirtualRegister *phiReg = getVirtualRegister(phi->getDef(0));
allocateStack(phiReg);
LAllocation *in = phi->getOperand(pos);
VirtualRegister *inReg = getVirtualRegister(in->toUse());
allocateStack(inReg);
// Try to get a register for the input.
if (!inReg->hasRegister() && !allocatableRegs().empty(inReg->isDouble())) {
if (!allocateReg(inReg))
return false;
}
// Add a move from the input to the phi.
if (inReg->hasRegister()) {
if (!phiMoves.move(inReg->reg(), phiReg->backingStack()))
return false;
} else {
if (!phiMoves.move(inReg->backingStack(), phiReg->backingStack()))
return false;
}
}
return true;
}
示例2: getVirtualRegister
void
GreedyAllocator::informSnapshot(LInstruction *ins)
{
LSnapshot *snapshot = ins->snapshot();
for (size_t i = 0; i < snapshot->numEntries(); i++) {
LAllocation *a = snapshot->getEntry(i);
if (!a->isUse())
continue;
// Every definition in a snapshot gets a stack slot. This
// simplification means we can treat normal snapshots and LOsiPoint
// snapshots (which follow calls) the same, without adding a special
// exception to note that registers are spilled at the LOsiPoint.
VirtualRegister *vr = getVirtualRegister(a->toUse());
allocateStack(vr);
*a = vr->backingStack();
}
}
示例3: allocateStack
bool
GreedyAllocator::evict(AnyRegister reg)
{
VirtualRegister *vr = state[reg];
JS_ASSERT(vr->reg() == reg);
// If the virtual register does not have a stack slot, allocate one now.
allocateStack(vr);
// We're allocating bottom-up, so eviction *restores* a register, otherwise
// it could not be used downstream.
if (!restore(vr->backingStack(), reg))
return false;
freeReg(reg);
vr->unsetRegister();
return true;
}