Bug 1168750 - SharedStubs: (part2) Rename registers used by baseline stubs for use with shared stubs, r=jandem

This commit is contained in:
Hannes Verschore 2015-06-08 16:38:54 +02:00
parent c28ca4e027
commit c7b95f0a21
18 changed files with 358 additions and 358 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1137,14 +1137,14 @@ class ICStubCompiler
AllocatableGeneralRegisterSet regs(GeneralRegisterSet::All());
MOZ_ASSERT(!regs.has(BaselineStackReg));
#if defined(JS_CODEGEN_ARM)
MOZ_ASSERT(!regs.has(BaselineTailCallReg));
MOZ_ASSERT(!regs.has(ICTailCallReg));
regs.take(BaselineSecondScratchReg);
#elif defined(JS_CODEGEN_MIPS)
MOZ_ASSERT(!regs.has(BaselineTailCallReg));
MOZ_ASSERT(!regs.has(ICTailCallReg));
MOZ_ASSERT(!regs.has(BaselineSecondScratchReg));
#endif
regs.take(BaselineFrameReg);
regs.take(BaselineStubReg);
regs.take(ICStubReg);
#ifdef JS_CODEGEN_X64
regs.take(ExtractTemp0);
regs.take(ExtractTemp1);

View File

@ -1631,12 +1631,12 @@ MacroAssembler::generateBailoutTail(Register scratch, Register bailoutInfo)
// Restore values where they need to be and resume execution.
AllocatableGeneralRegisterSet enterMonRegs(GeneralRegisterSet::All());
enterMonRegs.take(R0);
enterMonRegs.take(BaselineStubReg);
enterMonRegs.take(ICStubReg);
enterMonRegs.take(BaselineFrameReg);
enterMonRegs.takeUnchecked(BaselineTailCallReg);
enterMonRegs.takeUnchecked(ICTailCallReg);
pop(BaselineStubReg);
pop(BaselineTailCallReg);
pop(ICStubReg);
pop(ICTailCallReg);
pop(BaselineFrameReg);
popValue(R0);
@ -1644,9 +1644,9 @@ MacroAssembler::generateBailoutTail(Register scratch, Register bailoutInfo)
addToStackPtr(Imm32(ExitFrameLayout::SizeWithFooter()));
#if defined(JS_CODEGEN_X86) || defined(JS_CODEGEN_X64)
push(BaselineTailCallReg);
push(ICTailCallReg);
#endif
jump(Address(BaselineStubReg, ICStub::offsetOfStubCode()));
jump(Address(ICStubReg, ICStub::offsetOfStubCode()));
}
//

View File

