Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 929f6e81e0e0881cde4edc161df05074f32541b5
https://github.com/WebKit/WebKit/commit/929f6e81e0e0881cde4edc161df05074f32541b5
Author: Keith Miller <[email protected]>
Date: 2026-08-28 (Fri, 28 Aug 2026)
Changed paths:
A JSTests/wasm/stress/tail-call-unused-pins.js
M Source/JavaScriptCore/wasm/WasmOMGIRGenerator.cpp
Log Message:
-----------
[Wasm] Exclude wasmBoundsCheckingSizeRegister from the callee saves restored
https://bugs.webkit.org/show_bug.cgi?id=317654
rdar://177693309
Reviewed by Yijia Huang.
GPRInfo::wasmBoundsCheckingSizeRegister (callee save) is only pinned in B3 when
the OMG callee is compiled for MemoryMode::BoundsChecking. In Signaling mode
it stays in B3/Air's mutable register set, and createTailCallPatchpoint
declares the full callee-save set as clobberEarly so that B3 does not place
an input there before the tail-call's parallel move runs. That clobberEarly
causes AirHandleCalleeSaves to include regCS4 in the function's
calleeSaveRegisterAtOffsetList(). The OMG prologue saves
wasmBoundsCheckingSizeRegister to the callee save list and when making a
tail call that callee save is restored after the callee's memory bounds
are set.
The wasm ABI already treats the pinned registers as effectively caller-save
across wasm-to-wasm calls. Tail calls do not restore them either. Restoring
wasmBoundsCheckingSizeRegister to the prologue-saved caller value in
prepareForTailCallImpl is therefore unnecessary.
This patch teaches emitRestoreCalleeSavesFor to take a dontRestoreRegisters
set and uses it from prepareForTailCallImpl to skip
wasmBoundsCheckingSizeRegister. I also added a FIXME at the pinRegister
site noting that wasmBoundsCheckingSizeRegister is effectively caller-save
in the wasm ABI.
Originally-landed-as: [email protected] (654718255548).
rdar://185368944
Canonical link: https://commits.webkit.org/320061@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications