Commit 5f4ad17
committed
Add support for async ABI, futures, streams, and errors
This adds support for encoding and parsing components which use the [Async
ABI](https://github.com/WebAssembly/component-model/blob/main/design/mvp/Async.md)
and associated canonical options and functions, along with the [`stream`,
`future`, and `error`](WebAssembly/component-model#405)
types.
Note that the `error` type was recently (about 30 minutes ago) renamed to
`error-context` in Luke's spec PR. I haven't updated this implementation to
reflect that yet, but will do so in a follow-up commit. That should allow us to
avoid conflicts with existing WIT files that use `error` as a type and/or
interface name.
This does not include any new tests; I'll also add those in a follow-up commit.
See bytecodealliance/rfcs#38 for more context.
Signed-off-by: Joel Dice <[email protected]>
add wasmparser::WasmFeatures support to wasm-compose
Signed-off-by: Joel Dice <[email protected]>
fix no-std build in readers.rs
Signed-off-by: Joel Dice <[email protected]>
rename `error` to `error-context` per latest spec
Signed-off-by: Joel Dice <[email protected]>
rename `error` to `error-context` per latest spec (part 2)
Also, parse string encoding and realloc from encoded `error-context.new` and
`error-context.debug-string` names.
Signed-off-by: Joel Dice <[email protected]>
add `wast` support for parsing async canon opts
And add tests/local/component-model-async/lift-async.wast for round-trip testing
of async lifts (more to come).
Signed-off-by: Joel Dice <[email protected]>
more wast async support and more tests
This also fixes a bug in `wasmprinter` keeping track of core functions.
Signed-off-by: Joel Dice <[email protected]>
more wast async support; add async tests; fix bugs
Signed-off-by: Joel Dice <[email protected]>
more component-model-async tests and fixes
Signed-off-by: Joel Dice <[email protected]>
add `wit-parser` tests for streams, futures, and error-contexts
Signed-off-by: Joel Dice <[email protected]>
add first `wit-component` async test
This required adding a new `wit_parser::decoding::decode_reader_with_features`
function for passing `WasmFeatures` to
`wasmparser::Validator::new_with_features`.
Signed-off-by: Joel Dice <[email protected]>
add more async tests
Signed-off-by: Joel Dice <[email protected]>
add `async-builtins` test for `wit-component`
Signed-off-by: Joel Dice <[email protected]>
add `async-streams-and-futures` test to `wit-component`
Signed-off-by: Joel Dice <[email protected]>1 parent 8f17e78 commit 5f4ad17
File tree
116 files changed
+8946
-351
lines changed- crates
- wasm-compose
- src
- tests
- wasm-encoder/src
- component
- reencode
- wasmparser/src
- readers/component
- validator
- wasmprinter/src
- wast/src
- component
- wit-component
- src
- encoding
- tests
- components
- async-builtins
- async-export-with-callback
- async-export
- async-import
- async-streams-and-futures
- interfaces/wasi-http
- wit-encoder/src
- wit-parser
- src
- ast
- resolve
- tests/ui
- src/bin/wasm-tools
- tests
- cli
- local
- component-model-async
- missing-features/component-model
- snapshots/local
- component-model-async
- error-context.wast
- futures.wast
- lift.wast
- lower.wast
- streams.wast
- task-builtins.wast
- missing-features/component-model
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
116 files changed
+8946
-351
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
| 75 | + | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
78 | 82 | | |
79 | 83 | | |
80 | 84 | | |
| |||
87 | 91 | | |
88 | 92 | | |
89 | 93 | | |
90 | | - | |
| 94 | + | |
91 | 95 | | |
92 | 96 | | |
93 | 97 | | |
| |||
105 | 109 | | |
106 | 110 | | |
107 | 111 | | |
108 | | - | |
| 112 | + | |
109 | 113 | | |
110 | 114 | | |
111 | 115 | | |
112 | 116 | | |
113 | | - | |
| 117 | + | |
114 | 118 | | |
115 | 119 | | |
116 | 120 | | |
117 | 121 | | |
118 | 122 | | |
119 | 123 | | |
120 | | - | |
| 124 | + | |
121 | 125 | | |
122 | 126 | | |
123 | 127 | | |
| |||
127 | 131 | | |
128 | 132 | | |
129 | 133 | | |
| 134 | + | |
130 | 135 | | |
131 | 136 | | |
132 | 137 | | |
133 | 138 | | |
134 | 139 | | |
135 | 140 | | |
136 | | - | |
| 141 | + | |
137 | 142 | | |
138 | 143 | | |
139 | 144 | | |
| |||
144 | 149 | | |
145 | 150 | | |
146 | 151 | | |
147 | | - | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
148 | 157 | | |
149 | 158 | | |
150 | 159 | | |
| |||
154 | 163 | | |
155 | 164 | | |
156 | 165 | | |
157 | | - | |
| 166 | + | |
158 | 167 | | |
159 | 168 | | |
160 | 169 | | |
| |||
165 | 174 | | |
166 | 175 | | |
167 | 176 | | |
168 | | - | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
169 | 183 | | |
170 | 184 | | |
171 | 185 | | |
172 | 186 | | |
173 | | - | |
| 187 | + | |
174 | 188 | | |
175 | 189 | | |
176 | 190 | | |
| |||
301 | 315 | | |
302 | 316 | | |
303 | 317 | | |
304 | | - | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
305 | 323 | | |
306 | 324 | | |
307 | 325 | | |
308 | 326 | | |
309 | 327 | | |
310 | 328 | | |
| 329 | + | |
311 | 330 | | |
312 | 331 | | |
313 | 332 | | |
| |||
348 | 367 | | |
349 | 368 | | |
350 | 369 | | |
| 370 | + | |
351 | 371 | | |
352 | 372 | | |
353 | 373 | | |
| |||
356 | 376 | | |
357 | 377 | | |
358 | 378 | | |
359 | | - | |
| 379 | + | |
360 | 380 | | |
361 | 381 | | |
362 | 382 | | |
| |||
478 | 498 | | |
479 | 499 | | |
480 | 500 | | |
481 | | - | |
| 501 | + | |
482 | 502 | | |
483 | 503 | | |
484 | 504 | | |
485 | 505 | | |
486 | | - | |
| 506 | + | |
487 | 507 | | |
488 | 508 | | |
489 | 509 | | |
| |||
492 | 512 | | |
493 | 513 | | |
494 | 514 | | |
495 | | - | |
| 515 | + | |
496 | 516 | | |
497 | 517 | | |
498 | 518 | | |
499 | 519 | | |
500 | | - | |
501 | | - | |
502 | 520 | | |
503 | 521 | | |
504 | 522 | | |
| |||
513 | 531 | | |
514 | 532 | | |
515 | 533 | | |
| 534 | + | |
516 | 535 | | |
517 | 536 | | |
518 | 537 | | |
| |||
521 | 540 | | |
522 | 541 | | |
523 | 542 | | |
524 | | - | |
525 | | - | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
526 | 549 | | |
527 | 550 | | |
528 | 551 | | |
| |||
531 | 554 | | |
532 | 555 | | |
533 | 556 | | |
534 | | - | |
| 557 | + | |
| 558 | + | |
535 | 559 | | |
536 | 560 | | |
537 | 561 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
596 | 596 | | |
597 | 597 | | |
598 | 598 | | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
599 | 610 | | |
600 | 611 | | |
601 | 612 | | |
| |||
608 | 619 | | |
609 | 620 | | |
610 | 621 | | |
611 | | - | |
612 | | - | |
613 | | - | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
614 | 631 | | |
615 | | - | |
616 | | - | |
617 | | - | |
618 | | - | |
619 | | - | |
| 632 | + | |
620 | 633 | | |
621 | 634 | | |
622 | 635 | | |
| |||
667 | 680 | | |
668 | 681 | | |
669 | 682 | | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
670 | 686 | | |
671 | 687 | | |
672 | 688 | | |
| |||
788 | 804 | | |
789 | 805 | | |
790 | 806 | | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
791 | 829 | | |
792 | 830 | | |
793 | 831 | | |
| |||
1215 | 1253 | | |
1216 | 1254 | | |
1217 | 1255 | | |
1218 | | - | |
1219 | | - | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
1220 | 1261 | | |
1221 | 1262 | | |
1222 | 1263 | | |
| |||
1245 | 1286 | | |
1246 | 1287 | | |
1247 | 1288 | | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
| 1293 | + | |
1248 | 1294 | | |
1249 | 1295 | | |
1250 | 1296 | | |
| |||
1402 | 1448 | | |
1403 | 1449 | | |
1404 | 1450 | | |
1405 | | - | |
| 1451 | + | |
1406 | 1452 | | |
1407 | 1453 | | |
1408 | 1454 | | |
| |||
1418 | 1464 | | |
1419 | 1465 | | |
1420 | 1466 | | |
| 1467 | + | |
1421 | 1468 | | |
1422 | 1469 | | |
1423 | 1470 | | |
| |||
0 commit comments