diff --git a/.github/workflows/merge-check.yml b/.github/workflows/merge-check.yml index a06d8b2992..ec5e7735d1 100644 --- a/.github/workflows/merge-check.yml +++ b/.github/workflows/merge-check.yml @@ -25,3 +25,9 @@ jobs: checkInterval: 600 env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + - name: Check result + if: ${{ steps.waitforstatuschecks.outputs.status != 'success' }} + uses: actions/github-script@v3 + with: + script: | + core.setFailed('Status checks failed') diff --git a/docs/userguide/src/tutorial/code/mygc_semispace/gc_work.rs b/docs/userguide/src/tutorial/code/mygc_semispace/gc_work.rs index f80ff56f9a..a4818fbbe4 100644 --- a/docs/userguide/src/tutorial/code/mygc_semispace/gc_work.rs +++ b/docs/userguide/src/tutorial/code/mygc_semispace/gc_work.rs @@ -78,8 +78,8 @@ impl ProcessEdgesWork for MyGCProcessEdges { } } - fn create_scan_work(&self, nodes: Vec, roots: bool) -> ScanObjects { - ScanObjects::::new(nodes, false, roots, self.bucket) + fn create_scan_work(&self, nodes: Vec) -> ScanObjects { + ScanObjects::::new(nodes, false, self.bucket) } } // ANCHOR_END: mygc_process_edges_impl diff --git a/src/plan/generational/gc_work.rs b/src/plan/generational/gc_work.rs index 3a01b3bcd4..5ebd7cf8f1 100644 --- a/src/plan/generational/gc_work.rs +++ b/src/plan/generational/gc_work.rs @@ -57,12 +57,8 @@ impl + PlanTraceObject> ProcessEdg } } - fn create_scan_work( - &self, - nodes: Vec, - roots: bool, - ) -> Self::ScanObjectsWorkType { - PlanScanObjects::new(self.plan, nodes, false, roots, self.bucket) + fn create_scan_work(&self, nodes: Vec) -> Self::ScanObjectsWorkType { + PlanScanObjects::new(self.plan, nodes, false, self.bucket) } } @@ -122,7 +118,7 @@ impl GCWork for ProcessModBuf { // Scan objects in the modbuf and forward pointers let modbuf = std::mem::take(&mut self.modbuf); GCWork::do_work( - &mut ScanObjects::::new(modbuf, false, false, WorkBucketStage::Closure), + &mut ScanObjects::::new(modbuf, false, WorkBucketStage::Closure), worker, mmtk, ) diff --git a/src/scheduler/gc_work.rs b/src/scheduler/gc_work.rs index 692873eb84..8cf4c74bee 100644 --- a/src/scheduler/gc_work.rs +++ b/src/scheduler/gc_work.rs @@ -297,7 +297,7 @@ impl ProcessEdgesWorkTracer { fn flush(&mut self) { let next_nodes = self.process_edges_work.pop_nodes(); assert!(!next_nodes.is_empty()); - let work_packet = self.process_edges_work.create_scan_work(next_nodes, false); + let work_packet = self.process_edges_work.create_scan_work(next_nodes); let worker = self.process_edges_work.worker(); worker.scheduler().work_buckets[self.stage].add(work_packet); } @@ -641,18 +641,14 @@ pub trait ProcessEdgesWork: /// /// `roots` indicates if we are creating a packet for root scanning. It is only true when this /// method is called to handle `RootsWorkFactory::create_process_pinning_roots_work`. - fn create_scan_work( - &self, - nodes: Vec, - roots: bool, - ) -> Self::ScanObjectsWorkType; + fn create_scan_work(&self, nodes: Vec) -> Self::ScanObjectsWorkType; /// Flush the nodes in ProcessEdgesBase, and create a ScanObjects work packet for it. If the node set is empty, /// this method will simply return with no work packet created. fn flush(&mut self) { let nodes = self.pop_nodes(); if !nodes.is_empty() { - self.start_or_dispatch_scan_work(self.create_scan_work(nodes, false)); + self.start_or_dispatch_scan_work(self.create_scan_work(nodes)); } } @@ -732,8 +728,8 @@ impl ProcessEdgesWork for SFTProcessEdges { sft.sft_trace_object(&mut self.base.nodes, object, worker) } - fn create_scan_work(&self, nodes: Vec, roots: bool) -> ScanObjects { - ScanObjects::::new(nodes, false, roots, self.bucket) + fn create_scan_work(&self, nodes: Vec) -> ScanObjects { + ScanObjects::::new(nodes, false, self.bucket) } } pub(crate) struct ProcessEdgesWorkRootsWorkFactory< @@ -815,10 +811,6 @@ pub trait ScanObjectsWork: GCWork + Sized { /// The associated ProcessEdgesWork for processing the edges of the objects in this packet. type E: ProcessEdgesWork; - /// Return true if the objects in this packet are pointed by roots, in which case we need to - /// call trace_object on them. - fn roots(&self) -> bool; - /// Called after each object is scanned. fn post_scan_object(&self, object: ObjectReference); @@ -836,7 +828,6 @@ pub trait ScanObjectsWork: GCWork + Sized { _mmtk: &'static MMTK<::VM>, ) { let tls = worker.tls; - debug_assert!(!self.roots()); // Scan the nodes in the buffer. let objects_to_scan = buffer; @@ -904,22 +895,15 @@ pub struct ScanObjects { buffer: Vec, #[allow(unused)] concurrent: bool, - roots: bool, phantom: PhantomData, bucket: WorkBucketStage, } impl ScanObjects { - pub fn new( - buffer: Vec, - concurrent: bool, - roots: bool, - bucket: WorkBucketStage, - ) -> Self { + pub fn new(buffer: Vec, concurrent: bool, bucket: WorkBucketStage) -> Self { Self { buffer, concurrent, - roots, phantom: PhantomData, bucket, } @@ -929,10 +913,6 @@ impl ScanObjects { impl> ScanObjectsWork for ScanObjects { type E = E; - fn roots(&self) -> bool { - self.roots - } - fn get_bucket(&self) -> WorkBucketStage { self.bucket } @@ -942,7 +922,7 @@ impl> ScanObjectsWork for ScanOb } fn make_another(&self, buffer: Vec) -> Self { - Self::new(buffer, self.concurrent, false, self.bucket) + Self::new(buffer, self.concurrent, self.bucket) } } @@ -987,12 +967,8 @@ impl + Plan, const KIND: TraceKin Self { plan, base } } - fn create_scan_work( - &self, - nodes: Vec, - roots: bool, - ) -> Self::ScanObjectsWorkType { - PlanScanObjects::::new(self.plan, nodes, false, roots, self.bucket) + fn create_scan_work(&self, nodes: Vec) -> Self::ScanObjectsWorkType { + PlanScanObjects::::new(self.plan, nodes, false, self.bucket) } fn trace_object(&mut self, object: ObjectReference) -> ObjectReference { @@ -1041,7 +1017,6 @@ pub struct PlanScanObjects + PlanTraceO buffer: Vec, #[allow(dead_code)] concurrent: bool, - roots: bool, phantom: PhantomData, bucket: WorkBucketStage, } @@ -1051,14 +1026,12 @@ impl + PlanTraceObject> PlanScan plan: &'static P, buffer: Vec, concurrent: bool, - roots: bool, bucket: WorkBucketStage, ) -> Self { Self { plan, buffer, concurrent, - roots, phantom: PhantomData, bucket, } @@ -1070,10 +1043,6 @@ impl + PlanTraceObject> ScanObje { type E = E; - fn roots(&self) -> bool { - self.roots - } - fn get_bucket(&self) -> WorkBucketStage { self.bucket } @@ -1083,7 +1052,7 @@ impl + PlanTraceObject> ScanObje } fn make_another(&self, buffer: Vec) -> Self { - Self::new(self.plan, buffer, self.concurrent, false, self.bucket) + Self::new(self.plan, buffer, self.concurrent, self.bucket) } } @@ -1101,7 +1070,11 @@ impl + PlanTraceObject> GCWork, E: ProcessEdgesWork> { +pub(crate) struct ProcessRootNode< + VM: VMBinding, + I: ProcessEdgesWork, + E: ProcessEdgesWork, +> { phantom: PhantomData<(VM, I, E)>, roots: Vec, bucket: WorkBucketStage, @@ -1165,7 +1138,7 @@ impl, E: ProcessEdgesWork> }; let process_edges_work = E::new(vec![], false, mmtk, self.bucket); - let work = process_edges_work.create_scan_work(scanned_root_objects, false); + let work = process_edges_work.create_scan_work(scanned_root_objects); crate::memory_manager::add_work_packet(mmtk, self.bucket, work); trace!("ProcessRootNode End"); @@ -1210,11 +1183,7 @@ impl ProcessEdgesWork for UnsupportedProcessEdges { panic!("unsupported!") } - fn create_scan_work( - &self, - _nodes: Vec, - _roots: bool, - ) -> Self::ScanObjectsWorkType { + fn create_scan_work(&self, _nodes: Vec) -> Self::ScanObjectsWorkType { panic!("unsupported!") } } diff --git a/src/util/sanity/sanity_checker.rs b/src/util/sanity/sanity_checker.rs index c3436470d8..069dc93808 100644 --- a/src/util/sanity/sanity_checker.rs +++ b/src/util/sanity/sanity_checker.rs @@ -96,12 +96,12 @@ impl GCWork for ScheduleSanityGC

{ ); } for roots in &sanity_checker.root_nodes { - scheduler.work_buckets[WorkBucketStage::Closure].add(ScanObjects::< + scheduler.work_buckets[WorkBucketStage::Closure].add(ProcessRootNode::< + P::VM, + SanityGCProcessEdges, SanityGCProcessEdges, >::new( roots.clone(), - false, - true, WorkBucketStage::Closure, )); } @@ -132,14 +132,6 @@ impl GCWork for SanityPrepare

{ let mut sanity_checker = mmtk.sanity_checker.lock().unwrap(); sanity_checker.refs.clear(); } - for mutator in ::VMActivePlan::mutators() { - mmtk.scheduler.work_buckets[WorkBucketStage::Prepare] - .add(PrepareMutator::::new(mutator)); - } - for w in &mmtk.scheduler.worker_group.workers_shared { - let result = w.designated_work.push(Box::new(PrepareCollector)); - debug_assert!(result.is_ok()); - } } } @@ -157,14 +149,6 @@ impl GCWork for SanityRelease

{ fn do_work(&mut self, _worker: &mut GCWorker, mmtk: &'static MMTK) { info!("Sanity GC release"); mmtk.sanity_checker.lock().unwrap().clear_roots_cache(); - for mutator in ::VMActivePlan::mutators() { - mmtk.scheduler.work_buckets[WorkBucketStage::Release] - .add(ReleaseMutator::::new(mutator)); - } - for w in &mmtk.scheduler.worker_group.workers_shared { - let result = w.designated_work.push(Box::new(ReleaseCollector)); - debug_assert!(result.is_ok()); - } mmtk.sanity_end(); } } @@ -243,11 +227,7 @@ impl ProcessEdgesWork for SanityGCProcessEdges { object } - fn create_scan_work( - &self, - nodes: Vec, - roots: bool, - ) -> Self::ScanObjectsWorkType { - ScanObjects::::new(nodes, false, roots, WorkBucketStage::Closure) + fn create_scan_work(&self, nodes: Vec) -> Self::ScanObjectsWorkType { + ScanObjects::::new(nodes, false, WorkBucketStage::Closure) } }