This is an alternative to ScanObjects that calls the post_scan_object of the policy
selected by the plan. It is applicable to plans that derive PlanTraceObject.
The global GC Preparation Work
This work packet invokes prepare() for the plan (which will invoke prepare() for each space), and
pushes work packets for preparing mutators and collectors.
We should only have one such work packet per GC, before any actual GC work starts.
We assume this work packet is the only running work packet that accesses plan, and there should
be no other concurrent work packet that accesses plan (read or write). Otherwise, there may
be a race condition.
An implementation of RootsWorkFactory that creates work packets based on ProcessEdgesWork
for handling roots. The DPE and the PPE type parameters correspond to the
DefaultProcessEdge and the PinningProcessEdges type members of the GCWorkContext trait.
This type implements ObjectTracerContext by creating a temporary ProcessEdgesWork during
the call to with_tracer, making use of its trace_object method. It then creates work
packets using the methods of the ProcessEdgesWork and add the work packet into the given
stage.
The global GC release Work
This work packet invokes release() for the plan (which will invoke release() for each space), and
pushes work packets for releasing mutators and collectors.
We should only have one such work packet per GC, after all actual GC work ends.
We assume this work packet is the only running work packet that accesses plan, and there should
be no other concurrent work packet that accesses plan (read or write). Otherwise, there may
be a race condition.
A general implementation of ProcessEdgesWork using SFT. A plan can always implement their
own ProcessEdgesWork instances. However, most plans can use this work packet for tracing amd
they do not need to provide a plan-specific trace object work packet. If they choose to use this
type, they need to provide a correct implementation for some related methods (such as
Space.set_copy_for_sft_trace(), SFT.sft_trace_object()). Some plans are not using this type,
mostly due to more complex tracing. Either it is impossible to use this type, or there is
performance overheads for using this general trace type. In such cases, they implement their
specific ProcessEdgesWork instances.
Scan objects and enqueue the slots of the objects. For objects that do not support
slot-enqueuing, this work packet also traces their outgoing edges directly.
An abstract trait for work packets that process object graph edges. Its method
ProcessEdgesWork::trace_object traces an object and, upon first visit, enqueues it into an
internal queue inside the ProcessEdgesWork instance. Each implementation of this trait
implement trace_object differently. During Plan::schedule_collection, plans select
(usually via GCWorkContext) specialized implementations of this trait to be used during each
trace according the nature of each trace, such as whether it is a nursery collection, whether it
is a defrag collection, whether it pins objects, etc.