Commit 05a711f
authored
Deduplicate static/dynamic host function code paths (#12146)
* Deduplicate static/dynamic host function code paths
This commit refactors the `component/func/host.rs` file to deduplicate
the paths between static/dynamic host functions. Previously there was a
significant amount of duplication between the two which has been
exacerbated through time. This commit refactors the state of affairs to
ensure that all the shared logic between the two is in one location and
the only difference is what they're already doing different (e.g.
lifting/lowering guts).
The high-level goal here was to see if this was possible, but in the end
this feels like a much cleaner state of affairs than prior as far fewer
details are duplicated across a few locations. The host function
behavior is slightly more "dynamic" than before in the sense that
statically-known signature has a few more type lookups than before, for
example, but this can be fixed in due time if necessary.
* Fix compile warnings/issues1 parent 99ef35d commit 05a711f
File tree
5 files changed
+494
-798
lines changed- crates/wasmtime/src/runtime
- component
- func
- vm
5 files changed
+494
-798
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
86 | | - | |
| 85 | + | |
| 86 | + | |
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| |||
2519 | 2519 | | |
2520 | 2520 | | |
2521 | 2521 | | |
2522 | | - | |
| 2522 | + | |
2523 | 2523 | | |
2524 | 2524 | | |
2525 | 2525 | | |
| |||
3279 | 3279 | | |
3280 | 3280 | | |
3281 | 3281 | | |
3282 | | - | |
3283 | | - | |
| 3282 | + | |
| 3283 | + | |
| 3284 | + | |
| 3285 | + | |
| 3286 | + | |
3284 | 3287 | | |
3285 | 3288 | | |
3286 | 3289 | | |
| |||
Lines changed: 1 addition & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | 7 | | |
9 | | - | |
10 | | - | |
11 | | - | |
| 8 | + | |
12 | 9 | | |
13 | 10 | | |
14 | 11 | | |
| |||
26 | 23 | | |
27 | 24 | | |
28 | 25 | | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | 26 | | |
41 | 27 | | |
42 | 28 | | |
| |||
0 commit comments