Commit b5d95aa
authored
Bake
* Bake `async` into component model function types
This commit is a breaking change to the component-model-async
implementation in this repository. This will effectively invalidate all
WASIp3 binaries created prior to this commit. Given that this feature is
off-by-default everywhere (right? right?) it's expected that while this
will have churn it's the appropriate time to make such a change as this.
Concretely the changes here are:
* Function types in the component model now reflect whether they're
`async`-or-not. This is no longer WIT-level sugar.
* Kebab names no longer support `[async]`, `[async method]`, or
`[async static]`.
* The text format now supports `(func async? (param ...))`.
The binary format previously used 0x40 as the prefix byte for "this is a
component function type" and now 0x43 is used as "this is an async
function type". The `async_` boolean is plumbed throughout component
function type locations and is required to be handled by callers. For
now there is no subtyping relationship between async and non-async
functions, they must be exactly the same when linking.
The rationale for this change is going to be expanded on more fully in
an upcoming PR to the component-model repository itself. The rough
tl;dr; is that to fully support JS in/out of components the component
model is going to need to require traps in some dynamic situations such
as when a synchronous function-type function tries to block. This is
required to respect JS's "cannot block the main thread" semantics, for
example. This will be more fully explain in the component-model PR and
this PR is not intended to serve as justification alone for this change.
Instead this PR is intended to change/update Wasmtime as quickly as
possible to understand the new binary format so implementation work can
proceed as most of the work here is on the runtime side of things, not
validation.
One minor caveat for this change is that the `wit-dylib` crate has some
tests which exercise async functionality. Those are now all disabled or
set as "expect this to fail" because Wasmtime, the runner for these
tests, no longer understands the binaries it's ingesting.
* Delete outdated snapshot
* Propagate async-ness in wasm-compose too
* Add `async` to the function type hash keyasync into component model function types (#2376)1 parent e2bb0a2 commit b5d95aa
File tree
47 files changed
+280
-411
lines changed- crates
- wasm-compose/src
- wasm-encoder/src
- component
- reencode
- wasmparser/src
- readers/component
- validator
- wasmprinter/src
- wast/src/component
- wit-component
- src
- encoding
- tests/components/link-lib-with-async-export
- wit-dylib
- test-programs/src/bin
- tests
- wit-parser
- src
- ast
- tests/ui
- parse-fail
- tests
- cli
- component-model/async
- dump
- missing-features/component-model
- snapshots/cli
- component-model/async
- names.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.
47 files changed
+280
-411
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
482 | 482 | | |
483 | 483 | | |
484 | 484 | | |
485 | | - | |
| 485 | + | |
486 | 486 | | |
487 | 487 | | |
488 | 488 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
353 | 353 | | |
354 | 354 | | |
355 | 355 | | |
| 356 | + | |
356 | 357 | | |
357 | 358 | | |
358 | 359 | | |
359 | 360 | | |
360 | 361 | | |
361 | 362 | | |
362 | 363 | | |
363 | | - | |
364 | 364 | | |
| 365 | + | |
365 | 366 | | |
366 | 367 | | |
367 | 368 | | |
368 | 369 | | |
369 | 370 | | |
370 | 371 | | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
371 | 394 | | |
372 | 395 | | |
373 | 396 | | |
| |||
383 | 406 | | |
384 | 407 | | |
385 | 408 | | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
386 | 412 | | |
387 | 413 | | |
388 | 414 | | |
| |||
402 | 428 | | |
403 | 429 | | |
404 | 430 | | |
| 431 | + | |
405 | 432 | | |
406 | 433 | | |
407 | 434 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
731 | 731 | | |
732 | 732 | | |
733 | 733 | | |
| 734 | + | |
734 | 735 | | |
735 | 736 | | |
736 | 737 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
282 | 282 | | |
283 | 283 | | |
284 | 284 | | |
285 | | - | |
| 285 | + | |
286 | 286 | | |
287 | 287 | | |
288 | 288 | | |
289 | 289 | | |
290 | | - | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
291 | 295 | | |
292 | 296 | | |
293 | 297 | | |
| |||
387 | 391 | | |
388 | 392 | | |
389 | 393 | | |
| 394 | + | |
| 395 | + | |
390 | 396 | | |
391 | 397 | | |
392 | 398 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1447 | 1447 | | |
1448 | 1448 | | |
1449 | 1449 | | |
| 1450 | + | |
1450 | 1451 | | |
1451 | 1452 | | |
1452 | 1453 | | |
| |||
3051 | 3052 | | |
3052 | 3053 | | |
3053 | 3054 | | |
| 3055 | + | |
| 3056 | + | |
| 3057 | + | |
| 3058 | + | |
| 3059 | + | |
| 3060 | + | |
| 3061 | + | |
3054 | 3062 | | |
3055 | 3063 | | |
3056 | 3064 | | |
| |||
3092 | 3100 | | |
3093 | 3101 | | |
3094 | 3102 | | |
| 3103 | + | |
3095 | 3104 | | |
3096 | 3105 | | |
3097 | 3106 | | |
| |||
4534 | 4543 | | |
4535 | 4544 | | |
4536 | 4545 | | |
4537 | | - | |
4538 | 4546 | | |
4539 | | - | |
4540 | 4547 | | |
4541 | | - | |
4542 | 4548 | | |
4543 | 4549 | | |
4544 | 4550 | | |
| |||
4552 | 4558 | | |
4553 | 4559 | | |
4554 | 4560 | | |
4555 | | - | |
| 4561 | + | |
4556 | 4562 | | |
4557 | 4563 | | |
4558 | 4564 | | |
| |||
4593 | 4599 | | |
4594 | 4600 | | |
4595 | 4601 | | |
4596 | | - | |
4597 | 4602 | | |
4598 | 4603 | | |
4599 | 4604 | | |
| |||
4602 | 4607 | | |
4603 | 4608 | | |
4604 | 4609 | | |
4605 | | - | |
4606 | | - | |
4607 | | - | |
4608 | | - | |
4609 | | - | |
4610 | | - | |
4611 | | - | |
4612 | | - | |
4613 | | - | |
4614 | | - | |
4615 | | - | |
4616 | | - | |
4617 | | - | |
4618 | 4610 | | |
4619 | 4611 | | |
4620 | 4612 | | |
4621 | 4613 | | |
4622 | | - | |
4623 | 4614 | | |
4624 | 4615 | | |
4625 | 4616 | | |
| |||
4630 | 4621 | | |
4631 | 4622 | | |
4632 | 4623 | | |
| 4624 | + | |
| 4625 | + | |
| 4626 | + | |
4633 | 4627 | | |
4634 | 4628 | | |
4635 | 4629 | | |
| |||
4661 | 4655 | | |
4662 | 4656 | | |
4663 | 4657 | | |
4664 | | - | |
| 4658 | + | |
4665 | 4659 | | |
4666 | 4660 | | |
4667 | 4661 | | |
| |||
4693 | 4687 | | |
4694 | 4688 | | |
4695 | 4689 | | |
4696 | | - | |
| 4690 | + | |
4697 | 4691 | | |
4698 | 4692 | | |
4699 | 4693 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1086 | 1086 | | |
1087 | 1087 | | |
1088 | 1088 | | |
| 1089 | + | |
| 1090 | + | |
1089 | 1091 | | |
1090 | 1092 | | |
1091 | 1093 | | |
| |||
3237 | 3239 | | |
3238 | 3240 | | |
3239 | 3241 | | |
| 3242 | + | |
| 3243 | + | |
| 3244 | + | |
| 3245 | + | |
| 3246 | + | |
| 3247 | + | |
| 3248 | + | |
| 3249 | + | |
| 3250 | + | |
3240 | 3251 | | |
3241 | 3252 | | |
3242 | 3253 | | |
| |||
0 commit comments