Commit 6fc1601
authored
threads: add
* 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.shared composite types (#1646)1 parent 3ca2d7c commit 6fc1601
File tree
53 files changed
+1281
-437
lines changed- crates
- wasm-encoder/src
- core
- wasm-smith
- src
- component
- core
- tests
- wasmparser/src
- readers/core
- types
- validator
- wasmprinter/src
- wast/src
- component
- core
- binary
- resolve
- tests
- cli
- dump
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
53 files changed
+1281
-437
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
35 | 34 | | |
36 | 35 | | |
37 | 36 | | |
38 | 37 | | |
39 | | - | |
40 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
45 | | - | |
| 47 | + | |
46 | 48 | | |
47 | 49 | | |
48 | | - | |
| 50 | + | |
49 | 51 | | |
50 | 52 | | |
51 | 53 | | |
52 | 54 | | |
53 | 55 | | |
54 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
55 | 68 | | |
56 | 69 | | |
57 | 70 | | |
| |||
635 | 648 | | |
636 | 649 | | |
637 | 650 | | |
638 | | - | |
639 | | - | |
640 | 651 | | |
641 | 652 | | |
| 653 | + | |
642 | 654 | | |
643 | 655 | | |
644 | 656 | | |
645 | 657 | | |
646 | 658 | | |
647 | 659 | | |
648 | 660 | | |
649 | | - | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
650 | 665 | | |
651 | 666 | | |
652 | 667 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1001 | 1001 | | |
1002 | 1002 | | |
1003 | 1003 | | |
1004 | | - | |
1005 | | - | |
1006 | | - | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
1007 | 1007 | | |
1008 | | - | |
1009 | | - | |
| 1008 | + | |
| 1009 | + | |
1010 | 1010 | | |
1011 | | - | |
1012 | | - | |
| 1011 | + | |
| 1012 | + | |
1013 | 1013 | | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
1014 | 1018 | | |
1015 | 1019 | | |
1016 | 1020 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
714 | 714 | | |
715 | 715 | | |
716 | 716 | | |
717 | | - | |
718 | | - | |
719 | | - | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
720 | 723 | | |
721 | 724 | | |
722 | 725 | | |
| |||
737 | 740 | | |
738 | 741 | | |
739 | 742 | | |
740 | | - | |
741 | | - | |
742 | | - | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
743 | 749 | | |
744 | 750 | | |
745 | 751 | | |
| |||
832 | 838 | | |
833 | 839 | | |
834 | 840 | | |
835 | | - | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
836 | 844 | | |
837 | 845 | | |
838 | 846 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
3 | 5 | | |
4 | 6 | | |
5 | 7 | | |
| |||
124 | 126 | | |
125 | 127 | | |
126 | 128 | | |
127 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
128 | 133 | | |
129 | 134 | | |
130 | 135 | | |
| |||
0 commit comments