-
Notifications
You must be signed in to change notification settings - Fork 245
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
threads: add
shared
composite types (#1646)
* threads: add `shared` composite types This continues the work of #1600 to expand the surface area of a WebAssembly module that can be marked `shared`. This is for support of the shared-everything-threads [proposal]. The key change is to convert `CompositeType` in each of the crates from an `enum` to a `struct` in order to add a `shared` boolean field. The original variants (`Func`, `Array`, `Struct`) are moved to a separate `enum` and fill an `inner` field. Propagating this throughout the code base is the bulk of this PR, with occasional, small refactors to avoid larger match patterns. [proposal]: https://github.com/WebAssembly/shared-everything-threads * Add `wast` parsing of shared composite types This finishes the work of the previous commit, allowing us to express shared composite types in the text format: `(type $t (shared (...)))`. This also finishes up the heap type testing by allowing the tests to express concrete heap types (e.g., `ref $t`). * Fix some un-formatted files * Add shared check to rec groups For now, this explicitly checks that both subtypes are shared. But it isn't yet clear whether an shared type might be able to match an unshared one. Once that is resolved, this might need to be updated. * Add @tlively `struct` and `array` tests These proposed spec tests are slightly modified from @tlively's originals: - they use this crate's choice of error message - they avoid the shorthand form of a single-field struct, ~(struct <type>)` because this crate does not yet know how to parse that - they avoid the shorthand form for `(elem)` for the same reason All of these minor issues can be resolved later.
- Loading branch information
Showing
53 changed files
with
1,281 additions
and
437 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.