Module mmtk::scheduler::gc_work

source ·

Structs§

  • This provides an implementation of crate::scheduler::gc_work::ProcessEdgesWork. A plan that implements PlanTraceObject can use this work packet for tracing objects.
  • 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.
  • The collector GC Preparation Work
  • The mutator GC Preparation Work
  • 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 implements ObjectTracer by forwarding the trace_object calls to the wrapped ProcessEdgesWork instance.
  • 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.
  • 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 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.
  • 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§

  • RootsKind 🔒
    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 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.
  • Trait for a work packet that scans objects

Type Aliases§

  • A short-hand for <E::VM as VMBinding>::VMSlot.