Bug 827965 - Utilize GetTempRegForIntArg() for callNative calls. (r=sstangl)

This commit is contained in:
Eric Faust 2013-01-08 16:50:04 -05:00
parent 09297c8f05
commit e9d9687978

View File

@ -300,9 +300,20 @@ LIRGenerator::visitCall(MCall *call)
// Call known functions.
if (target) {
if (target->isNative()) {
LCallNative *lir = new LCallNative(argslot, tempFixed(CallTempReg0),
tempFixed(CallTempReg1), tempFixed(CallTempReg2),
tempFixed(CallTempReg3));
Register cxReg, numReg, vpReg, tmpReg;
GetTempRegForIntArg(0, 0, &cxReg);
GetTempRegForIntArg(1, 0, &numReg);
GetTempRegForIntArg(2, 0, &vpReg);
// Even though this is just a temp reg, use the same API to avoid
// register collisions.
mozilla::DebugOnly<bool> ok = GetTempRegForIntArg(3, 0, &tmpReg);
MOZ_ASSERT(ok, "How can we not have four temp registers?");
LCallNative *lir = new LCallNative(argslot, tempFixed(cxReg),
tempFixed(numReg),
tempFixed(vpReg),
tempFixed(tmpReg));
return (defineReturn(lir, call) && assignSafepoint(lir, call));
}