@@ -191,41 +191,35 @@ impl<ScanEdges: ProcessEdgesWork> StopMutators<ScanEdges> {
191191
192192impl < E : ProcessEdgesWork > GCWork < E :: VM > for StopMutators < E > {
193193 fn do_work ( & mut self , worker : & mut GCWorker < E :: VM > , mmtk : & ' static MMTK < E :: VM > ) {
194- if worker. is_coordinator ( ) {
195- trace ! ( "stop_all_mutators start" ) ;
196- debug_assert_eq ! ( mmtk. plan. base( ) . scanned_stacks. load( Ordering :: SeqCst ) , 0 ) ;
197- <E :: VM as VMBinding >:: VMCollection :: stop_all_mutators :: < E > ( worker. tls ) ;
198- trace ! ( "stop_all_mutators end" ) ;
199- mmtk. scheduler . notify_mutators_paused ( mmtk) ;
200- if <E :: VM as VMBinding >:: VMScanning :: SCAN_MUTATORS_IN_SAFEPOINT {
201- // Prepare mutators if necessary
202- // FIXME: This test is probably redundant. JikesRVM requires to call `prepare_mutator` once after mutators are paused
203- if !mmtk. plan . base ( ) . stacks_prepared ( ) {
204- for mutator in <E :: VM as VMBinding >:: VMActivePlan :: mutators ( ) {
205- <E :: VM as VMBinding >:: VMCollection :: prepare_mutator (
206- worker. tls ,
207- mutator. get_tls ( ) ,
208- mutator,
209- ) ;
210- }
194+ trace ! ( "stop_all_mutators start" ) ;
195+ debug_assert_eq ! ( mmtk. plan. base( ) . scanned_stacks. load( Ordering :: SeqCst ) , 0 ) ;
196+ <E :: VM as VMBinding >:: VMCollection :: stop_all_mutators :: < E > ( worker. tls ) ;
197+ trace ! ( "stop_all_mutators end" ) ;
198+ mmtk. scheduler . notify_mutators_paused ( mmtk) ;
199+ if <E :: VM as VMBinding >:: VMScanning :: SCAN_MUTATORS_IN_SAFEPOINT {
200+ // Prepare mutators if necessary
201+ // FIXME: This test is probably redundant. JikesRVM requires to call `prepare_mutator` once after mutators are paused
202+ if !mmtk. plan . base ( ) . stacks_prepared ( ) {
203+ for mutator in <E :: VM as VMBinding >:: VMActivePlan :: mutators ( ) {
204+ <E :: VM as VMBinding >:: VMCollection :: prepare_mutator (
205+ worker. tls ,
206+ mutator. get_tls ( ) ,
207+ mutator,
208+ ) ;
211209 }
212- // Scan mutators
213- if <E :: VM as VMBinding >:: VMScanning :: SINGLE_THREAD_MUTATOR_SCANNING {
210+ }
211+ // Scan mutators
212+ if <E :: VM as VMBinding >:: VMScanning :: SINGLE_THREAD_MUTATOR_SCANNING {
213+ mmtk. scheduler . work_buckets [ WorkBucketStage :: Prepare ]
214+ . add ( ScanStackRoots :: < E > :: new ( ) ) ;
215+ } else {
216+ for mutator in <E :: VM as VMBinding >:: VMActivePlan :: mutators ( ) {
214217 mmtk. scheduler . work_buckets [ WorkBucketStage :: Prepare ]
215- . add ( ScanStackRoots :: < E > :: new ( ) ) ;
216- } else {
217- for mutator in <E :: VM as VMBinding >:: VMActivePlan :: mutators ( ) {
218- mmtk. scheduler . work_buckets [ WorkBucketStage :: Prepare ]
219- . add ( ScanStackRoot :: < E > ( mutator) ) ;
220- }
218+ . add ( ScanStackRoot :: < E > ( mutator) ) ;
221219 }
222220 }
223- mmtk. scheduler . work_buckets [ WorkBucketStage :: Prepare ]
224- . add ( ScanVMSpecificRoots :: < E > :: new ( ) ) ;
225- } else {
226- mmtk. scheduler
227- . add_coordinator_work ( StopMutators :: < E > :: new ( ) , worker) ;
228221 }
222+ mmtk. scheduler . work_buckets [ WorkBucketStage :: Prepare ] . add ( ScanVMSpecificRoots :: < E > :: new ( ) ) ;
229223 }
230224}
231225
0 commit comments