Structs§
- This provides an implementation of
crate::scheduler::gc_work::ProcessEdgesWork
. A plan that implementsPlanTraceObject
can use this work packet for tracing objects. - This is an alternative to
ScanObjects
that calls thepost_scan_object
of the policy selected by the plan. It is applicable to plans that derivePlanTraceObject
. - 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.
- The collector GC Preparation Work
- The mutator GC Preparation Work
- An implementation of
RootsWorkFactory
that creates work packets based onProcessEdgesWork
for handling roots. TheDPE
and thePPE
type parameters correspond to theDefaultProcessEdge
and thePinningProcessEdges
type members of theGCWorkContext
trait. - This implements
ObjectTracer
by forwarding thetrace_object
calls to the wrappedProcessEdgesWork
instance. - This type implements
ObjectTracerContext
by creating a temporaryProcessEdgesWork
during the call towith_tracer
, making use of itstrace_object
method. It then creates work packets using the methods of theProcessEdgesWork
and add the work packet into the givenstage
. - This work packet processes pinning roots.
- 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.
- The collector release Work
- The mutator release Work
- A general implementation of
ProcessEdgesWork
using SFT. A plan can always implement their ownProcessEdgesWork
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 asSpace.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 specificProcessEdgesWork
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.
- Stop all mutators
- A
ProcessEdgesWork
type that panics when any of its method is used. This is currently used for plans that do not support transitively pinning. - Delegate to the VM binding for forwarding weak references.
- This work packet calls
Collection::post_forwarding
. - Delegate to the VM binding for weak reference processing.
Enums§
- For USDT tracepoints for roots. Keep in sync with
tools/tracing/timeline/visualize.py
.
Traits§
- 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 theProcessEdgesWork
instance. Each implementation of this trait implementtrace_object
differently. DuringPlan::schedule_collection
, plans select (usually viaGCWorkContext
) 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. - Trait for a work packet that scans objects
Type Aliases§
- A short-hand for
<E::VM as VMBinding>::VMSlot
.