Trait mmtk::scheduler::GCWork

source ·
pub trait GCWork<VM: VMBinding>: 'static + Send {
    // Required method
    fn do_work(&mut self, worker: &mut GCWorker<VM>, mmtk: &'static MMTK<VM>);

    // Provided methods
    fn do_work_with_stat(
        &mut self,
        worker: &mut GCWorker<VM>,
        mmtk: &'static MMTK<VM>
    ) { ... }
    fn get_type_name(&self) -> &'static str { ... }
}
Expand description

This defines a GC work packet which are assigned to the GCWorkers by the scheduler. Work packets carry payloads that indicate the work to be done. For example, a work packet may contain a pointer to a stack that must be scanned, or it may contain a large buffer of pointers that need to be traced, or it might contain a range of static variables to be scanned, etc. The size of the work packet will need to consider at least two points of tension: the work packet must be large enough to ensure that the costs of managing the work packets do not dominate, and the packet must be small enough that good load balancing is achieved.

Required Methods§

source

fn do_work(&mut self, worker: &mut GCWorker<VM>, mmtk: &'static MMTK<VM>)

Define the work for this packet. However, this is not supposed to be called directly. Usually do_work_with_stat() should be used.

Most work packets are polled and executed in the worker’s main loop (GCWorker::run) using do_work_with_stat. If do_work is called directly during the execution of another work packet, bypassing do_work_with_stat(), this work packet will not be counted into the number of work packets executed, and the execution time of this work packet will be counted as part of the execution time of the other work packet. Only call this method directly if this is what you intend. But you should always consider adding the work packet into a bucket so that other GC workers can execute it in parallel, unless the context- switching overhead is a problem.

Provided Methods§

source

fn do_work_with_stat( &mut self, worker: &mut GCWorker<VM>, mmtk: &'static MMTK<VM> )

Do work and collect statistics. This internally calls do_work(). In most cases, this should be called rather than do_work() so that MMTk can correctly collect statistics for the work packets. If the feature “work_packet_stats” is not enabled, this call simply forwards the call to do_work().

source

fn get_type_name(&self) -> &'static str

Get the compile-time static type name for the work packet.

Implementors§

source§

impl<C: GCWorkContext + 'static> GCWork<<C as GCWorkContext>::VM> for Release<C>

source§

impl<C: GCWorkContext> GCWork<<C as GCWorkContext>::VM> for Prepare<C>

source§

impl<C: GCWorkContext> GCWork<<C as GCWorkContext>::VM> for ScanMutatorRoots<C>

source§

impl<C: GCWorkContext> GCWork<<C as GCWorkContext>::VM> for ScanVMSpecificRoots<C>

source§

impl<C: GCWorkContext> GCWork<<C as GCWorkContext>::VM> for StopMutators<C>

source§

impl<E: ProcessEdgesWork> GCWork<<E as ProcessEdgesWork>::VM> for ProcessModBuf<E>

source§

impl<E: ProcessEdgesWork> GCWork<<E as ProcessEdgesWork>::VM> for ProcessRegionModBuf<E>

source§

impl<E: ProcessEdgesWork> GCWork<<E as ProcessEdgesWork>::VM> for Finalization<E>

source§

impl<E: ProcessEdgesWork> GCWork<<E as ProcessEdgesWork>::VM> for ForwardFinalization<E>

source§

impl<E: ProcessEdgesWork> GCWork<<E as ProcessEdgesWork>::VM> for RefForwarding<E>

source§

impl<E: ProcessEdgesWork> GCWork<<E as ProcessEdgesWork>::VM> for SoftRefProcessing<E>

source§

impl<E: ProcessEdgesWork> GCWork<<E as ProcessEdgesWork>::VM> for ScanObjects<E>

source§

impl<E: ProcessEdgesWork> GCWork<<E as ProcessEdgesWork>::VM> for VMForwardWeakRefs<E>

source§

impl<E: ProcessEdgesWork> GCWork<<E as ProcessEdgesWork>::VM> for VMProcessWeakRefs<E>

source§

impl<E: ProcessEdgesWork> GCWork<<E as ProcessEdgesWork>::VM> for E

source§

impl<E: ProcessEdgesWork, P: Plan<VM = E::VM> + PlanTraceObject<E::VM>> GCWork<<E as ProcessEdgesWork>::VM> for PlanScanObjects<E, P>

source§

impl<P: Plan> GCWork<<P as HasSpaces>::VM> for SanityPrepare<P>

source§

impl<P: Plan> GCWork<<P as HasSpaces>::VM> for SanityRelease<P>

source§

impl<P: Plan> GCWork<<P as HasSpaces>::VM> for ScheduleSanityGC<P>

source§

impl<VM: VMBinding> GCWork<VM> for CalculateForwardingAddress<VM>

source§

impl<VM: VMBinding> GCWork<VM> for Compact<VM>

source§

impl<VM: VMBinding> GCWork<VM> for UpdateReferences<VM>

source§

impl<VM: VMBinding> GCWork<VM> for ClearVOBitsAfterPrepare

source§

impl<VM: VMBinding> GCWork<VM> for PrepareBlockState<VM>

source§

impl<VM: VMBinding> GCWork<VM> for mmtk::policy::immix::immixspace::SweepChunk<VM>

source§

impl<VM: VMBinding> GCWork<VM> for MSSweepChunk<VM>

source§

impl<VM: VMBinding> GCWork<VM> for PrepareChunkMap<VM>

source§

impl<VM: VMBinding> GCWork<VM> for ReleaseMarkSweepSpace<VM>

source§

impl<VM: VMBinding> GCWork<VM> for mmtk::policy::marksweepspace::native_ms::global::SweepChunk<VM>

source§

impl<VM: VMBinding> GCWork<VM> for GcHookWork

source§

impl<VM: VMBinding> GCWork<VM> for PhantomRefProcessing<VM>

source§

impl<VM: VMBinding> GCWork<VM> for RefEnqueue<VM>

source§

impl<VM: VMBinding> GCWork<VM> for RescanReferences<VM>

source§

impl<VM: VMBinding> GCWork<VM> for WeakRefProcessing<VM>

source§

impl<VM: VMBinding> GCWork<VM> for PrepareCollector

source§

impl<VM: VMBinding> GCWork<VM> for PrepareMutator<VM>

source§

impl<VM: VMBinding> GCWork<VM> for ReleaseCollector

source§

impl<VM: VMBinding> GCWork<VM> for ReleaseMutator<VM>

source§

impl<VM: VMBinding> GCWork<VM> for ScheduleCollection

source§

impl<VM: VMBinding> GCWork<VM> for VMPostForwarding<VM>

source§

impl<VM: VMBinding, R2OPE: ProcessEdgesWork<VM = VM>, O2OPE: ProcessEdgesWork<VM = VM>> GCWork<VM> for ProcessRootNode<VM, R2OPE, O2OPE>