[webkit-changes] [WebKit/WebKit] 3eb123: [JSC] Disable wasm tail-call because of several ne...
Yusuke Suzuki
noreply at github.com
Thu Feb 2 22:12:10 PST 2023
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 3eb123c1f36f03ab8b1f521de8f01aaf541854c8
https://github.com/WebKit/WebKit/commit/3eb123c1f36f03ab8b1f521de8f01aaf541854c8
Author: Yusuke Suzuki <ysuzuki at apple.com>
Date: 2023-02-02 (Thu, 02 Feb 2023)
Changed paths:
M JSTests/wasm/stress/tail-call-should-not-clobber-caller-origin.js
M JSTests/wasm/v8/indirect-call-non-zero-table.js
M Source/JavaScriptCore/runtime/OptionsList.h
Log Message:
-----------
[JSC] Disable wasm tail-call because of several necessary things
https://bugs.webkit.org/show_bug.cgi?id=251656
rdar://104987053
Reviewed by Mark Lam.
This change disables wasm tail-calls since we still need several things to make it work correctly.
1. All wasm function calls need to adjust stack-pointer after the call. This is necessary thing for the support of tail-call,
but currently it is not done yet. Since tail-call can adjust the stack-pointer of the caller, the stack-pointer value can become
different after the tail-call happens from the caller's view. Since B3 etc. are freely accessing to stack slots via stack-pointer,
and since stack-pointer needs to be the same during the procedure, the adjustment is required to make things work.
In JS world, we are doing this adjustment: BaselineJIT's resetSP for example. Previously, since wasm does not have tail-calls,
wasm call is not doing this adjustment. Now, we should do that.
2. We should not change offset of StackSlots. This is not a supported operation by B3 / Air.
For now, we disable wasm tail-call.
* Source/JavaScriptCore/runtime/OptionsList.h:
Canonical link: https://commits.webkit.org/259801@main
More information about the webkit-changes
mailing list