Bug 658968 - Don't clobber Registers::ReturnReg in emitStubCmpOp and jsop_relational_double. r=dvander

This commit is contained in:
Jan de Mooij 2011-05-25 16:59:32 +02:00
parent b725177be5
commit ae9c7ee1ba
3 changed files with 16 additions and 3 deletions

View File

@ -0,0 +1,13 @@
function f(){
var tarr = [];
var elemArray = [
{name: "C0", checked: true},
{name: "C1", checked: false},
];
for (var i = 0; i < elemArray.length; i++) {
var element = elemArray[i];
tarr[i] = (element.checked == true) ? 1 : 2;
}
assertEq(tarr.join(""), "12");
}
f();

View File

@ -2941,11 +2941,10 @@ mjit::Compiler::emitStubCmpOp(BoolStub stub, jsbytecode *target, JSOp fused)
{
prepareStubCall(Uses(2));
INLINE_STUBCALL(stub);
frame.pop();
frame.pop();
frame.popn(2);
frame.takeReg(Registers::ReturnReg);
if (!target) {
frame.takeReg(Registers::ReturnReg);
frame.pushTypedPayload(JSVAL_TYPE_BOOLEAN, Registers::ReturnReg);
return true;
}

View File

@ -1298,6 +1298,7 @@ mjit::Compiler::jsop_relational_double(JSOp op, BoolStub stub, jsbytecode *targe
OOL_STUBCALL(stub);
frame.popn(2);
frame.takeReg(Registers::ReturnReg);
frame.syncAndForgetEverything();
Jump j = masm.branchDouble(dblCond, fpLeft, fpRight);