11use super :: global:: LXR ;
2+ use crate :: plan:: lxr:: gc_work:: rc:: { ProcessIncs , EDGE_KIND_ROOT } ;
23use crate :: plan:: tracing:: UnsupportedTrace ;
34use crate :: scheduler:: gc_work:: RootKind ;
45use crate :: util:: ObjectReference ;
56use crate :: vm:: { RootsWorkFactory , VMBinding } ;
6- use crate :: MMTK ;
7+ use crate :: { Plan , MMTK } ;
78use std:: marker:: PhantomData ;
89
910pub mod mature_evac;
@@ -13,8 +14,6 @@ pub mod prepare;
1314pub mod rc;
1415pub mod tracing;
1516
16- use rc:: CollectRoots ;
17-
1817/// The [`crate::scheduler::GCWorkContext`] for LXR.
1918///
2019/// LXR does not use the generic `Trace`-based closures. Instead it schedules its own custom work
@@ -55,8 +54,10 @@ impl<VM: VMBinding> LXRRootsWorkFactory<VM> {
5554
5655impl < VM : VMBinding > RootsWorkFactory < VM :: VMSlot > for LXRRootsWorkFactory < VM > {
5756 fn create_process_roots_work_with_root_kind ( & mut self , slots : Vec < VM :: VMSlot > , kind : RootKind ) {
58- let stage = self . mmtk . get_plan ( ) . root_scanning_stage ( ) ;
59- let w = CollectRoots :: new ( slots, kind) ;
57+ let lxr = self . mmtk . get_plan ( ) . downcast_ref :: < LXR < VM > > ( ) . unwrap ( ) ;
58+ let stage = lxr. root_scanning_stage ( ) ;
59+ let mut w = ProcessIncs :: < _ , EDGE_KIND_ROOT > :: new ( slots, lxr) ;
60+ w. root_kind = Some ( kind) ;
6061 crate :: memory_manager:: add_work_packet ( self . mmtk , stage, w) ;
6162 }
6263
0 commit comments