Closed Bug 1812132 Opened 3 years ago Closed 3 years ago

Support structref and other heap types in ToWebAssembly value

Categories

(Core :: JavaScript: WebAssembly, defect, P2)

defect

Tracking

()

RESOLVED FIXED
112 Branch
Tracking Status
firefox112 --- fixed

People

(Reporter: bashorov, Assigned: rhunt)

References

(Blocks 2 open bugs)

Details

Attachments

(3 files)

Attached file kotlin-wasm.zip

Checked in the recent nightly build of Firefox 111.0a1 (2023-01-24).
It works fine in Chrom Canary.

Steps to reproduce:
Open index.html from the attachment

Actual results:
TypeError: cannot pass v128 to or from JS

Expected results:
No errors

Blocks: wasm-gc
Attached file dbmonster.zip

Another axample

The severity field is not set for this bug.
:rhunt, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(rhunt)
Severity: -- → S3
Flags: needinfo?(rhunt)
Priority: -- → P2

It looks like this example uses imports with structref in it. We don't support that in ToWasmValue/ToJSValue yet.

Assignee: nobody → rhunt
Summary: TypeError: cannot pass v128 to or from JS → Support structref and other heap types in ToWebAssembly value

The minimal JS-API spec for the GC proposal allows these types to be used on the
JS-Wasm boundary. So far we have not supported this. This commit updates these
methods so that the types work. This commit does not add support to our JIT
fast paths for exit/entry, so any use of these types will be stuck in the
interpreter entry/exit.

The attached patch fixes the error and gets the DOMMonster benchmark running in baseline. For Ion, we have a codegen issue that is causing a crash.

Status: UNCONFIRMED → NEW
Ever confirmed: true
Pushed by rhunt@eqrion.net: https://hg.mozilla.org/integration/autoland/rev/4bedc72a2b77 wasm: Allow anyref, structref, arrayref, and (ref T) in ToWasmValue/ToJSValue. r=jseward
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 112 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: