Bug 239668 - [Wasm-GC] Add support for subtyping declarations
Summary: [Wasm-GC] Add support for subtyping declarations
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
Depends on:
Blocks: 247394
  Show dependency treegraph
 
Reported: 2022-04-22 12:31 PDT by Asumu Takikawa
Modified: 2022-11-03 04:41 PDT (History)
4 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 2022-04-22 12:31:55 PDT
As mentioned in https://bugs.webkit.org/show_bug.cgi?id=239666, full support of the Wasm GC proposal requires type system support for both recursion groups and subtyping declarations.

In the latest GC proposal design, subtyping (e.g., for struct types) is declared explicitly with a `sub` operator:

Example:


```
(module
  (type $s1 (struct))
  (type $s2 (sub $s1 (field i32)))
)
```

The binary format allows for multiple supertypes, but the MVP design will restrict it to one supertype.

A reference type with an index to a type definition that has supertypes will be compatible with a reference type to its supertype index.

Only array and struct types will support subtyping at first, so it likely makes sense to implement this after struct operations and recursive types land.
Comment 1 Asumu Takikawa 2022-04-22 12:32:54 PDT
There was a mistake in the example, it should have a `struct` operator in there:

```
(module
  (type $s1 (struct))
  (type $s2 (sub $s1 (struct (field i32))))
)
```
Comment 2 Radar WebKit Bug Importer 2022-04-29 12:32:12 PDT
<rdar://problem/92538296>
Comment 3 Asumu Takikawa 2022-10-25 16:14:44 PDT
Pull request: https://github.com/WebKit/WebKit/pull/5786
Comment 4 EWS 2022-11-02 14:23:53 PDT
Committed 256243@main (431164ca6a4b): <https://commits.webkit.org/256243@main>

Reviewed commits have been landed. Closing PR #5786 and removing active labels.
Comment 5 bashorov 2022-11-02 16:14:22 PDT
I'm wondering if there is an umbrella issue to track progress about GC proposal support?

Also, could you please suggest how I may try current state in the Safari(I guess in Technology Preview)? Specifically how I cen turn on relevant options in Safari?
Comment 6 Asumu Takikawa 2022-11-02 17:20:05 PDT
(In reply to bashorov from comment #5)
> I'm wondering if there is an umbrella issue to track progress about GC
> proposal support?
> 
> Also, could you please suggest how I may try current state in the Safari(I
> guess in Technology Preview)? Specifically how I cen turn on relevant
> options in Safari?

I just created an umbrella bug for GC here: https://bugs.webkit.org/show_bug.cgi?id=247394

There is still a bunch of work needed to run non-trivial Wasm GC programs, but a subset of the spec tests will pass.

There is a `--useWebAssemblyGC` flag for JSC that you can toggle if you build JSC standalone. Not sure it is exposed via WebKit and visible in the Safari UI though.
Comment 7 bashorov 2022-11-03 04:41:44 PDT
> I just created an umbrella bug for GC

Cool, thanks!

> Not sure it is exposed via WebKit and visible in the Safari UI though.

Where/who is right place/person to ask about it?