Closed Bug 1815219 Opened 3 years ago Closed 3 years ago

Support callable function imports other than JSFunction

Categories

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

task

Tracking

()

RESOLVED FIXED
111 Branch
Tracking Status
firefox111 --- fixed

People

(Reporter: jandem, Assigned: jandem)

References

(Blocks 1 open bug)

Details

(Whiteboard: [sp3])

Attachments

(2 files)

According to the spec, Wasm func module imports can be any callable JS object. In SpiderMonkey we currently only support JSFunction instances and throw a LinkError for other callables such as callable proxies.

I noticed this while prototyping a different design for bound functions (bug 1812316). This matches the spec better but failed a number of Wasm tests that use bound functions.

I also confirmed Chrome and Safari support importing non-function callables (tested with a callable proxy).

With this patch we use IsCallable instead of checking for the JSFunction class.
This matches the spec but requires changing a number of places to use JSObject* instead
of JSFunction*.

We still reject cross-compartment wrappers because they have some additional
complexity.

Attachment #9316108 - Attachment description: Bug 1815219 part 1 - Support callable objects that aren't functions for Wasm imports. r?rhunt! → Bug 1815219 part 1 - Support callable objects other than JSFunction for Wasm imports. r?rhunt!
Duplicate of this bug: 1787770
No longer duplicate of this bug: 1787770
Pushed by jdemooij@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e52b71a29297 part 1 - Support callable objects other than JSFunction for Wasm imports. r=rhunt https://hg.mozilla.org/integration/autoland/rev/a0d620ed5943 part 2 - Rename JSFunctionVector to JSObjectVector. r=rhunt
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 111 Branch
Whiteboard: [sp3]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: