Differentiate OBJ_PIN and PTR_PIN. Add more pinning. Trace all global roots.#84
Differentiate OBJ_PIN and PTR_PIN. Add more pinning. Trace all global roots.#84
Conversation
Differentiate ptr pin and obj pin for hash maps
udesou
left a comment
There was a problem hiding this comment.
A general note is that you should probably add comments to all the points you're pinning objects (maybe not for the *HASH_PIN ones).
| // Typenames should be pinned since they are used as metadata, and are | ||
| // read during scan_object | ||
| PTR_PIN(tn); | ||
| OBJ_PIN(tn); |
There was a problem hiding this comment.
Should typenames be allocated in a non-moving space? Maybe add a FIXME comment saying that instead of pinning them, we might do that instead.
There was a problem hiding this comment.
I have a commit to add an allocation function jl_gc_alloc_non_moving_ and use it for cases like this. Do you want me to include the change in this PR? I planned to have it as a separate PR after this one, but I can include it here.
|
|
||
| #define TRACE_GLOBALLY_ROOTED(r) add_node_to_roots_buffer(closure, buf, buf_len, r) | ||
|
|
||
| // This is a list of global variables that are marked with JL_GLOBALLY_ROOTED. We need to make sure that they |
There was a problem hiding this comment.
For now this is fine, but I wonder whether we should try to capture this automatically somehow. It's a bit of a pain that you had to add all these variables manually.
… roots. (mmtk#84) This PR * differentiates `OBJ_PIN` from `PTR_PIN`. In rare cases, we have to deal with internal pointers, and have to use `PTR_PIN`. * pins more objects that cannot be moved. * traces all the `JL_GLOBALLY_ROOTED` symbols. This PR still transitively pins `jl_global_roots_list`. Without transitive pinning, we observed assertions failures in the precompilation step during Julia build, saying we reach objects without the valid object bit. This issue will be debugged and fixed after this PR.
This PR
OBJ_PINfromPTR_PIN. In rare cases, we have to deal with internal pointers, and have to usePTR_PIN.JL_GLOBALLY_ROOTEDsymbols.This PR still transitively pins
jl_global_roots_list. Without transitive pinning, we observed assertions failures in the precompilation step during Julia build, saying we reach objects without the valid object bit. This issue will be debugged and fixed after this PR.