JM: Bug 574697, eagerly calculate |this|. (r=dvander)
This commit is contained in:
@@ -2337,23 +2337,13 @@ mjit::Compiler::jsop_getarg(uint32 index)
|
||||
void
|
||||
mjit::Compiler::jsop_this()
|
||||
{
|
||||
/*
|
||||
* :FIXME: We don't know whether it's a funobj or not... but we
|
||||
* DO know it's an object! This can help downstream opcodes.
|
||||
*/
|
||||
RegisterID reg = frame.allocReg();
|
||||
masm.load32(Address(JSFrameReg, offsetof(JSStackFrame, flags)), reg);
|
||||
masm.and32(Imm32(JSFRAME_COMPUTED_THIS), reg);
|
||||
Jump j = masm.branchTest32(Assembler::Zero, reg, reg);
|
||||
stubcc.linkExit(j);
|
||||
|
||||
frame.push(Address(JSFrameReg, offsetof(JSStackFrame, thisv)));
|
||||
FrameEntry *thisv = frame.peek(-1);
|
||||
Jump null = frame.testNull(Assembler::Equal, thisv);
|
||||
stubcc.linkExit(null);
|
||||
stubcc.leave();
|
||||
stubcc.call(stubs::This);
|
||||
|
||||
frame.freeReg(reg);
|
||||
frame.push(Address(JSFrameReg, offsetof(JSStackFrame, thisv)));
|
||||
|
||||
stubcc.rejoin(0);
|
||||
stubcc.rejoin(1);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user