@ -33,17 +33,17 @@ EmitRepushTailCallReg(MacroAssembler& masm)
inline void
EmitCallIC(CodeOffsetLabel* patchOffset, MacroAssembler& masm)
{
// Move ICEntry offset into BaselineStubReg
CodeOffsetLabel offset = masm.movWithPatch(ImmWord(-1), BaselineStubReg);
// Move ICEntry offset into ICStubReg
CodeOffsetLabel offset = masm.movWithPatch(ImmWord(-1), ICStubReg);
*patchOffset = offset;
// Load stub pointer into BaselineStubReg
masm.loadPtr(Address(BaselineStubReg, ICEntry::offsetOfFirstStub()), BaselineStubReg);
// Load stub pointer into ICStubReg
masm.loadPtr(Address(ICStubReg, ICEntry::offsetOfFirstStub()), ICStubReg);
// Load stubcode pointer from BaselineStubEntry.
// R2 won't be active when we call ICs, so we can use r0.
MOZ_ASSERT(R2 == ValueOperand(r1, r0));
masm.loadPtr(Address(BaselineStubReg, ICStub::offsetOfStubCode()), r0);
masm.loadPtr(Address(ICStubReg, ICStub::offsetOfStubCode()), r0);
// Call the stubcode via a direct branch-and-link.
masm.ma_blx(r0);
@ -53,14 +53,14 @@ inline void
EmitEnterTypeMonitorIC(MacroAssembler& masm,
size_t monitorStubOffset = ICMonitoredStub::offsetOfFirstMonitorStub())
{
// This is expected to be called from within an IC, when BaselineStubReg is
// This is expected to be called from within an IC, when ICStubReg is
// properly initialized to point to the stub.
masm.loadPtr(Address(BaselineStubReg, (uint32_t) monitorStubOffset), BaselineStubReg);
masm.loadPtr(Address(ICStubReg, (uint32_t) monitorStubOffset), ICStubReg);
// Load stubcode pointer from BaselineStubEntry.
// R2 won't be active when we call ICs, so we can use r0.
MOZ_ASSERT(R2 == ValueOperand(r1, r0));
masm.loadPtr(Address(BaselineStubReg, ICStub::offsetOfStubCode()), r0);
masm.loadPtr(Address(ICStubReg, ICStub::offsetOfStubCode()), r0);
// Jump to the stubcode.
masm.branch(r0);
@ -95,10 +95,10 @@ EmitTailCallVM(JitCode* target, MacroAssembler& masm, uint32_t argSize)
masm.store32(r1, Address(BaselineFrameReg, BaselineFrame::reverseOffsetOfFrameSize()));
// Push frame descriptor and perform the tail call.
// BaselineTailCallReg (lr) already contains the return address (as we keep
// ICTailCallReg (lr) already contains the return address (as we keep
// it there through the stub calls), but the VMWrapper code being called
// expects the return address to also be pushed on the stack.
MOZ_ASSERT(BaselineTailCallReg == lr);
MOZ_ASSERT(ICTailCallReg == lr);
masm.makeFrameDescriptor(r0, JitFrame_BaselineJS);
masm.push(r0);
masm.push(lr);
@ -132,7 +132,7 @@ static const uint32_t STUB_FRAME_SAVED_STUB_OFFSET = sizeof(void*);
inline void
EmitEnterStubFrame(MacroAssembler& masm, Register scratch)
{
MOZ_ASSERT(scratch != BaselineTailCallReg);
MOZ_ASSERT(scratch != ICTailCallReg);
// Compute frame size.
masm.mov(BaselineFrameReg, scratch);
@ -147,10 +147,10 @@ EmitEnterStubFrame(MacroAssembler& masm, Register scratch)
// Push frame descriptor and return address.
masm.makeFrameDescriptor(scratch, JitFrame_BaselineJS);
masm.push(scratch);
masm.push(BaselineTailCallReg);
masm.push(ICTailCallReg);
// Save old frame pointer, stack pointer and stub reg.
masm.push(BaselineStubReg);
masm.push(ICStubReg);
masm.push(BaselineFrameReg);
masm.mov(BaselineStackReg, BaselineFrameReg);
@ -174,10 +174,10 @@ EmitLeaveStubFrame(MacroAssembler& masm, bool calledIntoIon = false)
}
masm.pop(BaselineFrameReg);
masm.pop(BaselineStubReg);
masm.pop(ICStubReg);
// Load the return address.
masm.pop(BaselineTailCallReg);
masm.pop(ICTailCallReg);
// Discard the frame descriptor.
masm.pop(ScratchRegister);
@ -233,27 +233,27 @@ EmitCallTypeUpdateIC(MacroAssembler& masm, JitCode* code, uint32_t objectOffset)
// updating is a boxed Value on the stack, at offset objectOffset from esp,
// excluding the return address.
// Save the current BaselineStubReg to stack, as well as the TailCallReg,
// Save the current ICStubReg to stack, as well as the TailCallReg,
// since on ARM, the LR is live.
masm.push(BaselineStubReg);
masm.push(BaselineTailCallReg);
masm.push(ICStubReg);
masm.push(ICTailCallReg);
// This is expected to be called from within an IC, when BaselineStubReg is
// This is expected to be called from within an IC, when ICStubReg is
// properly initialized to point to the stub.
masm.loadPtr(Address(BaselineStubReg, ICUpdatedStub::offsetOfFirstUpdateStub()),
BaselineStubReg);
masm.loadPtr(Address(ICStubReg, ICUpdatedStub::offsetOfFirstUpdateStub()),
ICStubReg);
// TODO: Change r0 uses below to use masm's configurable scratch register instead.
// Load stubcode pointer from BaselineStubReg into BaselineTailCallReg.
masm.loadPtr(Address(BaselineStubReg, ICStub::offsetOfStubCode()), r0);
// Load stubcode pointer from ICStubReg into ICTailCallReg.
masm.loadPtr(Address(ICStubReg, ICStub::offsetOfStubCode()), r0);
// Call the stubcode.
masm.ma_blx(r0);
// Restore the old stub reg and tailcall reg.
masm.pop(BaselineTailCallReg);
masm.pop(BaselineStubReg);
masm.pop(ICTailCallReg);
masm.pop(ICStubReg);
// The update IC will store 0 or 1 in R1.scratchReg() reflecting if the
// value in R0 type-checked properly or not.
@ -268,7 +268,7 @@ EmitCallTypeUpdateIC(MacroAssembler& masm, JitCode* code, uint32_t objectOffset)
masm.pushValue(R0);
masm.pushValue(R1);
masm.push(BaselineStubReg);
masm.push(ICStubReg);
// Load previous frame pointer, push BaselineFrame*.
masm.loadPtr(Address(BaselineFrameReg, 0), R0.scratchReg());
@ -301,14 +301,14 @@ EmitStubGuardFailure(MacroAssembler& masm)
// BaselineStubEntry points to the current stub.
// Load next stub into BaselineStubReg.
masm.loadPtr(Address(BaselineStubReg, ICStub::offsetOfNext()), BaselineStubReg);
// Load next stub into ICStubReg.
masm.loadPtr(Address(ICStubReg, ICStub::offsetOfNext()), ICStubReg);
// Load stubcode pointer from BaselineStubEntry into scratch register.
masm.loadPtr(Address(BaselineStubReg, ICStub::offsetOfStubCode()), r0);
masm.loadPtr(Address(ICStubReg, ICStub::offsetOfStubCode()), r0);
// Return address is already loaded, just jump to the next stubcode.
MOZ_ASSERT(BaselineTailCallReg == lr);
MOZ_ASSERT(ICTailCallReg == lr);
masm.branch(r0);
}

View File

@ -27,10 +27,10 @@ static MOZ_CONSTEXPR_VAR ValueOperand R0(r3, r2);
static MOZ_CONSTEXPR_VAR ValueOperand R1(r5, r4);
static MOZ_CONSTEXPR_VAR ValueOperand R2(r1, r0);
// BaselineTailCallReg and BaselineStubReg
// ICTailCallReg and ICStubReg
// These use registers that are not preserved across calls.
static MOZ_CONSTEXPR_VAR Register BaselineTailCallReg = r14;
static MOZ_CONSTEXPR_VAR Register BaselineStubReg = r9;
static MOZ_CONSTEXPR_VAR Register ICTailCallReg = r14;
static MOZ_CONSTEXPR_VAR Register ICStubReg = r9;
static MOZ_CONSTEXPR_VAR Register ExtractTemp0 = InvalidReg;
static MOZ_CONSTEXPR_VAR Register ExtractTemp1 = InvalidReg;
@ -40,8 +40,8 @@ static MOZ_CONSTEXPR_VAR Register BaselineSecondScratchReg = r6;
// R7 - R9 are generally available for use within stubcode.
// Note that BaselineTailCallReg is actually just the link register. In ARM code
// emission, we do not clobber BaselineTailCallReg since we keep the return
// Note that ICTailCallReg is actually just the link register. In ARM code
// emission, we do not clobber ICTailCallReg since we keep the return
// address for calls there.
// FloatReg0 must be equal to ReturnFloatReg.

View File

@ -979,7 +979,7 @@ JitRuntime::generateDebugTrapHandler(JSContext* cx)
// Enter a stub frame and call the HandleDebugTrap VM function. Ensure the
// stub frame has a nullptr ICStub pointer, since this pointer is marked
// during GC.
masm.movePtr(ImmPtr(nullptr), BaselineStubReg);
masm.movePtr(ImmPtr(nullptr), ICStubReg);
EmitEnterStubFrame(masm, scratch2);
JitCode* code = cx->runtime()->jitRuntime()->getVMWrapper(HandleDebugTrapInfo);

View File

@ -34,16 +34,16 @@ EmitRepushTailCallReg(MacroAssembler& masm)
inline void
EmitCallIC(CodeOffsetLabel* patchOffset, MacroAssembler& masm)
{
// Move ICEntry offset into BaselineStubReg.
CodeOffsetLabel offset = masm.movWithPatch(ImmWord(-1), BaselineStubReg);
// Move ICEntry offset into ICStubReg.
CodeOffsetLabel offset = masm.movWithPatch(ImmWord(-1), ICStubReg);
*patchOffset = offset;
// Load stub pointer into BaselineStubReg.
masm.loadPtr(Address(BaselineStubReg, ICEntry::offsetOfFirstStub()), BaselineStubReg);
// Load stub pointer into ICStubReg.
masm.loadPtr(Address(ICStubReg, ICEntry::offsetOfFirstStub()), ICStubReg);
// Load stubcode pointer from BaselineStubEntry.
// R2 won't be active when we call ICs, so we can use it as scratch.
masm.loadPtr(Address(BaselineStubReg, ICStub::offsetOfStubCode()), R2.scratchReg());
masm.loadPtr(Address(ICStubReg, ICStub::offsetOfStubCode()), R2.scratchReg());
// Call the stubcode via a direct jump-and-link
masm.call(R2.scratchReg());
@ -53,13 +53,13 @@ inline void
EmitEnterTypeMonitorIC(MacroAssembler& masm,
size_t monitorStubOffset = ICMonitoredStub::offsetOfFirstMonitorStub())
{
// This is expected to be called from within an IC, when BaselineStubReg
// This is expected to be called from within an IC, when ICStubReg
// is properly initialized to point to the stub.
masm.loadPtr(Address(BaselineStubReg, (uint32_t) monitorStubOffset), BaselineStubReg);
masm.loadPtr(Address(ICStubReg, (uint32_t) monitorStubOffset), ICStubReg);
// Load stubcode pointer from BaselineStubEntry.
// R2 won't be active when we call ICs, so we can use it.
masm.loadPtr(Address(BaselineStubReg, ICStub::offsetOfStubCode()), R2.scratchReg());
masm.loadPtr(Address(ICStubReg, ICStub::offsetOfStubCode()), R2.scratchReg());
// Jump to the stubcode.
masm.branch(R2.scratchReg());
@ -94,10 +94,10 @@ EmitTailCallVM(JitCode* target, MacroAssembler& masm, uint32_t argSize)
masm.storePtr(t7, Address(BaselineFrameReg, BaselineFrame::reverseOffsetOfFrameSize()));
// Push frame descriptor and perform the tail call.
// BaselineTailCallReg (ra) already contains the return address (as we
// ICTailCallReg (ra) already contains the return address (as we
// keep it there through the stub calls), but the VMWrapper code being
// called expects the return address to also be pushed on the stack.
MOZ_ASSERT(BaselineTailCallReg == ra);
MOZ_ASSERT(ICTailCallReg == ra);
masm.makeFrameDescriptor(t6, JitFrame_BaselineJS);
masm.subPtr(Imm32(sizeof(CommonFrameLayout)), StackPointer);
masm.storePtr(t6, Address(StackPointer, CommonFrameLayout::offsetOfDescriptor()));
@ -139,7 +139,7 @@ static const uint32_t STUB_FRAME_SAVED_STUB_OFFSET = offsetof(BaselineStubFrame,
inline void
EmitEnterStubFrame(MacroAssembler& masm, Register scratch)
{
MOZ_ASSERT(scratch != BaselineTailCallReg);
MOZ_ASSERT(scratch != ICTailCallReg);
// Compute frame size.
masm.movePtr(BaselineFrameReg, scratch);
@ -155,11 +155,11 @@ EmitEnterStubFrame(MacroAssembler& masm, Register scratch)
masm.makeFrameDescriptor(scratch, JitFrame_BaselineJS);
masm.subPtr(Imm32(STUB_FRAME_SIZE), StackPointer);
masm.storePtr(scratch, Address(StackPointer, offsetof(BaselineStubFrame, descriptor)));
masm.storePtr(BaselineTailCallReg, Address(StackPointer,
masm.storePtr(ICTailCallReg, Address(StackPointer,
offsetof(BaselineStubFrame, returnAddress)));
// Save old frame pointer, stack pointer and stub reg.
masm.storePtr(BaselineStubReg, Address(StackPointer,
masm.storePtr(ICStubReg, Address(StackPointer,
offsetof(BaselineStubFrame, savedStub)));
masm.storePtr(BaselineFrameReg, Address(StackPointer,
offsetof(BaselineStubFrame, savedFrame)));
@ -187,11 +187,11 @@ EmitLeaveStubFrame(MacroAssembler& masm, bool calledIntoIon = false)
masm.loadPtr(Address(StackPointer, offsetof(BaselineStubFrame, savedFrame)),
BaselineFrameReg);
masm.loadPtr(Address(StackPointer, offsetof(BaselineStubFrame, savedStub)),
BaselineStubReg);
ICStubReg);
// Load the return address.
masm.loadPtr(Address(StackPointer, offsetof(BaselineStubFrame, returnAddress)),
BaselineTailCallReg);
ICTailCallReg);
// Discard the frame descriptor.
masm.loadPtr(Address(StackPointer, offsetof(BaselineStubFrame, descriptor)), ScratchRegister);
@ -246,26 +246,26 @@ EmitCallTypeUpdateIC(MacroAssembler& masm, JitCode* code, uint32_t objectOffset)
// The object we're updating is a boxed Value on the stack, at offset
// objectOffset from $sp, excluding the return address.
// Save the current BaselineStubReg to stack, as well as the TailCallReg,
// Save the current ICStubReg to stack, as well as the TailCallReg,
// since on mips, the $ra is live.
masm.subPtr(Imm32(2 * sizeof(intptr_t)), StackPointer);
masm.storePtr(BaselineStubReg, Address(StackPointer, sizeof(intptr_t)));
masm.storePtr(BaselineTailCallReg, Address(StackPointer, 0));
masm.storePtr(ICStubReg, Address(StackPointer, sizeof(intptr_t)));
masm.storePtr(ICTailCallReg, Address(StackPointer, 0));
// This is expected to be called from within an IC, when BaselineStubReg
// This is expected to be called from within an IC, when ICStubReg
// is properly initialized to point to the stub.
masm.loadPtr(Address(BaselineStubReg, ICUpdatedStub::offsetOfFirstUpdateStub()),
BaselineStubReg);
masm.loadPtr(Address(ICStubReg, ICUpdatedStub::offsetOfFirstUpdateStub()),
ICStubReg);
// Load stubcode pointer from BaselineStubReg into BaselineTailCallReg.
masm.loadPtr(Address(BaselineStubReg, ICStub::offsetOfStubCode()), R2.scratchReg());
// Load stubcode pointer from ICStubReg into ICTailCallReg.
masm.loadPtr(Address(ICStubReg, ICStub::offsetOfStubCode()), R2.scratchReg());
// Call the stubcode.
masm.call(R2.scratchReg());
// Restore the old stub reg and tailcall reg.
masm.loadPtr(Address(StackPointer, 0), BaselineTailCallReg);
masm.loadPtr(Address(StackPointer, sizeof(intptr_t)), BaselineStubReg);
masm.loadPtr(Address(StackPointer, 0), ICTailCallReg);
masm.loadPtr(Address(StackPointer, sizeof(intptr_t)), ICStubReg);
masm.addPtr(Imm32(2 * sizeof(intptr_t)), StackPointer);
// The update IC will store 0 or 1 in R1.scratchReg() reflecting if the
@ -280,7 +280,7 @@ EmitCallTypeUpdateIC(MacroAssembler& masm, JitCode* code, uint32_t objectOffset)
masm.pushValue(R0);
masm.pushValue(R1);
masm.push(BaselineStubReg);
masm.push(ICStubReg);
// Load previous frame pointer, push BaselineFrame*.
masm.loadPtr(Address(BaselineFrameReg, 0), R0.scratchReg());
@ -311,14 +311,14 @@ EmitStubGuardFailure(MacroAssembler& masm)
// BaselineStubEntry points to the current stub.
// Load next stub into BaselineStubReg
masm.loadPtr(Address(BaselineStubReg, ICStub::offsetOfNext()), BaselineStubReg);
// Load next stub into ICStubReg
masm.loadPtr(Address(ICStubReg, ICStub::offsetOfNext()), ICStubReg);
// Load stubcode pointer from BaselineStubEntry into scratch register.
masm.loadPtr(Address(BaselineStubReg, ICStub::offsetOfStubCode()), R2.scratchReg());
masm.loadPtr(Address(ICStubReg, ICStub::offsetOfStubCode()), R2.scratchReg());
// Return address is already loaded, just jump to the next stubcode.
MOZ_ASSERT(BaselineTailCallReg == ra);
MOZ_ASSERT(ICTailCallReg == ra);
masm.branch(R2.scratchReg());
}

View File

@ -19,10 +19,10 @@ static MOZ_CONSTEXPR_VAR ValueOperand R0(a3, a2);
static MOZ_CONSTEXPR_VAR ValueOperand R1(s7, s6);
static MOZ_CONSTEXPR_VAR ValueOperand R2(t7, t6);
// BaselineTailCallReg and BaselineStubReg
// ICTailCallReg and ICStubReg
// These use registers that are not preserved across calls.
static MOZ_CONSTEXPR_VAR Register BaselineTailCallReg = ra;
static MOZ_CONSTEXPR_VAR Register BaselineStubReg = t5;
static MOZ_CONSTEXPR_VAR Register ICTailCallReg = ra;
static MOZ_CONSTEXPR_VAR Register ICStubReg = t5;
static MOZ_CONSTEXPR_VAR Register ExtractTemp0 = InvalidReg;
static MOZ_CONSTEXPR_VAR Register ExtractTemp1 = InvalidReg;
@ -30,8 +30,8 @@ static MOZ_CONSTEXPR_VAR Register ExtractTemp1 = InvalidReg;
// Register used internally by MacroAssemblerMIPS.
static MOZ_CONSTEXPR_VAR Register BaselineSecondScratchReg = SecondScratchReg;
// Note that BaselineTailCallReg is actually just the link register.
// In MIPS code emission, we do not clobber BaselineTailCallReg since we keep
// Note that ICTailCallReg is actually just the link register.
// In MIPS code emission, we do not clobber ICTailCallReg since we keep
// the return address for calls there.
// FloatReg0 must be equal to ReturnFloatReg.

View File

@ -947,7 +947,7 @@ JitRuntime::generateDebugTrapHandler(JSContext* cx)
// Enter a stub frame and call the HandleDebugTrap VM function. Ensure
// the stub frame has a nullptr ICStub pointer, since this pointer is
// marked during GC.
masm.movePtr(ImmPtr(nullptr), BaselineStubReg);
masm.movePtr(ImmPtr(nullptr), ICStubReg);
EmitEnterStubFrame(masm, scratch2);
JitCode* code = cx->runtime()->jitRuntime()->getVMWrapper(HandleDebugTrapInfo);

View File

@ -19,8 +19,8 @@ static MOZ_CONSTEXPR_VAR ValueOperand R0 = JSReturnOperand;
static MOZ_CONSTEXPR_VAR ValueOperand R1 = JSReturnOperand;
static MOZ_CONSTEXPR_VAR ValueOperand R2 = JSReturnOperand;
static MOZ_CONSTEXPR_VAR Register BaselineTailCallReg = { Registers::invalid_reg };
static MOZ_CONSTEXPR_VAR Register BaselineStubReg = { Registers::invalid_reg };
static MOZ_CONSTEXPR_VAR Register ICTailCallReg = { Registers::invalid_reg };
static MOZ_CONSTEXPR_VAR Register ICStubReg = { Registers::invalid_reg };
static MOZ_CONSTEXPR_VAR Register ExtractTemp0 = { Registers::invalid_reg };
static MOZ_CONSTEXPR_VAR Register ExtractTemp1 = { Registers::invalid_reg };

View File

@ -108,17 +108,17 @@ BaselineCompilerShared::callVM(const VMFunction& fun, CallVMPhase phase)
Imm32(BaselineFrame::OVER_RECURSED),
&writePostInitialize);
masm.move32(Imm32(frameBaseSize), BaselineTailCallReg);
masm.move32(Imm32(frameBaseSize), ICTailCallReg);
masm.jump(&afterWrite);
masm.bind(&writePostInitialize);
masm.move32(Imm32(frameFullSize), BaselineTailCallReg);
masm.move32(Imm32(frameFullSize), ICTailCallReg);
masm.bind(&afterWrite);
masm.store32(BaselineTailCallReg, frameSizeAddress);
masm.add32(Imm32(argSize), BaselineTailCallReg);
masm.makeFrameDescriptor(BaselineTailCallReg, JitFrame_BaselineJS);
masm.push(BaselineTailCallReg);
masm.store32(ICTailCallReg, frameSizeAddress);
masm.add32(Imm32(argSize), ICTailCallReg);
masm.makeFrameDescriptor(ICTailCallReg, JitFrame_BaselineJS);
masm.push(ICTailCallReg);
}
MOZ_ASSERT(fun.expectTailCall == NonTailCall);
// Perform the call.

View File

@ -21,40 +21,40 @@ static const size_t ICStackValueOffset = sizeof(void*);
inline void
EmitRestoreTailCallReg(MacroAssembler& masm)
{
masm.pop(BaselineTailCallReg);
masm.pop(ICTailCallReg);
}
inline void
EmitRepushTailCallReg(MacroAssembler& masm)
{
masm.push(BaselineTailCallReg);
masm.push(ICTailCallReg);
}
inline void
EmitCallIC(CodeOffsetLabel* patchOffset, MacroAssembler& masm)
{
// Move ICEntry offset into BaselineStubReg
CodeOffsetLabel offset = masm.movWithPatch(ImmWord(-1), BaselineStubReg);
// Move ICEntry offset into ICStubReg
CodeOffsetLabel offset = masm.movWithPatch(ImmWord(-1), ICStubReg);
*patchOffset = offset;
// Load stub pointer into BaselineStubReg
masm.loadPtr(Address(BaselineStubReg, (int32_t) ICEntry::offsetOfFirstStub()),
BaselineStubReg);
// Load stub pointer into ICStubReg
masm.loadPtr(Address(ICStubReg, (int32_t) ICEntry::offsetOfFirstStub()),
ICStubReg);
// Call the stubcode.
masm.call(Operand(BaselineStubReg, ICStub::offsetOfStubCode()));
masm.call(Operand(ICStubReg, ICStub::offsetOfStubCode()));
}
inline void
EmitEnterTypeMonitorIC(MacroAssembler& masm,
size_t monitorStubOffset = ICMonitoredStub::offsetOfFirstMonitorStub())
{
// This is expected to be called from within an IC, when BaselineStubReg
// This is expected to be called from within an IC, when ICStubReg
// is properly initialized to point to the stub.
masm.loadPtr(Address(BaselineStubReg, (int32_t) monitorStubOffset), BaselineStubReg);
masm.loadPtr(Address(ICStubReg, (int32_t) monitorStubOffset), ICStubReg);
// Jump to the stubcode.
masm.jmp(Operand(BaselineStubReg, (int32_t) ICStub::offsetOfStubCode()));
masm.jmp(Operand(ICStubReg, (int32_t) ICStub::offsetOfStubCode()));
}
inline void
@ -85,7 +85,7 @@ EmitTailCallVM(JitCode* target, MacroAssembler& masm, uint32_t argSize)
// Push frame descriptor and perform the tail call.
masm.makeFrameDescriptor(ScratchReg, JitFrame_BaselineJS);
masm.push(ScratchReg);
masm.push(BaselineTailCallReg);
masm.push(ICTailCallReg);
masm.jmp(target);
}
@ -131,10 +131,10 @@ EmitEnterStubFrame(MacroAssembler& masm, Register)
// Push frame descriptor and return address.
masm.makeFrameDescriptor(ScratchReg, JitFrame_BaselineJS);
masm.push(ScratchReg);
masm.push(BaselineTailCallReg);
masm.push(ICTailCallReg);
// Save old frame pointer, stack pointer and stub reg.
masm.push(BaselineStubReg);
masm.push(ICStubReg);
masm.push(BaselineFrameReg);
masm.mov(BaselineStackReg, BaselineFrameReg);
}
@ -155,14 +155,14 @@ EmitLeaveStubFrame(MacroAssembler& masm, bool calledIntoIon = false)
}
masm.pop(BaselineFrameReg);
masm.pop(BaselineStubReg);
masm.pop(ICStubReg);
// Pop return address.
masm.pop(BaselineTailCallReg);
masm.pop(ICTailCallReg);
// Overwrite frame descriptor with return address, so that the stack matches
// the state before entering the stub frame.
masm.storePtr(BaselineTailCallReg, Address(BaselineStackReg, 0));
masm.storePtr(ICTailCallReg, Address(BaselineStackReg, 0));
}
inline void
@ -172,16 +172,16 @@ EmitStowICValues(MacroAssembler& masm, int values)
switch(values) {
case 1:
// Stow R0
masm.pop(BaselineTailCallReg);
masm.pop(ICTailCallReg);
masm.pushValue(R0);
masm.push(BaselineTailCallReg);
masm.push(ICTailCallReg);
break;
case 2:
// Stow R0 and R1
masm.pop(BaselineTailCallReg);
masm.pop(ICTailCallReg);
masm.pushValue(R0);
masm.pushValue(R1);
masm.push(BaselineTailCallReg);
masm.push(ICTailCallReg);
break;
}
}
@ -193,23 +193,23 @@ EmitUnstowICValues(MacroAssembler& masm, int values, bool discard = false)
switch(values) {
case 1:
// Unstow R0
masm.pop(BaselineTailCallReg);
masm.pop(ICTailCallReg);
if (discard)
masm.addPtr(Imm32(sizeof(Value)), BaselineStackReg);
else
masm.popValue(R0);
masm.push(BaselineTailCallReg);
masm.push(ICTailCallReg);
break;
case 2:
// Unstow R0 and R1
masm.pop(BaselineTailCallReg);
masm.pop(ICTailCallReg);
if (discard) {
masm.addPtr(Imm32(sizeof(Value) * 2), BaselineStackReg);
} else {
masm.popValue(R1);
masm.popValue(R0);
}
masm.push(BaselineTailCallReg);
masm.push(ICTailCallReg);
break;
}
}
@ -221,19 +221,19 @@ EmitCallTypeUpdateIC(MacroAssembler& masm, JitCode* code, uint32_t objectOffset)
// The object we're updating is a boxed Value on the stack, at offset
// objectOffset from stack top, excluding the return address.
// Save the current BaselineStubReg to stack
masm.push(BaselineStubReg);
// Save the current ICStubReg to stack
masm.push(ICStubReg);
// This is expected to be called from within an IC, when BaselineStubReg
// This is expected to be called from within an IC, when ICStubReg
// is properly initialized to point to the stub.
masm.loadPtr(Address(BaselineStubReg, (int32_t) ICUpdatedStub::offsetOfFirstUpdateStub()),
BaselineStubReg);
masm.loadPtr(Address(ICStubReg, (int32_t) ICUpdatedStub::offsetOfFirstUpdateStub()),
ICStubReg);
// Call the stubcode.
masm.call(Operand(BaselineStubReg, ICStub::offsetOfStubCode()));
masm.call(Operand(ICStubReg, ICStub::offsetOfStubCode()));
// Restore the old stub reg.
masm.pop(BaselineStubReg);
masm.pop(ICStubReg);
// The update IC will store 0 or 1 in R1.scratchReg() reflecting if the
// value in R0 type-checked properly or not.
@ -248,7 +248,7 @@ EmitCallTypeUpdateIC(MacroAssembler& masm, JitCode* code, uint32_t objectOffset)
masm.pushValue(R0);
masm.pushValue(R1);
masm.push(BaselineStubReg);
masm.push(ICStubReg);
// Load previous frame pointer, push BaselineFrame*.
masm.loadPtr(Address(BaselineFrameReg, 0), R0.scratchReg());
@ -276,11 +276,11 @@ EmitStubGuardFailure(MacroAssembler& masm)
// BaselineStubEntry points to the current stub.
// Load next stub into BaselineStubReg
masm.loadPtr(Address(BaselineStubReg, ICStub::offsetOfNext()), BaselineStubReg);
// Load next stub into ICStubReg
masm.loadPtr(Address(ICStubReg, ICStub::offsetOfNext()), ICStubReg);
// Return address is already loaded, just jump to the next stubcode.
masm.jmp(Operand(BaselineStubReg, ICStub::offsetOfStubCode()));
masm.jmp(Operand(ICStubReg, ICStub::offsetOfStubCode()));
}
} // namespace jit

