Commit eafe743
authored
Do not reorder/pack struct fields (bytecodealliance#10463)
* Do not reorder/pack struct fields
We were not considering that when a type T is a subtype of type U, that all of
the fields that T and U share must be at the same offsets. Our
reordering/packing algorithm did not consider this. So we stop reordering struct
fields for now.
This also means that we cannot guarantee that all GC refs in an object are
contiguously packed anymore. Instead, we maintain a map keyed by
`VMSharedTypeIndex`, whose value is all the offsets of outgoing GC
references for instances of that type. Tracing looks up the current object's
type in this map, and then extracts each of the GC edges.
This new tracing scheme means that we no longer need to store the number of
outgoing edges in the GC object header, and can put the object size in there
again, reducing the DRC header from 24 to 16 bytes.
Fixes bytecodealliance#10459
Fixes bytecodealliance#10464
* Correctly handle `Layout` errors in `libcalls::gc_alloc_raw`1 parent bf9273a commit eafe743
File tree
37 files changed
+655
-555
lines changed- crates
- cranelift/src/gc/enabled
- environ/src
- gc
- wasmtime/src/runtime
- trampoline
- vm
- gc
- enabled
- instance
- allocator
- pooling
- tests
- disas/gc
- drc
- misc_testsuite/gc
37 files changed
+655
-555
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | 263 | | |
267 | 264 | | |
268 | 265 | | |
269 | 266 | | |
270 | | - | |
271 | 267 | | |
272 | 268 | | |
273 | 269 | | |
| |||
278 | 274 | | |
279 | 275 | | |
280 | 276 | | |
281 | | - | |
282 | 277 | | |
283 | 278 | | |
284 | 279 | | |
285 | 280 | | |
286 | 281 | | |
287 | 282 | | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
292 | 286 | | |
293 | 287 | | |
294 | 288 | | |
| |||
321 | 315 | | |
322 | 316 | | |
323 | 317 | | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | 318 | | |
330 | 319 | | |
331 | 320 | | |
332 | 321 | | |
333 | 322 | | |
334 | 323 | | |
335 | 324 | | |
336 | | - | |
337 | 325 | | |
338 | 326 | | |
339 | 327 | | |
| |||
394 | 382 | | |
395 | 383 | | |
396 | 384 | | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | 385 | | |
402 | 386 | | |
403 | 387 | | |
404 | 388 | | |
405 | | - | |
406 | 389 | | |
407 | 390 | | |
408 | 391 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
| 119 | + | |
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
135 | 136 | | |
136 | 137 | | |
137 | 138 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | 4 | | |
6 | 5 | | |
7 | | - | |
| 6 | + | |
8 | 7 | | |
9 | 8 | | |
10 | 9 | | |
| |||
26 | 25 | | |
27 | 26 | | |
28 | 27 | | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
| 28 | + | |
78 | 29 | | |
79 | 30 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1423 | 1423 | | |
1424 | 1424 | | |
1425 | 1425 | | |
1426 | | - | |
| 1426 | + | |
1427 | 1427 | | |
1428 | 1428 | | |
1429 | 1429 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
244 | 244 | | |
245 | 245 | | |
246 | 246 | | |
| 247 | + | |
247 | 248 | | |
248 | 249 | | |
249 | 250 | | |
| |||
0 commit comments