Bug 891119 - IonMonkey: Simplify RegisterSet usage by using takeUnchecked instead of has and take. r=h4writer

This commit is contained in:
Dan Gohman 2013-07-09 07:03:18 -07:00
parent f79fced3ea
commit 42bd555de0
3 changed files with 14 additions and 22 deletions

View File

@ -3960,12 +3960,9 @@ ICGetElem_Arguments::Compiler::generateStubCode(MacroAssembler &masm)
// unlikely.
Label failureReconstructInputs;
regs = availableGeneralRegs(0);
if (regs.has(objReg))
regs.take(objReg);
if (regs.has(idxReg))
regs.take(idxReg);
if (regs.has(scratchReg))
regs.take(scratchReg);
regs.takeUnchecked(objReg);
regs.takeUnchecked(idxReg);
regs.takeUnchecked(scratchReg);
Register argData = regs.takeAny();
Register tempReg = regs.takeAny();
@ -7233,8 +7230,7 @@ ICCallScriptedCompiler::generateStubCode(MacroAssembler &masm)
regs.take(argcReg);
regs.take(ArgumentsRectifierReg);
if (regs.has(BaselineTailCallReg))
regs.take(BaselineTailCallReg);
regs.takeUnchecked(BaselineTailCallReg);
// Load the callee in R1.
// Stack Layout: [ ..., CalleeVal, ThisVal, Arg0Val, ..., ArgNVal, +ICStackValueOffset+ ]

View File

@ -1329,8 +1329,7 @@ CodeGenerator::visitOutOfLineCallPostWriteBarrier(OutOfLineCallPostWriteBarrier
masm.movePtr(ImmGCPtr(&obj->toConstant()->toObject()), objreg);
} else {
objreg = ToRegister(obj);
if (regs.has(objreg))
regs.take(objreg);
regs.takeUnchecked(objreg);
}
Register runtimereg = regs.takeAny();

View File

@ -593,26 +593,23 @@ class RegisterSet {
}
void maybeTake(Register reg) {
if (gpr_.has(reg))
gpr_.take(reg);
gpr_.takeUnchecked(reg);
}
void maybeTake(FloatRegister reg) {
if (fpu_.has(reg))
fpu_.take(reg);
fpu_.takeUnchecked(reg);
}
void maybeTake(AnyRegister reg) {
if (has(reg))
take(reg);
if (reg.isFloat())
fpu_.takeUnchecked(reg.fpu());
else
gpr_.takeUnchecked(reg.gpr());
}
void maybeTake(ValueOperand value) {
#if defined(JS_NUNBOX32)
if (gpr_.has(value.typeReg()))
gpr_.take(value.typeReg());
if (gpr_.has(value.payloadReg()))
gpr_.take(value.payloadReg());
gpr_.takeUnchecked(value.typeReg());
gpr_.takeUnchecked(value.payloadReg());
#elif defined(JS_PUNBOX64)
if (gpr_.has(value.valueReg()))
gpr_.take(value.valueReg());
gpr_.takeUnchecked(value.valueReg());
#else
#error "Bad architecture"
#endif