Bug 240982
Summary: | [Wasm-GC] Change externref to anyref | ||
---|---|---|---|
Product: | WebKit | Reporter: | Asumu Takikawa <asumu> |
Component: | WebAssembly | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED DUPLICATE | ||
Severity: | Normal | CC: | bashorov, d_degazio, webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | WebKit Nightly Build | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Bug Depends on: | |||
Bug Blocks: | 247394 |
Asumu Takikawa
The Wasm GC proposal unifies the externref type and anyref type (https://github.com/WebAssembly/gc/pull/271).
Right now, externref allows host values and has no subtyping relationship with other types. With the change to anyref, an anyref will allow host types, but it will also be allowed to be downcast to more specific reference types once casting operations are added. An anyref type parameter, e.g. for a function, will accept other reference types in the hierarchy as well.
(It is possible funcrefs will be excluded from the anyref hierarchy https://github.com/WebAssembly/gc/issues/293)
When Wasm GC is disabled, externref should still function as it does right now.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/94312718>
Asumu Takikawa
There is still a lot of discussion about what the role of `anyref`, `externref`, etc should be in the GC proposal: https://github.com/WebAssembly/gc/issues/307
I think until this is clear, it's best to avoid implementing `anyref` (it's unclear if a "top type" is even going to be in the final type hierarchy). It might make sense to instead implement types like `dataref` (structs & arrays) and `eqref` (dataref + i31ref) initially.
Asumu Takikawa
Recent discussions (in issue https://github.com/WebAssembly/gc/issues/307) and subsequent changes to the spec (https://github.com/WebAssembly/gc/pull/310) have actually undone the unification of externref and anyref types in the GC proposal.
So this issue can be closed unless the design changes again. Instead, for the GC proposal we will need to add an anyref as a new supertype of all GC datatypes.
David Degazio
Revisiting from the future, anyref and externref remain separate types, with anyref as the overall top type and externref being one of its subtypes. Support for anyref was added in https://bugs.webkit.org/show_bug.cgi?id=247403 and is consistent with the current state of the spec as far as I am aware. Closing as dupe.
*** This bug has been marked as a duplicate of bug 247403 ***
David Degazio
Er, quick correction, anyref is not the supertype of externref, there is a conversion between the two - implemented in https://bugs.webkit.org/show_bug.cgi?id=251039. We can still close this bug.