Commit 63d482c
Stack switching: Infrastructure and runtime support (#10388)
* [pr1] base
* prtest:full
* make sure to use ControlFlow result in trace_suspended_continuation
* stack-switching: cleanup: remove stray c-api changes
These are remnants of unrelated wasmfx wasmtime experiments, possibly
suitable for later submission against upstream.
* stack-switching: reuse async_stack_size
* stack-switching: delete delete_me debugging
* stack-switching: address feedback in environ::types
* stack-switching: remove unused code from vmoffsets
* stack-switching: drop dependency on std
* stack-switching: add compilation checks to ci matrix
* stack-switching: remove debug_println cruft
* stack-switching: export environ consts consistently
* stack-switching: export vm pub items consistently
* table_pool: reduced capacity for large elements
VMContRef elements which takes up two words and we don't want to
double the size of all tables in order to support storing these.
This change changes the table to target storing the requested
max number of elements if they are "nominally" sized with
(potentially) reduced capacity for non-nominally sized types when
encountered.
Continuations are the only type of element which may result in
fewer table slots being available than requested.
* stack-switching: extend conditional compilation
A fair bit of the definitions for stack switching are still
enabled, but this patch takes things a bit further to avoid
compilation problems; notably, cont_new is now not compiled
in unless the feature is enabled.
* stack-switching: formatting fixes
* stack-switching: address new clippy checks
In addition, to get clippy to fully pass, plumbed in
additional config to make winch paths happy; there's no
impl for winch yet but plumbing through the feature is
required to make paths incorporating macros at various
layers satisfied (and it is expected we'll use the
features in the future).
* stack-switching: more conditional compilation fixes
* stack-switching: additional conditional compile on table builtins for continuations
* stack-switching: additional conditional compile fixes
* stack-switching: additional conditional compile in store
* stack-switching: remove overly strict assertion
* stack-switching: remove errantly dropped no_mangle in config c-api
* stack-switching: VMContObj::from_raw_parts
* stack-switching: remove duplicate async_stack_size feature check
* stack-switching: VMArray -> VMHostArray
* stack-switching: remove unnecessary clippy exception
* stack-switching: fix docs referenced VMRuntimeLimits
* stack-switching: fix doc typo
* stack-switching: follow recommendations for type casts
* stack-switching: use usize::next_multiple_of
* stack-switching: update outdated comment
* stack-switching: use feature gate instead of allow(dead_code)
* stack-switching: rework backtrace using chunks/zip
* stack-switching: move tests to footer module
This is a bit more consistent with the prevailing style
in tree and (subjectively) makes finding the tests
as a reader more straightforward.
Tests left unchanged sans some import cleanup.
* stack-swictchding: verify stack_chain offsets at runtime
* fixup! stack-switching: use feature gate instead of allow(dead_code)
* stack-switching: document continuation roots tracing using match arms
---------
Co-authored-by: Paul Osborne <paul.osborne@fastly.com>1 parent c71d3aa commit 63d482c
File tree
50 files changed
+2666
-124
lines changed- .github/workflows
- crates
- c-api
- include/wasmtime
- src
- cli-flags
- src
- cranelift
- src
- func_environ/gc
- translate
- environ
- src
- fuzzing/src/generators
- test-util/src
- wasmtime
- src
- runtime
- externals
- gc/enabled
- vm
- instance/allocator
- pooling
- stack_switching
- stack
- unix
- traphandlers
- winch
- tests/all
- winch/codegen
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
50 files changed
+2666
-124
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
371 | 371 | | |
372 | 372 | | |
373 | 373 | | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
374 | 377 | | |
375 | 378 | | |
376 | 379 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
431 | 431 | | |
432 | 432 | | |
433 | 433 | | |
| 434 | + | |
434 | 435 | | |
435 | 436 | | |
436 | 437 | | |
| |||
489 | 490 | | |
490 | 491 | | |
491 | 492 | | |
| 493 | + | |
492 | 494 | | |
493 | 495 | | |
494 | 496 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
253 | 261 | | |
254 | 262 | | |
255 | 263 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
143 | 148 | | |
144 | 149 | | |
145 | 150 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
377 | 377 | | |
378 | 378 | | |
379 | 379 | | |
| 380 | + | |
| 381 | + | |
380 | 382 | | |
381 | 383 | | |
382 | 384 | | |
| |||
818 | 820 | | |
819 | 821 | | |
820 | 822 | | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
821 | 840 | | |
822 | 841 | | |
823 | 842 | | |
| |||
923 | 942 | | |
924 | 943 | | |
925 | 944 | | |
926 | | - | |
927 | | - | |
928 | | - | |
929 | | - | |
930 | | - | |
931 | 945 | | |
932 | 946 | | |
933 | 947 | | |
| |||
940 | 954 | | |
941 | 955 | | |
942 | 956 | | |
943 | | - | |
| 957 | + | |
944 | 958 | | |
945 | 959 | | |
946 | 960 | | |
| |||
983 | 997 | | |
984 | 998 | | |
985 | 999 | | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
986 | 1003 | | |
987 | 1004 | | |
988 | 1005 | | |
| |||
1023 | 1040 | | |
1024 | 1041 | | |
1025 | 1042 | | |
| 1043 | + | |
1026 | 1044 | | |
1027 | 1045 | | |
1028 | 1046 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
49 | 50 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3793 | 3793 | | |
3794 | 3794 | | |
3795 | 3795 | | |
| 3796 | + | |
| 3797 | + | |
| 3798 | + | |
| 3799 | + | |
| 3800 | + | |
| 3801 | + | |
| 3802 | + | |
| 3803 | + | |
| 3804 | + | |
| 3805 | + | |
| 3806 | + | |
| 3807 | + | |
| 3808 | + | |
| 3809 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
156 | | - | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
157 | 162 | | |
158 | 163 | | |
159 | 164 | | |
| |||
1032 | 1037 | | |
1033 | 1038 | | |
1034 | 1039 | | |
| 1040 | + | |
| 1041 | + | |
1035 | 1042 | | |
1036 | 1043 | | |
1037 | 1044 | | |
| |||
1086 | 1093 | | |
1087 | 1094 | | |
1088 | 1095 | | |
1089 | | - | |
1090 | | - | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
1091 | 1102 | | |
1092 | 1103 | | |
1093 | 1104 | | |
| |||
1409 | 1420 | | |
1410 | 1421 | | |
1411 | 1422 | | |
1412 | | - | |
1413 | | - | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
1414 | 1426 | | |
1415 | 1427 | | |
1416 | 1428 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
64 | 68 | | |
65 | 69 | | |
66 | 70 | | |
| |||
202 | 206 | | |
203 | 207 | | |
204 | 208 | | |
205 | | - | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
206 | 214 | | |
207 | 215 | | |
208 | 216 | | |
| |||
0 commit comments