View File

@ -19,8 +19,8 @@ static MOZ_CONSTEXPR_VAR ValueOperand R0(rcx);
static MOZ_CONSTEXPR_VAR ValueOperand R1(rbx);
static MOZ_CONSTEXPR_VAR ValueOperand R2(rax);
static MOZ_CONSTEXPR_VAR Register BaselineTailCallReg = rsi;
static MOZ_CONSTEXPR_VAR Register BaselineStubReg = rdi;
static MOZ_CONSTEXPR_VAR Register ICTailCallReg = rsi;
static MOZ_CONSTEXPR_VAR Register ICStubReg = rdi;
static MOZ_CONSTEXPR_VAR Register ExtractTemp0 = r14;
static MOZ_CONSTEXPR_VAR Register ExtractTemp1 = r15;

View File

@ -869,7 +869,7 @@ JitRuntime::generateDebugTrapHandler(JSContext* cx)
// Enter a stub frame and call the HandleDebugTrap VM function. Ensure
// the stub frame has a nullptr ICStub pointer, since this pointer is marked
// during GC.
masm.movePtr(ImmPtr(nullptr), BaselineStubReg);
masm.movePtr(ImmPtr(nullptr), ICStubReg);
EmitEnterStubFrame(masm, scratch3);
JitCode* code = cx->runtime()->jitRuntime()->getVMWrapper(HandleDebugTrapInfo);

