Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge with upstream/wasm-3.0+exn #32

Merged
merged 56 commits into from
Apr 29, 2024
Merged

Merge with upstream/wasm-3.0+exn #32

merged 56 commits into from
Apr 29, 2024

Conversation

dhil
Copy link
Member

@dhil dhil commented Apr 29, 2024

This patch merges in the latest changes from WebAssembly/spec branch wasm-3.0+exn.

takikawa and others added 30 commits February 14, 2024 15:56
DefaultValue will return undefined for externref as before, but
for other nullable reference types will return null.

For non-nullable reference types, operations like grow and set
should error if the value to set is missing.

Also adds WPT tests for the error cases. This requires some
updates to wasm-module-builder.js as well.

Fixes issue WebAssembly#501
Instead of allowing ToWebAssemblyValue to throw a TypeError, explicitly catch
any exceptions and throw a WebAssembly.LinkError.
Instead of allowing ToWebAssemblyValue to throw a TypeError, explicitly catch
any exceptions and throw a WebAssembly.LinkError.
[js-api][test] Refine DefaultValue for new reference types
[js-api] Throw consistent exns in "read the imports"
Test that validation allows `call_indirect` to have a type immediate that is a
supertype of or unrelated to the table element type and that the runtime
behavior is correct in these cases.
The first operand for `ref.cast` should be a reference type.
However, the code example in `MVP.md` seems to have a heaptype
which is invalid.
(Assuming the `$C` is defined as follows based on the context)

```
(module
  (type $A (sub (struct)))
  (type $B (sub $A (struct (field i32))))
  (type $C (sub $B (struct (field i32 i32))))
  (func $castBtoC (param $x (ref $B)) (result (ref $C))
    (ref.cast $C (local.get $x))
  )
)
```

```
$ wasm -d test.wat
test.wat:6.15-6.17: syntax error: unexpected token
```

(Where `wasm` is a reference interpreter built from
WebAssembly/gc@0ba84fb)
Fix an example code for ref.cast in MVP.md
[test] Test `call_indirect` subtyping more thoroughly
It produces a non-null `(ref i31)` not an `i31ref` aka `(ref null i31)`.
Fix typing of `ref.i31` in the appendix
I noticed that Wasmtime was passing the spec tests despite having bits that were
known to be unimplemented. This should help the tests exercise those corners of
the spec.

Notably:

* Setting `i31ref` globals.

* Initializing tables and globals with `(ref.i31 (global.get $g))`.

* Table operations on `i31ref` tables.

* Accessing `anyref` globals and tables that are actually `i31ref`s. This is
  interesting to exercise outside of general subtyping because we have different
  paths in our inline GC barriers for `anyref`s that are actually `i31ref`s.
The prose incorrectly used "larger than or equal to" when it should have used
just "larger than." The formalism was already correct.

Fixes WebAssembly#536.
…py-bounds

[Spec] Fix bounds check prose for array.fill and array.copy
rossberg and others added 26 commits April 21, 2024 10:01
Co-authored-by: Manos Koukoutos <[email protected]>
More fixes and tests around element segments
Copy-paste bug. Don't repeatedly assert the first element's value, but each element in the table.
@dhil dhil merged commit 0c0fed4 into wasmfx:main Apr 29, 2024
6 checks passed
@dhil dhil deleted the wasmfx-merge branch April 29, 2024 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants