Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d55c91ba94f57f368297ae8891b12300dc4f2c03
      
https://github.com/WebKit/WebKit/commit/d55c91ba94f57f368297ae8891b12300dc4f2c03
  Author: Yusuke Suzuki <[email protected]>
  Date:   2025-06-05 (Thu, 05 Jun 2025)

  Changed paths:
    A 
JSTests/wasm/stress/jitless-wasm-to-js-should-follow-to-wasm-call-frame-convention-2.js
    A 
JSTests/wasm/stress/jitless-wasm-to-js-should-follow-to-wasm-call-frame-convention.js
    M Source/JavaScriptCore/llint/WebAssembly.asm
    M Source/JavaScriptCore/wasm/WasmCallingConvention.h
    M Source/JavaScriptCore/wasm/WasmOperations.cpp

  Log Message:
  -----------
  [JSC] JITLess WasmToJS needs to construct CallFrame appropriately
https://bugs.webkit.org/show_bug.cgi?id=290033
<rdar://146100752>

Reviewed by Mark Lam.

CallFrame with WasmCallee needs to store

1. JSWebAssemblyInstance* in CodeBlock[cfr]
2. Boxed WasmCallee* in Callee[cfr]

we already have a code storing them in operationWasmToJSExitMarshalArguments.
But the code is executed at the end of function, so when an error is
thrown before that place, we may throw an error with inappropriately
constructed CallFrame, thus unwinding will fail.
This patch moves these setup in the prologue of 
operationWasmToJSExitMarshalArguments
so that we ensure that they are already stored when unwinding happens.
We also clean up stack size calculation code by avoiding directly used constants
in the different places. And we remove unnecessary code in
WebAssembly.asm.

* 
JSTests/wasm/stress/jitless-wasm-to-js-should-follow-to-wasm-call-frame-convention-2.js:
 Added.
(instantiate):
(async let):
* 
JSTests/wasm/stress/jitless-wasm-to-js-should-follow-to-wasm-call-frame-convention.js:
 Added.
(instantiate):
(async let.fn0):
(let.fn1):
(let.fn2):
(let.fn3):
(let.fn4):
(let.fn5):
(let.fn6):
(let.fn7):
(async let):
* Source/JavaScriptCore/llint/WebAssembly.asm:
* Source/JavaScriptCore/wasm/WasmCallingConvention.h:
* Source/JavaScriptCore/wasm/WasmOperations.cpp:
(JSC::Wasm::JSC_DEFINE_JIT_OPERATION):

Originally-landed-as: 289651.297@safari-7621-branch (88afd93c3a5e). 
rdar://151710096
Canonical link: https://commits.webkit.org/295864@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to