View File

@ -54,7 +54,7 @@ ICBinaryArith_Int32::Compiler::generateStubCode(MacroAssembler& masm)
// Add R0 and R1. Don't need to explicitly unbox, just use the TailCallReg which
// should be available.
Register scratchReg = BaselineTailCallReg;
Register scratchReg = ICTailCallReg;
Label revertRegister, maybeNegZero;
switch(op_) {

View File

@ -21,41 +21,41 @@ static const size_t ICStackValueOffset = sizeof(void*);
inline void
EmitRestoreTailCallReg(MacroAssembler& masm)
{
masm.pop(BaselineTailCallReg);
masm.pop(ICTailCallReg);
}
inline void
EmitRepushTailCallReg(MacroAssembler& masm)
{
masm.push(BaselineTailCallReg);
masm.push(ICTailCallReg);
}
inline void
EmitCallIC(CodeOffsetLabel* patchOffset, MacroAssembler& masm)
{
// Move ICEntry offset into BaselineStubReg
CodeOffsetLabel offset = masm.movWithPatch(ImmWord(-1), BaselineStubReg);
// Move ICEntry offset into ICStubReg
CodeOffsetLabel offset = masm.movWithPatch(ImmWord(-1), ICStubReg);
*patchOffset = offset;
// Load stub pointer into BaselineStubReg
masm.loadPtr(Address(BaselineStubReg, (int32_t) ICEntry::offsetOfFirstStub()),
BaselineStubReg);
// Load stub pointer into ICStubReg
masm.loadPtr(Address(ICStubReg, (int32_t) ICEntry::offsetOfFirstStub()),
ICStubReg);
// Load stubcode pointer from BaselineStubEntry into BaselineTailCallReg
// BaselineTailCallReg will always be unused in the contexts where ICs are called.
masm.call(Operand(BaselineStubReg, ICStub::offsetOfStubCode()));
// Load stubcode pointer from BaselineStubEntry into ICTailCallReg
// ICTailCallReg will always be unused in the contexts where ICs are called.
masm.call(Operand(ICStubReg, ICStub::offsetOfStubCode()));
}
inline void
EmitEnterTypeMonitorIC(MacroAssembler& masm,
size_t monitorStubOffset = ICMonitoredStub::offsetOfFirstMonitorStub())
{
// This is expected to be called from within an IC, when BaselineStubReg
// This is expected to be called from within an IC, when ICStubReg
// is properly initialized to point to the stub.
masm.loadPtr(Address(BaselineStubReg, (int32_t) monitorStubOffset), BaselineStubReg);
masm.loadPtr(Address(ICStubReg, (int32_t) monitorStubOffset), ICStubReg);
// Jump to the stubcode.
masm.jmp(Operand(BaselineStubReg, (int32_t) ICStub::offsetOfStubCode()));
masm.jmp(Operand(ICStubReg, (int32_t) ICStub::offsetOfStubCode()));
}
inline void
@ -88,7 +88,7 @@ EmitTailCallVM(JitCode* target, MacroAssembler& masm, uint32_t argSize)
// Push frame descriptor and perform the tail call.
masm.makeFrameDescriptor(eax, JitFrame_BaselineJS);
masm.push(eax);
masm.push(BaselineTailCallReg);
masm.push(ICTailCallReg);
masm.jmp(target);
}
@ -119,7 +119,7 @@ static const uint32_t STUB_FRAME_SAVED_STUB_OFFSET = sizeof(void*);
inline void
EmitEnterStubFrame(MacroAssembler& masm, Register scratch)
{
MOZ_ASSERT(scratch != BaselineTailCallReg);
MOZ_ASSERT(scratch != ICTailCallReg);
EmitRestoreTailCallReg(masm);
@ -136,10 +136,10 @@ EmitEnterStubFrame(MacroAssembler& masm, Register scratch)
// Push frame descriptor and return address.
masm.makeFrameDescriptor(scratch, JitFrame_BaselineJS);
masm.push(scratch);
masm.push(BaselineTailCallReg);
masm.push(ICTailCallReg);
// Save old frame pointer, stack pointer and stub reg.
masm.push(BaselineStubReg);
masm.push(ICStubReg);
masm.push(BaselineFrameReg);
masm.mov(BaselineStackReg, BaselineFrameReg);
}
@ -152,7 +152,7 @@ EmitLeaveStubFrame(MacroAssembler& masm, bool calledIntoIon = false)
// If we performed a VM call, the descriptor has been popped already so
// in that case we use the frame pointer.
if (calledIntoIon) {
Register scratch = BaselineTailCallReg;
Register scratch = ICTailCallReg;
masm.pop(scratch);
masm.shrl(Imm32(FRAMESIZE_SHIFT), scratch);
masm.addl(scratch, BaselineStackReg);
@ -161,14 +161,14 @@ EmitLeaveStubFrame(MacroAssembler& masm, bool calledIntoIon = false)
}
masm.pop(BaselineFrameReg);
masm.pop(BaselineStubReg);
masm.pop(ICStubReg);
// Pop return address.
masm.pop(BaselineTailCallReg);
masm.pop(ICTailCallReg);
// Overwrite frame descriptor with return address, so that the stack matches
// the state before entering the stub frame.
masm.storePtr(BaselineTailCallReg, Address(BaselineStackReg, 0));
masm.storePtr(ICTailCallReg, Address(BaselineStackReg, 0));
}
inline void
@ -178,16 +178,16 @@ EmitStowICValues(MacroAssembler& masm, int values)
switch(values) {
case 1:
// Stow R0
masm.pop(BaselineTailCallReg);
masm.pop(ICTailCallReg);
masm.pushValue(R0);
masm.push(BaselineTailCallReg);
masm.push(ICTailCallReg);
break;
case 2:
// Stow R0 and R1
masm.pop(BaselineTailCallReg);
masm.pop(ICTailCallReg);
masm.pushValue(R0);
masm.pushValue(R1);
masm.push(BaselineTailCallReg);
masm.push(ICTailCallReg);
break;
}
}
@ -199,23 +199,23 @@ EmitUnstowICValues(MacroAssembler& masm, int values, bool discard = false)
switch(values) {
case 1:
// Unstow R0
masm.pop(BaselineTailCallReg);
masm.pop(ICTailCallReg);
if (discard)
masm.addPtr(Imm32(sizeof(Value)), BaselineStackReg);
else
masm.popValue(R0);
masm.push(BaselineTailCallReg);
masm.push(ICTailCallReg);
break;
case 2:
// Unstow R0 and R1
masm.pop(BaselineTailCallReg);
masm.pop(ICTailCallReg);
if (discard) {
masm.addPtr(Imm32(sizeof(Value) * 2), BaselineStackReg);
} else {
masm.popValue(R1);
masm.popValue(R0);
}
masm.push(BaselineTailCallReg);
masm.push(ICTailCallReg);
break;
}
}
@ -227,19 +227,19 @@ EmitCallTypeUpdateIC(MacroAssembler& masm, JitCode* code, uint32_t objectOffset)
// The object we're updating is a boxed Value on the stack, at offset
// objectOffset from stack top, excluding the return address.
// Save the current BaselineStubReg to stack
masm.push(BaselineStubReg);
// Save the current ICStubReg to stack
masm.push(ICStubReg);
// This is expected to be called from within an IC, when BaselineStubReg
// This is expected to be called from within an IC, when ICStubReg
// is properly initialized to point to the stub.
masm.loadPtr(Address(BaselineStubReg, (int32_t) ICUpdatedStub::offsetOfFirstUpdateStub()),
BaselineStubReg);
masm.loadPtr(Address(ICStubReg, (int32_t) ICUpdatedStub::offsetOfFirstUpdateStub()),
ICStubReg);
// Call the stubcode.
masm.call(Operand(BaselineStubReg, ICStub::offsetOfStubCode()));
masm.call(Operand(ICStubReg, ICStub::offsetOfStubCode()));
// Restore the old stub reg.
masm.pop(BaselineStubReg);
masm.pop(ICStubReg);
// The update IC will store 0 or 1 in R1.scratchReg() reflecting if the
// value in R0 type-checked properly or not.
@ -254,7 +254,7 @@ EmitCallTypeUpdateIC(MacroAssembler& masm, JitCode* code, uint32_t objectOffset)
masm.pushValue(R0);
masm.pushValue(R1);
masm.push(BaselineStubReg);
masm.push(ICStubReg);
// Load previous frame pointer, push BaselineFrame*.
masm.loadPtr(Address(BaselineFrameReg, 0), R0.scratchReg());
@ -282,11 +282,11 @@ EmitStubGuardFailure(MacroAssembler& masm)
// BaselineStubEntry points to the current stub.
// Load next stub into BaselineStubReg
masm.loadPtr(Address(BaselineStubReg, (int32_t) ICStub::offsetOfNext()), BaselineStubReg);
// Load next stub into ICStubReg
masm.loadPtr(Address(ICStubReg, (int32_t) ICStub::offsetOfNext()), ICStubReg);
// Return address is already loaded, just jump to the next stubcode.
masm.jmp(Operand(BaselineStubReg, (int32_t) ICStub::offsetOfStubCode()));
masm.jmp(Operand(ICStubReg, (int32_t) ICStub::offsetOfStubCode()));
}

