Commit 0acb07c5 authored by Andreas Haas's avatar Andreas Haas Committed by Commit Bot

[wasm][liftoff] In PrepareBuiltinCall, spill slots before register moves

When stack slots are spilled after the register moves, some registers
may get overwritten, e.g. by constants.

R=clemensb@chromium.org

Change-Id: Ie94aff0fd63cd9c271b90df34895818594cee3b2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2429032Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70131}
parent e9bcaa91
......@@ -771,6 +771,7 @@ void LiftoffAssembler::PrepareBuiltinCall(
LiftoffRegList param_regs;
PrepareStackTransfers(sig, call_descriptor, params.begin(), &stack_slots,
&stack_transfers, &param_regs);
SpillAllRegisters();
// Create all the slots.
// Builtin stack parameters are pushed in reversed order.
stack_slots.Reverse();
......@@ -780,7 +781,6 @@ void LiftoffAssembler::PrepareBuiltinCall(
// Reset register use counters.
cache_state_.reset_used_registers();
SpillAllRegisters();
}
void LiftoffAssembler::PrepareCall(const FunctionSig* sig,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment