@@ -297,7 +297,7 @@ impl<E: ProcessEdgesWork> ProcessEdgesWorkTracer<E> {
297
297
fn flush ( & mut self ) {
298
298
let next_nodes = self . process_edges_work . pop_nodes ( ) ;
299
299
assert ! ( !next_nodes. is_empty( ) ) ;
300
- let work_packet = self . process_edges_work . create_scan_work ( next_nodes, false ) ;
300
+ let work_packet = self . process_edges_work . create_scan_work ( next_nodes) ;
301
301
let worker = self . process_edges_work . worker ( ) ;
302
302
worker. scheduler ( ) . work_buckets [ self . stage ] . add ( work_packet) ;
303
303
}
@@ -641,18 +641,14 @@ pub trait ProcessEdgesWork:
641
641
///
642
642
/// `roots` indicates if we are creating a packet for root scanning. It is only true when this
643
643
/// method is called to handle `RootsWorkFactory::create_process_pinning_roots_work`.
644
- fn create_scan_work (
645
- & self ,
646
- nodes : Vec < ObjectReference > ,
647
- roots : bool ,
648
- ) -> Self :: ScanObjectsWorkType ;
644
+ fn create_scan_work ( & self , nodes : Vec < ObjectReference > ) -> Self :: ScanObjectsWorkType ;
649
645
650
646
/// Flush the nodes in ProcessEdgesBase, and create a ScanObjects work packet for it. If the node set is empty,
651
647
/// this method will simply return with no work packet created.
652
648
fn flush ( & mut self ) {
653
649
let nodes = self . pop_nodes ( ) ;
654
650
if !nodes. is_empty ( ) {
655
- self . start_or_dispatch_scan_work ( self . create_scan_work ( nodes, false ) ) ;
651
+ self . start_or_dispatch_scan_work ( self . create_scan_work ( nodes) ) ;
656
652
}
657
653
}
658
654
@@ -732,8 +728,8 @@ impl<VM: VMBinding> ProcessEdgesWork for SFTProcessEdges<VM> {
732
728
sft. sft_trace_object ( & mut self . base . nodes , object, worker)
733
729
}
734
730
735
- fn create_scan_work ( & self , nodes : Vec < ObjectReference > , roots : bool ) -> ScanObjects < Self > {
736
- ScanObjects :: < Self > :: new ( nodes, false , roots , self . bucket )
731
+ fn create_scan_work ( & self , nodes : Vec < ObjectReference > ) -> ScanObjects < Self > {
732
+ ScanObjects :: < Self > :: new ( nodes, false , self . bucket )
737
733
}
738
734
}
739
735
pub ( crate ) struct ProcessEdgesWorkRootsWorkFactory <
@@ -815,10 +811,6 @@ pub trait ScanObjectsWork<VM: VMBinding>: GCWork<VM> + Sized {
815
811
/// The associated ProcessEdgesWork for processing the edges of the objects in this packet.
816
812
type E : ProcessEdgesWork < VM = VM > ;
817
813
818
- /// Return true if the objects in this packet are pointed by roots, in which case we need to
819
- /// call trace_object on them.
820
- fn roots ( & self ) -> bool ;
821
-
822
814
/// Called after each object is scanned.
823
815
fn post_scan_object ( & self , object : ObjectReference ) ;
824
816
@@ -836,7 +828,6 @@ pub trait ScanObjectsWork<VM: VMBinding>: GCWork<VM> + Sized {
836
828
_mmtk : & ' static MMTK < <Self :: E as ProcessEdgesWork >:: VM > ,
837
829
) {
838
830
let tls = worker. tls ;
839
- debug_assert ! ( !self . roots( ) ) ;
840
831
841
832
// Scan the nodes in the buffer.
842
833
let objects_to_scan = buffer;
@@ -904,22 +895,15 @@ pub struct ScanObjects<Edges: ProcessEdgesWork> {
904
895
buffer : Vec < ObjectReference > ,
905
896
#[ allow( unused) ]
906
897
concurrent : bool ,
907
- roots : bool ,
908
898
phantom : PhantomData < Edges > ,
909
899
bucket : WorkBucketStage ,
910
900
}
911
901
912
902
impl < Edges : ProcessEdgesWork > ScanObjects < Edges > {
913
- pub fn new (
914
- buffer : Vec < ObjectReference > ,
915
- concurrent : bool ,
916
- roots : bool ,
917
- bucket : WorkBucketStage ,
918
- ) -> Self {
903
+ pub fn new ( buffer : Vec < ObjectReference > , concurrent : bool , bucket : WorkBucketStage ) -> Self {
919
904
Self {
920
905
buffer,
921
906
concurrent,
922
- roots,
923
907
phantom : PhantomData ,
924
908
bucket,
925
909
}
@@ -929,10 +913,6 @@ impl<Edges: ProcessEdgesWork> ScanObjects<Edges> {
929
913
impl < VM : VMBinding , E : ProcessEdgesWork < VM = VM > > ScanObjectsWork < VM > for ScanObjects < E > {
930
914
type E = E ;
931
915
932
- fn roots ( & self ) -> bool {
933
- self . roots
934
- }
935
-
936
916
fn get_bucket ( & self ) -> WorkBucketStage {
937
917
self . bucket
938
918
}
@@ -942,7 +922,7 @@ impl<VM: VMBinding, E: ProcessEdgesWork<VM = VM>> ScanObjectsWork<VM> for ScanOb
942
922
}
943
923
944
924
fn make_another ( & self , buffer : Vec < ObjectReference > ) -> Self {
945
- Self :: new ( buffer, self . concurrent , false , self . bucket )
925
+ Self :: new ( buffer, self . concurrent , self . bucket )
946
926
}
947
927
}
948
928
@@ -987,12 +967,8 @@ impl<VM: VMBinding, P: PlanTraceObject<VM> + Plan<VM = VM>, const KIND: TraceKin
987
967
Self { plan, base }
988
968
}
989
969
990
- fn create_scan_work (
991
- & self ,
992
- nodes : Vec < ObjectReference > ,
993
- roots : bool ,
994
- ) -> Self :: ScanObjectsWorkType {
995
- PlanScanObjects :: < Self , P > :: new ( self . plan , nodes, false , roots, self . bucket )
970
+ fn create_scan_work ( & self , nodes : Vec < ObjectReference > ) -> Self :: ScanObjectsWorkType {
971
+ PlanScanObjects :: < Self , P > :: new ( self . plan , nodes, false , self . bucket )
996
972
}
997
973
998
974
fn trace_object ( & mut self , object : ObjectReference ) -> ObjectReference {
@@ -1041,7 +1017,6 @@ pub struct PlanScanObjects<E: ProcessEdgesWork, P: Plan<VM = E::VM> + PlanTraceO
1041
1017
buffer : Vec < ObjectReference > ,
1042
1018
#[ allow( dead_code) ]
1043
1019
concurrent : bool ,
1044
- roots : bool ,
1045
1020
phantom : PhantomData < E > ,
1046
1021
bucket : WorkBucketStage ,
1047
1022
}
@@ -1051,14 +1026,12 @@ impl<E: ProcessEdgesWork, P: Plan<VM = E::VM> + PlanTraceObject<E::VM>> PlanScan
1051
1026
plan : & ' static P ,
1052
1027
buffer : Vec < ObjectReference > ,
1053
1028
concurrent : bool ,
1054
- roots : bool ,
1055
1029
bucket : WorkBucketStage ,
1056
1030
) -> Self {
1057
1031
Self {
1058
1032
plan,
1059
1033
buffer,
1060
1034
concurrent,
1061
- roots,
1062
1035
phantom : PhantomData ,
1063
1036
bucket,
1064
1037
}
@@ -1070,10 +1043,6 @@ impl<E: ProcessEdgesWork, P: Plan<VM = E::VM> + PlanTraceObject<E::VM>> ScanObje
1070
1043
{
1071
1044
type E = E ;
1072
1045
1073
- fn roots ( & self ) -> bool {
1074
- self . roots
1075
- }
1076
-
1077
1046
fn get_bucket ( & self ) -> WorkBucketStage {
1078
1047
self . bucket
1079
1048
}
@@ -1083,7 +1052,7 @@ impl<E: ProcessEdgesWork, P: Plan<VM = E::VM> + PlanTraceObject<E::VM>> ScanObje
1083
1052
}
1084
1053
1085
1054
fn make_another ( & self , buffer : Vec < ObjectReference > ) -> Self {
1086
- Self :: new ( self . plan , buffer, self . concurrent , false , self . bucket )
1055
+ Self :: new ( self . plan , buffer, self . concurrent , self . bucket )
1087
1056
}
1088
1057
}
1089
1058
@@ -1101,7 +1070,11 @@ impl<E: ProcessEdgesWork, P: Plan<VM = E::VM> + PlanTraceObject<E::VM>> GCWork<E
1101
1070
/// but creates the work to scan these objects using E. This is necessary to guarantee that these objects do not move
1102
1071
/// (`I` should trace them without moving) as we do not have the information about the edges pointing to them.
1103
1072
1104
- struct ProcessRootNode < VM : VMBinding , I : ProcessEdgesWork < VM = VM > , E : ProcessEdgesWork < VM = VM > > {
1073
+ pub ( crate ) struct ProcessRootNode <
1074
+ VM : VMBinding ,
1075
+ I : ProcessEdgesWork < VM = VM > ,
1076
+ E : ProcessEdgesWork < VM = VM > ,
1077
+ > {
1105
1078
phantom : PhantomData < ( VM , I , E ) > ,
1106
1079
roots : Vec < ObjectReference > ,
1107
1080
bucket : WorkBucketStage ,
@@ -1165,7 +1138,7 @@ impl<VM: VMBinding, I: ProcessEdgesWork<VM = VM>, E: ProcessEdgesWork<VM = VM>>
1165
1138
} ;
1166
1139
1167
1140
let process_edges_work = E :: new ( vec ! [ ] , false , mmtk, self . bucket ) ;
1168
- let work = process_edges_work. create_scan_work ( scanned_root_objects, false ) ;
1141
+ let work = process_edges_work. create_scan_work ( scanned_root_objects) ;
1169
1142
crate :: memory_manager:: add_work_packet ( mmtk, self . bucket , work) ;
1170
1143
1171
1144
trace ! ( "ProcessRootNode End" ) ;
@@ -1210,11 +1183,7 @@ impl<VM: VMBinding> ProcessEdgesWork for UnsupportedProcessEdges<VM> {
1210
1183
panic ! ( "unsupported!" )
1211
1184
}
1212
1185
1213
- fn create_scan_work (
1214
- & self ,
1215
- _nodes : Vec < ObjectReference > ,
1216
- _roots : bool ,
1217
- ) -> Self :: ScanObjectsWorkType {
1186
+ fn create_scan_work ( & self , _nodes : Vec < ObjectReference > ) -> Self :: ScanObjectsWorkType {
1218
1187
panic ! ( "unsupported!" )
1219
1188
}
1220
1189
}
0 commit comments