Skip to content

Commit 3cb341c

Browse files
committed
InPlaceInterpreter64.asm: use sp as first comparand in the loop VMTraps poll
ARM64 cannot encode sp as Rm in SUBS (only as Rn), so 'bpbeq mem, sp, label' lowers to 'subs xzr, <scratch>, sp' which the assembler rejects. Swap to the logically equivalent 'bpaeq sp, mem, label' ('subs xzr, sp, <scratch>; b.hs'), matching the existing 'bpa sp, mem' pattern used elsewhere for stack-limit checks.
1 parent 972b37c commit 3cb341c

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Source/JavaScriptCore/llint/InPlaceInterpreter64.asm

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,9 @@ ipintOp(_loop, macro()
274274
ipintLoopOSR(1)
275275
# VMTraps poll: requestStop() sets m_trapAwareSoftStackLimit = UINTPTR_MAX, so a pure
276276
# Wasm loop (no calls) observes termination/watchdog requests at each back-edge instead of
277-
# only at the next function prologue.
278-
bpbeq JSWebAssemblyInstance::m_stackMirror + StackManager::Mirror::m_trapAwareSoftStackLimit[wasmInstance], sp, .ipint_loop_no_trap
277+
# only at the next function prologue. sp as the first comparand (not second) because ARM64
278+
# cannot encode sp as Rm in SUBS.
279+
bpaeq sp, JSWebAssemblyInstance::m_stackMirror + StackManager::Mirror::m_trapAwareSoftStackLimit[wasmInstance], .ipint_loop_no_trap
279280
jmp _ipint_loop_check_vm_traps
280281
.ipint_loop_no_trap:
281282
loadb IPInt::InstructionLengthMetadata::length[MC], t0

0 commit comments

Comments
 (0)