Commit 6c440d1
committed
Make garbage collection an
This commit is similar to bytecodealliance#11442 and bytecodealliance#11460 except it's applied to the
garbage collection phase of Wasmtime's GC. Specifically the functions
that actually perform a GC are no longer duplicated across sync, async,
and maybe async versions. There's only one "always async" version and
the root-level crate entrypoints for sync versions assert that async
support is disabled and then use the async version.
Worth noting here is that GC suffers from a preexisting issue described
in bytecodealliance#11409 where it's not sound how a `StoreOpaque` is widened to acquire
a resource limiter. This commit seemingly makes the issue worse by
adding a few more `unsafe` blocks, but they're all fundamentally doing
the same thing as before. Fully solving this issue will require making
memory/table creation an `async` function that takes the limiter as an
argument. Doing this will require further refactoring/code movement so
my goal is to effectively maintain the status quo, but in a slightly
different location, and enable knocking out the `unsafe` in the future.
In the meantime the previous `unsafe` block is "lifted higher up" so
it's not quite so deep and should be easier to remove in the future.async function1 parent 71b8453 commit 6c440d1
File tree
7 files changed
+122
-188
lines changed- crates/wasmtime/src/runtime
- store
- vm
- gc
7 files changed
+122
-188
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2206 | 2206 | | |
2207 | 2207 | | |
2208 | 2208 | | |
2209 | | - | |
| 2209 | + | |
2210 | 2210 | | |
2211 | 2211 | | |
2212 | 2212 | | |
2213 | | - | |
| 2213 | + | |
2214 | 2214 | | |
2215 | 2215 | | |
2216 | 2216 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
| 96 | + | |
| 97 | + | |
97 | 98 | | |
98 | 99 | | |
99 | 100 | | |
| |||
881 | 882 | | |
882 | 883 | | |
883 | 884 | | |
884 | | - | |
885 | | - | |
| 885 | + | |
886 | 886 | | |
887 | 887 | | |
888 | 888 | | |
| |||
1101 | 1101 | | |
1102 | 1102 | | |
1103 | 1103 | | |
1104 | | - | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
1105 | 1107 | | |
1106 | 1108 | | |
1107 | 1109 | | |
| |||
1511 | 1513 | | |
1512 | 1514 | | |
1513 | 1515 | | |
1514 | | - | |
| 1516 | + | |
1515 | 1517 | | |
1516 | 1518 | | |
1517 | 1519 | | |
| |||
1558 | 1560 | | |
1559 | 1561 | | |
1560 | 1562 | | |
1561 | | - | |
| 1563 | + | |
1562 | 1564 | | |
1563 | 1565 | | |
1564 | 1566 | | |
| |||
1656 | 1658 | | |
1657 | 1659 | | |
1658 | 1660 | | |
1659 | | - | |
1660 | | - | |
1661 | | - | |
1662 | | - | |
1663 | | - | |
1664 | | - | |
| 1661 | + | |
1665 | 1662 | | |
1666 | 1663 | | |
1667 | 1664 | | |
| |||
1673 | 1670 | | |
1674 | 1671 | | |
1675 | 1672 | | |
1676 | | - | |
1677 | | - | |
| 1673 | + | |
| 1674 | + | |
| 1675 | + | |
| 1676 | + | |
| 1677 | + | |
1678 | 1678 | | |
1679 | 1679 | | |
1680 | 1680 | | |
| |||
1684 | 1684 | | |
1685 | 1685 | | |
1686 | 1686 | | |
1687 | | - | |
| 1687 | + | |
1688 | 1688 | | |
1689 | 1689 | | |
1690 | 1690 | | |
1691 | 1691 | | |
1692 | 1692 | | |
1693 | 1693 | | |
| 1694 | + | |
| 1695 | + | |
| 1696 | + | |
1694 | 1697 | | |
1695 | | - | |
| 1698 | + | |
| 1699 | + | |
| 1700 | + | |
| 1701 | + | |
| 1702 | + | |
| 1703 | + | |
1696 | 1704 | | |
| 1705 | + | |
| 1706 | + | |
| 1707 | + | |
1697 | 1708 | | |
1698 | 1709 | | |
1699 | 1710 | | |
| |||
1927 | 1938 | | |
1928 | 1939 | | |
1929 | 1940 | | |
1930 | | - | |
| 1941 | + | |
1931 | 1942 | | |
1932 | 1943 | | |
1933 | 1944 | | |
| |||
2271 | 2282 | | |
2272 | 2283 | | |
2273 | 2284 | | |
2274 | | - | |
| 2285 | + | |
2275 | 2286 | | |
2276 | 2287 | | |
2277 | 2288 | | |
| |||
2559 | 2570 | | |
2560 | 2571 | | |
2561 | 2572 | | |
2562 | | - | |
| 2573 | + | |
2563 | 2574 | | |
2564 | 2575 | | |
2565 | 2576 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
89 | 90 | | |
90 | 91 | | |
91 | 92 | | |
92 | | - | |
| 93 | + | |
93 | 94 | | |
94 | 95 | | |
95 | 96 | | |
96 | | - | |
| 97 | + | |
97 | 98 | | |
98 | 99 | | |
99 | 100 | | |
| |||
132 | 133 | | |
133 | 134 | | |
134 | 135 | | |
135 | | - | |
| 136 | + | |
136 | 137 | | |
137 | 138 | | |
138 | 139 | | |
139 | | - | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
140 | 144 | | |
141 | 145 | | |
142 | 146 | | |
| |||
164 | 168 | | |
165 | 169 | | |
166 | 170 | | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | 171 | | |
239 | 172 | | |
240 | 173 | | |
| |||
0 commit comments