Commit 1683e50
Supporting moving immix (#93)
This PR adds support for (partially) moving objects in Julia and should
be merged with mmtk/julia#27 and
mmtk/mmtk-core#897.
- It adds support for pinning/unpinning objects and checking if an
object is pinned (the implementation uses a pin bit).
(`mmtk_pin_object`, `mmtk_unpin_object` and `mmtk_is_pinned`)
- It adds support for providing transitively pinned (`tpinned`) roots .
- It implements the `copy` function in `object_model.rs`. Note that
arrays with inlined data must be treated specially, as their `a->data`
pointer needs to be updated after copying.
- It uses Julia's GC bits to store forwarding information and the
object's header to store the forwarding pointer.
- Currently, all stack roots are transitively pinned. Note that we also
need to traverse the `tls->live_tasks` to make sure that any stack root
from these tasks are transitively pinned.
- `scan_julia_object` had to be adapted to cover a few corner cases:
- when an array object contains a pointer to the owner of the data,
`a->data` needs to be updated in case the owner moves.
- the `using` field inside a `jl_module_t` may also be inlined inside
the module, and if that's the case, we need to make sure that field is
updated if the module moves.
- when marking finalizers, traversing the list of malloced arrays, and
the list of live tasks at the end of GC, we need to updated these lists
with objects that have possibly been moved.
- Added a few debug assertions to capture scanning of misaligned objects
and roots.
NB: I've only tested moving immix; sticky immix is still non-moving.
---------
Co-authored-by: Luis Eduardo de Souza Amorim <[email protected]>
Co-authored-by: Luis Eduardo de Souza Amorim <[email protected]>
Co-authored-by: mmtkgc-bot <[email protected]>
(cherry picked from commit 1622162)
# Conflicts:
# julia/mmtk_julia.c
# mmtk/Cargo.lock
# mmtk/Cargo.toml
# mmtk/api/mmtk.h
# mmtk/src/julia_scanning.rs
# mmtk/src/lib.rs
# mmtk/src/scanning.rs1 parent b78afd9 commit 1683e50
File tree
16 files changed
+440
-63
lines changed- .github
- scripts
- workflows
- julia
- mmtk
- api
- src
16 files changed
+440
-63
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
| |||
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
| 28 | + | |
26 | 29 | | |
27 | 30 | | |
28 | | - | |
| 31 | + | |
29 | 32 | | |
30 | 33 | | |
31 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
27 | 31 | | |
28 | 32 | | |
29 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
9 | 12 | | |
10 | 13 | | |
11 | 14 | | |
| |||
18 | 21 | | |
19 | 22 | | |
20 | 23 | | |
21 | | - | |
| 24 | + | |
22 | 25 | | |
23 | 26 | | |
24 | 27 | | |
| |||
37 | 40 | | |
38 | 41 | | |
39 | 42 | | |
40 | | - | |
| 43 | + | |
41 | 44 | | |
42 | 45 | | |
43 | 46 | | |
| |||
56 | 59 | | |
57 | 60 | | |
58 | 61 | | |
59 | | - | |
| 62 | + | |
60 | 63 | | |
61 | 64 | | |
62 | 65 | | |
| |||
72 | 75 | | |
73 | 76 | | |
74 | 77 | | |
75 | | - | |
| 78 | + | |
76 | 79 | | |
77 | 80 | | |
78 | 81 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| 25 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
24 | 30 | | |
25 | 31 | | |
26 | 32 | | |
| |||
121 | 127 | | |
122 | 128 | | |
123 | 129 | | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
124 | 133 | | |
125 | 134 | | |
126 | 135 | | |
| |||
277 | 286 | | |
278 | 287 | | |
279 | 288 | | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
280 | 302 | | |
281 | 303 | | |
282 | 304 | | |
| |||
305 | 327 | | |
306 | 328 | | |
307 | 329 | | |
308 | | - | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
309 | 335 | | |
310 | 336 | | |
311 | 337 | | |
| 338 | + | |
312 | 339 | | |
313 | 340 | | |
314 | 341 | | |
| |||
350 | 377 | | |
351 | 378 | | |
352 | 379 | | |
| 380 | + | |
353 | 381 | | |
354 | 382 | | |
355 | 383 | | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
356 | 409 | | |
357 | 410 | | |
358 | 411 | | |
| |||
367 | 420 | | |
368 | 421 | | |
369 | 422 | | |
| 423 | + | |
370 | 424 | | |
371 | 425 | | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
372 | 429 | | |
373 | 430 | | |
374 | 431 | | |
375 | 432 | | |
| 433 | + | |
376 | 434 | | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
377 | 438 | | |
378 | 439 | | |
379 | 440 | | |
| |||
384 | 445 | | |
385 | 446 | | |
386 | 447 | | |
| 448 | + | |
387 | 449 | | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
388 | 453 | | |
389 | 454 | | |
390 | 455 | | |
391 | 456 | | |
| 457 | + | |
392 | 458 | | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
393 | 462 | | |
394 | 463 | | |
395 | 464 | | |
| |||
398 | 467 | | |
399 | 468 | | |
400 | 469 | | |
| 470 | + | |
401 | 471 | | |
402 | 472 | | |
403 | 473 | | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
404 | 481 | | |
405 | 482 | | |
406 | 483 | | |
| |||
534 | 611 | | |
535 | 612 | | |
536 | 613 | | |
| 614 | + | |
537 | 615 | | |
538 | 616 | | |
| 617 | + | |
| 618 | + | |
539 | 619 | | |
540 | 620 | | |
541 | 621 | | |
| |||
547 | 627 | | |
548 | 628 | | |
549 | 629 | | |
| 630 | + | |
550 | 631 | | |
551 | 632 | | |
552 | 633 | | |
0 commit comments