Bug 181440 - WebAssembly exported host functions should be reused if present in imports
Summary: WebAssembly exported host functions should be reused if present in imports
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebAssembly (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-09 10:01 PST by Daniel Ehrenberg
Modified: 2018-01-09 23:19 PST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Ehrenberg 2018-01-09 10:01:04 PST
According to the WebAssembly JS API specification, if a WebAssembly function is imported and then exported again, the same function object should be exported. This property doesn't seem to hold when I run the test [1] against JSC for host functions--although the function is supposed to be wrapped as a WebAssembly function once, if it is then imported and exported a second time, the same function value should result.

[1] https://github.com/WebAssembly/spec/pull/644
Comment 1 JF Bastien 2018-01-09 14:11:28 PST
This is the same as discussed here:
  https://github.com/WebAssembly/design/issues/920
?

So it's a spec change?
Comment 2 Daniel Ehrenberg 2018-01-09 23:19:44 PST
No, there's no spec change here. This link is just provided to show the tests; the spec is not changing with respect to this property. See the logic in [1] and [2]. SpiderMonkey passes these tests.

[1] https://github.com/WebAssembly/design/blob/master/JS.md#webassemblyinstance-constructor in the logic with the `funcs` list.
[2] https://webassembly.github.io/spec/js-api/index.html#a-new-exported-function step 2