diff --git a/src/wasm/baseline/arm/liftoff-assembler-arm.h b/src/wasm/baseline/arm/liftoff-assembler-arm.h index 74438b7a35..324b4860c8 100644 --- a/src/wasm/baseline/arm/liftoff-assembler-arm.h +++ b/src/wasm/baseline/arm/liftoff-assembler-arm.h @@ -1550,7 +1550,8 @@ void LiftoffAssembler::FillStackSlotsWithZero(int start, int size) { pop(r0); } -void LiftoffAssembler::LoadSpillAddress(Register dst, int offset) { +void LiftoffAssembler::LoadSpillAddress(Register dst, int offset, + ValueKind /* kind */) { sub(dst, fp, Operand(offset)); } diff --git a/src/wasm/baseline/arm64/liftoff-assembler-arm64.h b/src/wasm/baseline/arm64/liftoff-assembler-arm64.h index 403dd61687..b2b3c3ff00 100644 --- a/src/wasm/baseline/arm64/liftoff-assembler-arm64.h +++ b/src/wasm/baseline/arm64/liftoff-assembler-arm64.h @@ -1033,7 +1033,8 @@ void LiftoffAssembler::FillStackSlotsWithZero(int start, int size) { } } -void LiftoffAssembler::LoadSpillAddress(Register dst, int offset) { +void LiftoffAssembler::LoadSpillAddress(Register dst, int offset, + ValueKind /* kind */) { Sub(dst, fp, offset); } diff --git a/src/wasm/baseline/ia32/liftoff-assembler-ia32.h b/src/wasm/baseline/ia32/liftoff-assembler-ia32.h index 6c5e3a0788..fad96ab52e 100644 --- a/src/wasm/baseline/ia32/liftoff-assembler-ia32.h +++ b/src/wasm/baseline/ia32/liftoff-assembler-ia32.h @@ -1286,7 +1286,8 @@ void LiftoffAssembler::FillStackSlotsWithZero(int start, int size) { } } -void LiftoffAssembler::LoadSpillAddress(Register dst, int offset) { +void LiftoffAssembler::LoadSpillAddress(Register dst, int offset, + ValueKind /* kind */) { lea(dst, liftoff::GetStackSlot(offset)); } diff --git a/src/wasm/baseline/liftoff-assembler.h b/src/wasm/baseline/liftoff-assembler.h index 91e957c31a..189509e724 100644 --- a/src/wasm/baseline/liftoff-assembler.h +++ b/src/wasm/baseline/liftoff-assembler.h @@ -658,7 +658,7 @@ class LiftoffAssembler : public TurboAssembler { void Spill(VarState* slot); void SpillLocals(); void SpillAllRegisters(); - inline void LoadSpillAddress(Register dst, int offset); + inline void LoadSpillAddress(Register dst, int offset, ValueKind kind); // Clear any uses of {reg} in both the cache and in {possible_uses}. // Any use in the stack is spilled. If any register in {possible_uses} matches diff --git a/src/wasm/baseline/liftoff-compiler.cc b/src/wasm/baseline/liftoff-compiler.cc index f3748f7dd6..deacfaf943 100644 --- a/src/wasm/baseline/liftoff-compiler.cc +++ b/src/wasm/baseline/liftoff-compiler.cc @@ -2360,7 +2360,7 @@ class LiftoffCompiler { __ Spill(&return_slot); } DCHECK(return_slot.is_stack()); - __ LoadSpillAddress(param_reg, return_slot.offset()); + __ LoadSpillAddress(param_reg, return_slot.offset(), return_slot.kind()); } source_position_table_builder_.AddPosition( diff --git a/src/wasm/baseline/ppc/liftoff-assembler-ppc.h b/src/wasm/baseline/ppc/liftoff-assembler-ppc.h index 7b8b5837fd..25d1411cd3 100644 --- a/src/wasm/baseline/ppc/liftoff-assembler-ppc.h +++ b/src/wasm/baseline/ppc/liftoff-assembler-ppc.h @@ -1093,7 +1093,9 @@ void LiftoffAssembler::FillStackSlotsWithZero(int start, int size) { } } -void LiftoffAssembler::LoadSpillAddress(Register dst, int offset) { +void LiftoffAssembler::LoadSpillAddress(Register dst, int offset, + ValueKind kind) { + if (kind == kI32) offset = offset + stack_bias; SubS64(dst, fp, Operand(offset)); } diff --git a/src/wasm/baseline/riscv/liftoff-assembler-riscv.h b/src/wasm/baseline/riscv/liftoff-assembler-riscv.h index fb2dcf62cc..e5838031ab 100644 --- a/src/wasm/baseline/riscv/liftoff-assembler-riscv.h +++ b/src/wasm/baseline/riscv/liftoff-assembler-riscv.h @@ -157,7 +157,8 @@ void LiftoffAssembler::PatchPrepareStackFrame( GenPCRelativeJump(kScratchReg, imm32); } -void LiftoffAssembler::LoadSpillAddress(Register dst, int offset) { +void LiftoffAssembler::LoadSpillAddress(Register dst, int offset, + ValueKind /* kind */) { SubWord(dst, fp, offset); } diff --git a/src/wasm/baseline/s390/liftoff-assembler-s390.h b/src/wasm/baseline/s390/liftoff-assembler-s390.h index 0476818b2f..8a45f09bf6 100644 --- a/src/wasm/baseline/s390/liftoff-assembler-s390.h +++ b/src/wasm/baseline/s390/liftoff-assembler-s390.h @@ -1552,7 +1552,9 @@ void LiftoffAssembler::FillStackSlotsWithZero(int start, int size) { pop(r0); } -void LiftoffAssembler::LoadSpillAddress(Register dst, int offset) { +void LiftoffAssembler::LoadSpillAddress(Register dst, int offset, + ValueKind kind) { + if (kind == kI32) offset = offset + stack_bias; SubS64(dst, fp, Operand(offset)); } diff --git a/src/wasm/baseline/x64/liftoff-assembler-x64.h b/src/wasm/baseline/x64/liftoff-assembler-x64.h index fe3e897c6b..3d3c16b187 100644 --- a/src/wasm/baseline/x64/liftoff-assembler-x64.h +++ b/src/wasm/baseline/x64/liftoff-assembler-x64.h @@ -1018,7 +1018,8 @@ void LiftoffAssembler::FillStackSlotsWithZero(int start, int size) { } } -void LiftoffAssembler::LoadSpillAddress(Register dst, int offset) { +void LiftoffAssembler::LoadSpillAddress(Register dst, int offset, + ValueKind /* kind */) { leaq(dst, liftoff::GetStackSlot(offset)); }