Commit 76d56d7
[dart2wasm] Refactor the way we handle elements segments
Until now the element segments were hidden from the core IR & Builder
classes. This has a few issues as outlined here:
* It required `ir.DefinedTable` and `ir.ImportedTable` to have entries
=> Having element segments as core concept means they can refer
to a `ir.Table` (irrespective of wether it's a `ir.DefinedTable` or
`ir.ImportedTable`)
* It assumed that table entries have to be functions
=> We can have tables of other reference types as well
* If we ever wanted to use the `table.init` instruction then we'd be
having an issue as that instruction refers to an element segment
(which didn't exist in our IR)
=> Now we represent `ir.ElementSegment` as a concept which a
`ir.TableInit` instruction could reference.
* The encoding of function tables was so far either using the
`vec[ref.func]` form if the table index was 0 or it
would use `vec[expr]`.
=> The active segment encoding with/without table index is somewhat
orthogonal to whether to use ref.func/expression.
=> If we encode a function table with index != 0 now we can still
use `vec[ref.func]` (which is smaller encoding)
=> If we encode non-functions in a table we can now use `vec[expr]`
encoding.
* Makes IR, serializer & deserializer cleaner.
=> removes `ir.Functions.withoutDeclared`
=> removes deserializing functions with side-effects
Change-Id: I75544ab3b1f0c721f0585a2c187a81415e978fe3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/459440
Commit-Queue: Martin Kustermann <[email protected]>
Reviewed-by: Ömer Ağacan <[email protected]>1 parent 59c8081 commit 76d56d7
File tree
23 files changed
+526
-316
lines changed- pkg
- dart2wasm
- lib
- test/ir_tests
- wasm_builder/lib/src
- builder
- ir
- serialize
23 files changed
+526
-316
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
852 | 852 | | |
853 | 853 | | |
854 | 854 | | |
855 | | - | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
856 | 858 | | |
857 | 859 | | |
858 | 860 | | |
859 | | - | |
860 | | - | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
861 | 866 | | |
862 | 867 | | |
863 | 868 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
677 | 677 | | |
678 | 678 | | |
679 | 679 | | |
680 | | - | |
| 680 | + | |
| 681 | + | |
681 | 682 | | |
682 | 683 | | |
683 | 684 | | |
684 | 685 | | |
685 | 686 | | |
686 | 687 | | |
687 | 688 | | |
688 | | - | |
| 689 | + | |
689 | 690 | | |
690 | 691 | | |
691 | 692 | | |
| |||
1067 | 1068 | | |
1068 | 1069 | | |
1069 | 1070 | | |
1070 | | - | |
| 1071 | + | |
1071 | 1072 | | |
1072 | 1073 | | |
1073 | 1074 | | |
| |||
1101 | 1102 | | |
1102 | 1103 | | |
1103 | 1104 | | |
1104 | | - | |
| 1105 | + | |
1105 | 1106 | | |
1106 | 1107 | | |
1107 | 1108 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
78 | 80 | | |
79 | 81 | | |
80 | | - | |
81 | | - | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
82 | 86 | | |
83 | 87 | | |
84 | 88 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | 18 | | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
| 17 | + | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
| 17 | + | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
28 | | - | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
0 commit comments