View File

@ -20,10 +20,10 @@ static MOZ_CONSTEXPR_VAR ValueOperand R0(ecx, edx);
static MOZ_CONSTEXPR_VAR ValueOperand R1(eax, ebx);
static MOZ_CONSTEXPR_VAR ValueOperand R2(esi, edi);
// BaselineTailCallReg and BaselineStubReg reuse
// ICTailCallReg and ICStubReg reuse
// registers from R2.
static MOZ_CONSTEXPR_VAR Register BaselineTailCallReg = esi;
static MOZ_CONSTEXPR_VAR Register BaselineStubReg = edi;
static MOZ_CONSTEXPR_VAR Register ICTailCallReg = esi;
static MOZ_CONSTEXPR_VAR Register ICStubReg = edi;
static MOZ_CONSTEXPR_VAR Register ExtractTemp0 = InvalidReg;
static MOZ_CONSTEXPR_VAR Register ExtractTemp1 = InvalidReg;

View File

@ -897,7 +897,7 @@ JitRuntime::generateDebugTrapHandler(JSContext* cx)
// Enter a stub frame and call the HandleDebugTrap VM function. Ensure
// the stub frame has a nullptr ICStub pointer, since this pointer is
// marked during GC.
masm.movePtr(ImmPtr(nullptr), BaselineStubReg);
masm.movePtr(ImmPtr(nullptr), ICStubReg);
EmitEnterStubFrame(masm, scratch3);
JitCode* code = cx->runtime()->jitRuntime()->getVMWrapper(HandleDebugTrapInfo);