Decouple root scanning from ProcessEdgesWork. #598
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This draft PR is a proposal for changing the root-scanning interface.
When scanning roots, the VM should only report what roots it has, not deciding what work packets to create. But currently,
scan_thread_root
,scan_thread_roots
andscan_vm_specific_root
take a generic type parameter<E: ProcessEdgesWork>
which binds them to aProcessEdgesWork
. This may not be general enough, in two ways:is_mmtk_object
function in the core).ProcessEdgesWork
. AlthoughProcessEdgesWork
is still a trait, it is too tied to some kinds of GC. For example, it contains the logic of tracing objects and scanning objects (viaScanObjects
). The real culprit is theProcessEdgesWork
.However, from the code in this PR, we observe that we need to wrap
ProcessEdgesWork
in such a complicated manner just to get a chance to call the plan-specifictrace_object
function. Probably it is easier to do this refactoring if we eliminate (or weaken) theProcessEdgesWork
trait first.