Commit 2fc0c8b
[dart2wasm] Some refactorings of the compiler
a) Usage of `ClassInfo.*`
We have an abstraction layer that translates dart types
to wasm types - which is the `Translator` object (it
has e.g. `Translator.translateType`).
=> We remove direct use of `ClassInfo.*` in most places
=> Instead of exposing `ClassInfo` for specific types
(e.g. top type), we expose the wasm representation type
b) Type of `ClassInfo.repr`
Currently `ClassInfo.repr` is itself a `ClassInfo`, which is
rather confusing. We use `ClassInfo.repr` to determine how to
translate `InterfaceType`s of that class to the wasm type system.
=> We make `Class.repr` be an actual wasm representation type
(we make it a `w.RefType`)
c) We create a macro assembler `loadClassId` method so we have
one place where we load the class id and we verify in
assertions that the receiver type is `ref #Top`.
Change-Id: Ie24008a98131dae34948406a1f5aec881499c1f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431080
Commit-Queue: Martin Kustermann <[email protected]>
Reviewed-by: Ömer Ağacan <[email protected]>1 parent ac2fc57 commit 2fc0c8b
File tree
15 files changed
+213
-205
lines changed- pkg/dart2wasm/lib
- sdk/lib/_internal/wasm/lib
15 files changed
+213
-205
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
59 | | - | |
60 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
86 | 85 | | |
87 | 86 | | |
88 | 87 | | |
89 | 88 | | |
90 | | - | |
| 89 | + | |
91 | 90 | | |
92 | 91 | | |
93 | 92 | | |
| |||
254 | 253 | | |
255 | 254 | | |
256 | 255 | | |
257 | | - | |
| 256 | + | |
258 | 257 | | |
259 | 258 | | |
260 | 259 | | |
261 | 260 | | |
262 | 261 | | |
263 | 262 | | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
| 263 | + | |
| 264 | + | |
268 | 265 | | |
269 | 266 | | |
270 | 267 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
186 | | - | |
187 | | - | |
188 | | - | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
189 | 189 | | |
190 | | - | |
| 190 | + | |
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
| |||
478 | 478 | | |
479 | 479 | | |
480 | 480 | | |
481 | | - | |
| 481 | + | |
482 | 482 | | |
483 | 483 | | |
484 | 484 | | |
| |||
548 | 548 | | |
549 | 549 | | |
550 | 550 | | |
551 | | - | |
| 551 | + | |
552 | 552 | | |
553 | 553 | | |
554 | 554 | | |
| |||
581 | 581 | | |
582 | 582 | | |
583 | 583 | | |
584 | | - | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
585 | 591 | | |
586 | 592 | | |
587 | 593 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
356 | 356 | | |
357 | 357 | | |
358 | 358 | | |
359 | | - | |
| 359 | + | |
360 | 360 | | |
361 | 361 | | |
362 | 362 | | |
| |||
0 commit comments