mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-12 12:55:46 +00:00
Bug 1201810, IonMonkey - Part 0: Improve code of EmitIonTailCallVM, r=jandem
This commit is contained in:
parent
57b5b58c47
commit
dc63c8e3a7
@ -94,9 +94,14 @@ EmitBaselineTailCallVM(JitCode* target, MacroAssembler& masm, uint32_t argSize)
|
||||
inline void
|
||||
EmitIonTailCallVM(JitCode* target, MacroAssembler& masm, uint32_t stackSize)
|
||||
{
|
||||
// For tail calls, find the already pushed JitFrame_IonJS signifying the
|
||||
// end of the Ion frame. Retrieve the length of the frame and repush
|
||||
// JitFrame_IonJS with the extra stacksize, rendering the original
|
||||
// JitFrame_IonJS obsolete.
|
||||
|
||||
ScratchRegisterScope scratch(masm);
|
||||
|
||||
masm.movq(Operand(esp, stackSize), scratch);
|
||||
masm.loadPtr(Address(esp, stackSize), scratch);
|
||||
masm.shrq(Imm32(FRAMESIZE_SHIFT), scratch);
|
||||
masm.addq(Imm32(stackSize + JitStubFrameLayout::Size() - sizeof(intptr_t)), scratch);
|
||||
|
||||
|
@ -95,14 +95,19 @@ EmitBaselineTailCallVM(JitCode* target, MacroAssembler& masm, uint32_t argSize)
|
||||
inline void
|
||||
EmitIonTailCallVM(JitCode* target, MacroAssembler& masm, uint32_t stackSize)
|
||||
{
|
||||
masm.movl(Operand(esp, stackSize), eax);
|
||||
// For tail calls, find the already pushed JitFrame_IonJS signifying the
|
||||
// end of the Ion frame. Retrieve the length of the frame and repush
|
||||
// JitFrame_IonJS with the extra stacksize, rendering the original
|
||||
// JitFrame_IonJS obsolete.
|
||||
|
||||
masm.loadPtr(Address(esp, stackSize), eax);
|
||||
masm.shrl(Imm32(FRAMESIZE_SHIFT), eax);
|
||||
masm.addl(Imm32(stackSize + JitStubFrameLayout::Size() - sizeof(intptr_t)), eax);
|
||||
|
||||
// Push frame descriptor and perform the tail call.
|
||||
masm.makeFrameDescriptor(eax, JitFrame_IonJS);
|
||||
masm.push(eax);
|
||||
masm.push(ICTailCallReg);
|
||||
|
||||
masm.jmp(target);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user