Bug 254693 - [Wasm-GC] Implement casts at Wasm-JS function call boundaries
Summary: [Wasm-GC] Implement casts at Wasm-JS function call boundaries
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebAssembly (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
: 263467 (view as bug list)
Depends on:
Blocks: 247394
  Show dependency treegraph
 
Reported: 2023-03-29 14:42 PDT by Asumu Takikawa
Modified: 2024-07-24 13:39 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Asumu Takikawa 2023-03-29 14:42:21 PDT
When calling into Wasm from JS, `ToWebAssemblyValue` needs to be called on JS values to convert them to Wasm values. For GC types, this is currently not implemented.

In general, it's necessary to add a `extern.internalize` and `ref.cast` to the target Wasm type on such a call.

In the other direction, `ToJSValue` is typically a no-op for Wasm GC values, but it still needs to be enabled.

The machinery to do these casts is already in JSC, but it needs to be hooked up to code in JSToWasm.cpp and WasmToJS.cpp to do the right thing.
Comment 1 Radar WebKit Bug Importer 2023-04-05 14:43:15 PDT
<rdar://problem/107679474>
Comment 2 Asumu Takikawa 2023-10-25 10:29:26 PDT
Pull request: https://github.com/WebKit/WebKit/pull/19550
Comment 3 EWS 2023-11-09 10:31:52 PST
Committed 270460@main (5aa61e8c766a): <https://commits.webkit.org/270460@main>

Reviewed commits have been landed. Closing PR #19550 and removing active labels.
Comment 4 David Degazio 2024-07-24 13:39:37 PDT
*** Bug 263467 has been marked as a duplicate of this bug. ***