Bug 605355 - JM: FrameState::ensureFullRegs should operate on the backing FrameEntry (r=dvander)

This commit is contained in:
Luke Wagner 2010-10-18 18:11:45 -07:00
parent 768410d930
commit b239c6cc13
3 changed files with 29 additions and 18 deletions

View File

@ -2198,14 +2198,11 @@ mjit::Compiler::inlineCallHelper(uint32 argc, bool callingNew)
callIC.frameDepth = frame.frameDepth();
/* Grab type and data registers up-front. */
MaybeRegisterID typeReg;
frame.ensureFullRegs(fe);
if (!fe->isTypeKnown()) {
typeReg = frame.tempRegForType(fe);
MaybeRegisterID typeReg, maybeDataReg;
frame.ensureFullRegs(fe, &typeReg, &maybeDataReg);
RegisterID dataReg = maybeDataReg.reg();
if (!fe->isTypeKnown())
frame.pinReg(typeReg.reg());
}
RegisterID dataReg = frame.tempRegForData(fe);
frame.pinReg(dataReg);
/*

View File

@ -1392,30 +1392,44 @@ FrameState::allocForSameBinary(FrameEntry *fe, JSOp op, BinaryAlloc &alloc)
}
void
FrameState::ensureFullRegs(FrameEntry *fe)
FrameState::ensureFullRegs(FrameEntry *fe, MaybeRegisterID *type, MaybeRegisterID *data)
{
FrameEntry *backing = fe;
if (fe->isCopy())
backing = fe->copyOf();
fe = fe->isCopy() ? fe->copyOf() : fe;
JS_ASSERT(!data->isSet() && !type->isSet());
if (!fe->type.inMemory()) {
if (fe->data.inRegister())
if (fe->type.inRegister())
*type = fe->type.reg();
if (fe->data.isConstant())
return;
if (fe->data.inRegister()) {
*data = fe->data.reg();
return;
}
if (fe->type.inRegister())
pinReg(fe->type.reg());
if (fe->data.inMemory())
tempRegForData(fe);
*data = tempRegForData(fe);
if (fe->type.inRegister())
unpinReg(fe->type.reg());
} else if (!fe->data.inMemory()) {
if (fe->type.inRegister())
if (fe->data.inRegister())
*data = fe->data.reg();
if (fe->type.isConstant())
return;
if (fe->type.inRegister()) {
*type = fe->type.reg();
return;
}
if (fe->data.inRegister())
pinReg(fe->data.reg());
if (fe->type.inMemory())
tempRegForType(fe);
*type = tempRegForType(fe);
if (fe->data.inRegister())
unpinReg(fe->data.reg());
} else {
*data = tempRegForData(fe);
pinReg(data->reg());
*type = tempRegForType(fe);
unpinReg(data->reg());
}
}

View File

@ -511,7 +511,7 @@ class FrameState
bool resultNeeded = true);
/* Ensures that an FE has both type and data remat'd in registers. */
void ensureFullRegs(FrameEntry *fe);
void ensureFullRegs(FrameEntry *fe, MaybeRegisterID *typeReg, MaybeRegisterID *dataReg);
/*
* Similar to allocForBinary, except works when the LHS and RHS have the