[JAEGER] Fixed PROPINC etc using the property cache (bug 589115, r=dmandelin).

--HG--
extra : rebase_source : 6a58de4b3044c6ce4afa160e1fb497df4a6d290b
This commit is contained in:
David Anderson 2010-08-24 00:57:57 -04:00
parent b5c0841ea3
commit 4101030c9e
4 changed files with 24 additions and 4 deletions

View File

@ -2612,8 +2612,21 @@ mjit::Compiler::jsop_setprop(JSAtom *atom)
pic.typeCheck = stubcc.masm.label();
stubcc.linkExit(j, Uses(2));
stubcc.leave();
stubcc.masm.move(ImmPtr(atom), Registers::ArgReg1);
stubcc.call(stubs::SetName);
/*
* This gets called from PROPINC/PROPDEC which aren't compatible with
* the normal SETNAME property cache logic.
*/
JSOp op = JSOp(*PC);
if (op == JSOP_SETNAME || op == JSOP_SETPROP || op == JSOP_SETGNAME || op ==
JSOP_SETMETHOD) {
stubcc.masm.move(ImmPtr(atom), Registers::ArgReg1);
stubcc.call(stubs::SetName);
} else {
stubcc.masm.move(Imm32(pics.length()), Registers::ArgReg1);
stubcc.call(ic::SetPropDumb);
}
typeCheck = stubcc.masm.jump();
pic.hasTypeCheck = true;
} else {

View File

@ -1901,8 +1901,8 @@ ic::GetElem(VMFrame &f, uint32 picIndex)
f.regs.sp[-2] = v;
}
static void JS_FASTCALL
SetPropDumb(VMFrame &f, uint32 index)
void JS_FASTCALL
ic::SetPropDumb(VMFrame &f, uint32 index)
{
JSScript *script = f.fp()->getScript();
ic::PICInfo &pic = script->pics[index];

View File

@ -353,6 +353,7 @@ void JS_FASTCALL SetProp(VMFrame &f, uint32 index);
void JS_FASTCALL CallProp(VMFrame &f, uint32 index);
void JS_FASTCALL Name(VMFrame &f, uint32 index);
void JS_FASTCALL BindName(VMFrame &f, uint32 index);
void JS_FASTCALL SetPropDumb(VMFrame &f, uint32 index);
} /* namespace ic */
} /* namespace mjit */

View File

@ -0,0 +1,6 @@
for each(y in ['', 0, '']) {
y.lastIndexOf--
}
/* Don't assert/crash. */