Bug 1776666 part 1 - Remove BaselineStackReg alias. r=iain

`BaselineFrameReg` was removed a few weeks ago.

Differential Revision: https://phabricator.services.mozilla.com/D150371
This commit is contained in:
Jan de Mooij 2022-06-28 06:44:38 +00:00
Родитель a5305169eb
Коммит 3132097598
17 изменённых файлов: 26 добавлений и 48 удалений

Просмотреть файл

@ -112,19 +112,15 @@ AllocatableGeneralRegisterSet BaselineICAvailableGeneralRegs(size_t numInputs) {
AllocatableGeneralRegisterSet regs(GeneralRegisterSet::All());
MOZ_ASSERT(!regs.has(FramePointer));
#if defined(JS_CODEGEN_ARM)
MOZ_ASSERT(!regs.has(BaselineStackReg));
MOZ_ASSERT(!regs.has(ICTailCallReg));
regs.take(BaselineSecondScratchReg);
#elif defined(JS_CODEGEN_MIPS32) || defined(JS_CODEGEN_MIPS64)
MOZ_ASSERT(!regs.has(BaselineStackReg));
MOZ_ASSERT(!regs.has(ICTailCallReg));
MOZ_ASSERT(!regs.has(BaselineSecondScratchReg));
#elif defined(JS_CODEGEN_ARM64)
MOZ_ASSERT(!regs.has(PseudoStackPointer));
MOZ_ASSERT(!regs.has(RealStackPointer));
MOZ_ASSERT(!regs.has(ICTailCallReg));
#else
MOZ_ASSERT(!regs.has(BaselineStackReg));
#endif
regs.take(ICStubReg);
@ -1708,9 +1704,8 @@ bool FallbackICCodeCompiler::emitCall(bool isSpread, bool isConstructing) {
// Push a stub frame so that we can perform a non-tail call.
enterStubFrame(masm, R1.scratchReg());
// Use FramePointer instead of BaselineStackReg, because
// FramePointer and BaselineStackReg hold the same value just after
// calling enterStubFrame.
// Use FramePointer instead of StackPointer because it's not affected by
// the stack pushes below.
// newTarget
uint32_t valueOffset = 0;

Просмотреть файл

@ -24,7 +24,7 @@ inline void EmitBaselineTailCallVM(TrampolinePtr target, MacroAssembler& masm,
// Store frame size without VMFunction arguments for debug assertions.
masm.movePtr(FramePointer, r0);
masm.ma_sub(BaselineStackReg, r0);
masm.ma_sub(StackPointer, r0);
masm.sub32(Imm32(argSize), r0);
Address frameSizeAddr(FramePointer,
BaselineFrame::reverseOffsetOfDebugFrameSize());
@ -52,7 +52,7 @@ inline void EmitBaselineEnterStubFrame(MacroAssembler& masm, Register scratch) {
#ifdef DEBUG
// Compute frame size.
masm.mov(FramePointer, scratch);
masm.ma_sub(BaselineStackReg, scratch);
masm.ma_sub(StackPointer, scratch);
Address frameSizeAddr(FramePointer,
BaselineFrame::reverseOffsetOfDebugFrameSize());
@ -68,7 +68,7 @@ inline void EmitBaselineEnterStubFrame(MacroAssembler& masm, Register scratch) {
// Save old frame pointer, stack pointer and stub reg.
masm.Push(FramePointer);
masm.mov(BaselineStackReg, FramePointer);
masm.mov(StackPointer, FramePointer);
masm.Push(ICStubReg);

Просмотреть файл

@ -16,10 +16,8 @@ namespace jit {
// r15 = program-counter
// r14 = link-register
// r13 = stack-pointer
// r11 = frame-pointer
static constexpr Register BaselineStackReg = sp;
// ValueOperands R0, R1, and R2.
// R0 == JSReturnReg, and R2 uses registers not preserved across calls. R1 value

Просмотреть файл

@ -14,9 +14,6 @@
namespace js {
namespace jit {
// BaselineStackReg is intentionally undefined on ARM64.
// Refer to the comment next to the definition of RealStackPointer.
// ValueOperands R0, R1, and R2.
// R0 == JSReturnReg, and R2 uses registers not preserved across calls.
// R1 value should be preserved across calls.

Просмотреть файл

@ -22,7 +22,7 @@ inline void EmitBaselineTailCallVM(TrampolinePtr target, MacroAssembler& masm,
// Compute frame size.
masm.movePtr(FramePointer, scratch);
masm.subPtr(BaselineStackReg, scratch);
masm.subPtr(StackPointer, scratch);
// Store frame size without VMFunction arguments for debug assertions.
masm.subPtr(Imm32(argSize), scratch);
@ -57,7 +57,7 @@ inline void EmitBaselineEnterStubFrame(MacroAssembler& masm, Register scratch) {
#ifdef DEBUG
// Compute frame size.
masm.movePtr(FramePointer, scratch);
masm.subPtr(BaselineStackReg, scratch);
masm.subPtr(StackPointer, scratch);
Address frameSizeAddr(FramePointer,
BaselineFrame::reverseOffsetOfDebugFrameSize());
@ -73,7 +73,7 @@ inline void EmitBaselineEnterStubFrame(MacroAssembler& masm, Register scratch) {
// Save old frame pointer, stack pointer and stub reg.
masm.Push(FramePointer);
masm.movePtr(BaselineStackReg, FramePointer);
masm.movePtr(StackPointer, FramePointer);
masm.Push(ICStubReg);
// Stack should remain aligned.

Просмотреть файл

@ -14,8 +14,6 @@
namespace js {
namespace jit {
static constexpr Register BaselineStackReg = sp;
// ValueOperands R0, R1, and R2.
// R0 == JSReturnReg, and R2 uses registers not preserved across calls. R1 value
// should be preserved across calls.

Просмотреть файл

@ -23,7 +23,7 @@ inline void EmitBaselineTailCallVM(TrampolinePtr target, MacroAssembler& masm,
// Store frame size without VMFunction arguments for debug assertions.
masm.movePtr(FramePointer, scratch);
masm.addPtr(Imm32(BaselineFrame::FramePointerOffset), scratch);
masm.subPtr(BaselineStackReg, scratch);
masm.subPtr(StackPointer, scratch);
masm.subPtr(Imm32(argSize), scratch);
Address frameSizeAddr(FramePointer,
BaselineFrame::reverseOffsetOfDebugFrameSize());
@ -56,7 +56,7 @@ inline void EmitBaselineEnterStubFrame(MacroAssembler& masm, Register scratch) {
// Compute frame size.
masm.movePtr(FramePointer, scratch);
masm.addPtr(Imm32(BaselineFrame::FramePointerOffset), scratch);
masm.subPtr(BaselineStackReg, scratch);
masm.subPtr(StackPointer, scratch);
Address frameSizeAddr(FramePointer,
BaselineFrame::reverseOffsetOfDebugFrameSize());
@ -78,7 +78,7 @@ inline void EmitBaselineEnterStubFrame(MacroAssembler& masm, Register scratch) {
Address(StackPointer, offsetof(BaselineStubFrame, savedStub)));
masm.storePtr(FramePointer,
Address(StackPointer, offsetof(BaselineStubFrame, savedFrame)));
masm.movePtr(BaselineStackReg, FramePointer);
masm.movePtr(StackPointer, FramePointer);
// Stack should remain aligned.
masm.assertStackAlignment(sizeof(Value), 0);

Просмотреть файл

@ -48,7 +48,7 @@ inline void EmitCallIC(MacroAssembler& masm, CodeOffset* callOffset) {
inline void EmitReturnFromIC(MacroAssembler& masm) { masm.branch(ra); }
inline void EmitBaselineLeaveStubFrame(MacroAssembler& masm) {
masm.movePtr(FramePointer, BaselineStackReg);
masm.movePtr(FramePointer, StackPointer);
masm.loadPtr(Address(StackPointer, offsetof(BaselineStubFrame, savedFrame)),
FramePointer);

Просмотреть файл

@ -14,8 +14,6 @@
namespace js {
namespace jit {
static constexpr Register BaselineStackReg = sp;
static constexpr ValueOperand R0(a3, a2);
static constexpr ValueOperand R1(s7, s6);
static constexpr ValueOperand R2(t7, t6);

Просмотреть файл

@ -14,8 +14,6 @@
namespace js {
namespace jit {
static constexpr Register BaselineStackReg = sp;
// ValueOperands R0, R1, and R2.
// R0 == JSReturnReg, and R2 uses registers not preserved across calls. R1 value
// should be preserved across calls.

Просмотреть файл

@ -14,8 +14,6 @@
namespace js {
namespace jit {
static constexpr Register BaselineStackReg{Registers::invalid_reg};
static constexpr ValueOperand R0 = JSReturnOperand;
static constexpr ValueOperand R1 = JSReturnOperand;
static constexpr ValueOperand R2 = JSReturnOperand;

Просмотреть файл

@ -23,7 +23,7 @@ inline void EmitBaselineTailCallVM(TrampolinePtr target, MacroAssembler& masm,
// We can assume during this that R0 and R1 have been pushed.
// Store frame size without VMFunction arguments for debug assertions.
masm.movq(FramePointer, scratch);
masm.subq(BaselineStackReg, scratch);
masm.subq(StackPointer, scratch);
masm.subq(Imm32(argSize), scratch);
Address frameSizeAddr(FramePointer,
BaselineFrame::reverseOffsetOfDebugFrameSize());
@ -47,12 +47,12 @@ inline void EmitBaselineEnterStubFrame(MacroAssembler& masm, Register) {
// this is:
//
// FramePointer
// - BaselineStackReg
// - StackPointer
// - sizeof(return address)
ScratchRegisterScope scratch(masm);
masm.movq(FramePointer, scratch);
masm.subq(BaselineStackReg, scratch);
masm.subq(StackPointer, scratch);
masm.subq(Imm32(sizeof(void*)), scratch); // Return address.
Address frameSizeAddr(FramePointer,
@ -64,15 +64,15 @@ inline void EmitBaselineEnterStubFrame(MacroAssembler& masm, Register) {
// if needed.
// Push the return address that's currently on top of the stack.
masm.Push(Operand(BaselineStackReg, 0));
masm.Push(Operand(StackPointer, 0));
// Replace the original return address with the frame descriptor.
masm.storePtr(ImmWord(MakeFrameDescriptor(FrameType::BaselineJS)),
Address(BaselineStackReg, sizeof(uintptr_t)));
Address(StackPointer, sizeof(uintptr_t)));
// Save old frame pointer, stack pointer and stub reg.
masm.Push(FramePointer);
masm.mov(BaselineStackReg, FramePointer);
masm.mov(StackPointer, FramePointer);
masm.Push(ICStubReg);
}

Просмотреть файл

@ -47,7 +47,7 @@ inline void EmitBaselineLeaveStubFrame(MacroAssembler& masm) {
// descriptor. Use a pop instruction to overwrite the frame descriptor
// with the return address. Note that pop increments the stack pointer
// before computing the address.
masm.Pop(Operand(BaselineStackReg, 0));
masm.Pop(Operand(StackPointer, 0));
}
template <typename AddrType>

Просмотреть файл

@ -14,8 +14,6 @@
namespace js {
namespace jit {
static constexpr Register BaselineStackReg = rsp;
static constexpr ValueOperand R0(rcx);
static constexpr ValueOperand R1(rbx);
static constexpr ValueOperand R2(rax);

Просмотреть файл

@ -21,7 +21,7 @@ inline void EmitBaselineTailCallVM(TrampolinePtr target, MacroAssembler& masm,
// We assume during this that R0 and R1 have been pushed.
// Store frame size without VMFunction arguments for debug assertions.
masm.movl(FramePointer, eax);
masm.subl(BaselineStackReg, eax);
masm.subl(StackPointer, eax);
masm.subl(Imm32(argSize), eax);
Address frameSizeAddr(FramePointer,
BaselineFrame::reverseOffsetOfDebugFrameSize());
@ -45,11 +45,11 @@ inline void EmitBaselineEnterStubFrame(MacroAssembler& masm, Register scratch) {
// this is:
//
// FramePointer
// - BaselineStackReg
// - StackPointer
// - sizeof(return address)
masm.movl(FramePointer, scratch);
masm.subl(BaselineStackReg, scratch);
masm.subl(StackPointer, scratch);
masm.subl(Imm32(sizeof(void*)), scratch); // Return address.
Address frameSizeAddr(FramePointer,
@ -61,15 +61,15 @@ inline void EmitBaselineEnterStubFrame(MacroAssembler& masm, Register scratch) {
// if needed.
// Push the return address that's currently on top of the stack.
masm.Push(Operand(BaselineStackReg, 0));
masm.Push(Operand(StackPointer, 0));
// Replace the original return address with the frame descriptor.
masm.storePtr(ImmWord(MakeFrameDescriptor(FrameType::BaselineJS)),
Address(BaselineStackReg, sizeof(uintptr_t)));
Address(StackPointer, sizeof(uintptr_t)));
// Save old frame pointer, stack pointer and stub reg.
masm.Push(FramePointer);
masm.mov(BaselineStackReg, FramePointer);
masm.mov(StackPointer, FramePointer);
masm.Push(ICStubReg);
}

Просмотреть файл

@ -47,7 +47,7 @@ inline void EmitBaselineLeaveStubFrame(MacroAssembler& masm) {
// descriptor. Use a pop instruction to overwrite the frame descriptor
// with the return address. Note that pop increments the stack pointer
// before computing the address.
masm.Pop(Operand(BaselineStackReg, 0));
masm.Pop(Operand(StackPointer, 0));
}
template <typename AddrType>

Просмотреть файл

@ -14,8 +14,6 @@
namespace js {
namespace jit {
static constexpr Register BaselineStackReg = esp;
// ValueOperands R0, R1, and R2
static constexpr ValueOperand R0(ecx, edx);
static constexpr ValueOperand R1(eax, ebx);