mmtk/plan/
gc_work.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//! This module holds work packets for `CommonPlan` and `BasePlan`, or other work packets not
//! directly related to scheduling.

use crate::{plan::global::CommonPlan, scheduler::GCWork, vm::VMBinding};

pub(super) struct SetCommonPlanUnlogBits<VM: VMBinding> {
    pub common_plan: &'static CommonPlan<VM>,
}

impl<VM: VMBinding> GCWork<VM> for SetCommonPlanUnlogBits<VM> {
    fn do_work(
        &mut self,
        _worker: &mut crate::scheduler::GCWorker<VM>,
        _mmtk: &'static crate::MMTK<VM>,
    ) {
        self.common_plan.set_side_log_bits();
    }
}

pub(super) struct ClearCommonPlanUnlogBits<VM: VMBinding> {
    pub common_plan: &'static CommonPlan<VM>,
}

impl<VM: VMBinding> GCWork<VM> for ClearCommonPlanUnlogBits<VM> {
    fn do_work(
        &mut self,
        _worker: &mut crate::scheduler::GCWorker<VM>,
        _mmtk: &'static crate::MMTK<VM>,
    ) {
        self.common_plan.clear_side_log_bits();
    }
}