@@ -29,7 +29,9 @@ use crate::vm::VMBinding;
29
29
use std:: cell:: UnsafeCell ;
30
30
use std:: collections:: HashMap ;
31
31
use std:: default:: Default ;
32
- use std:: sync:: atomic:: { AtomicBool , Ordering } ;
32
+ #[ cfg( feature = "sanity" ) ]
33
+ use std:: sync:: atomic:: AtomicBool ;
34
+ use std:: sync:: atomic:: Ordering ;
33
35
use std:: sync:: Arc ;
34
36
use std:: sync:: Mutex ;
35
37
@@ -123,7 +125,6 @@ pub struct MMTK<VM: VMBinding> {
123
125
pub ( crate ) gc_trigger : Arc < GCTrigger < VM > > ,
124
126
pub ( crate ) gc_requester : Arc < GCRequester < VM > > ,
125
127
pub ( crate ) stats : Arc < Stats > ,
126
- inside_harness : AtomicBool ,
127
128
#[ cfg( feature = "sanity" ) ]
128
129
inside_sanity : AtomicBool ,
129
130
/// Analysis counters. The feature analysis allows us to periodically stop the world and collect some statistics.
@@ -220,7 +221,6 @@ impl<VM: VMBinding> MMTK<VM> {
220
221
sanity_checker : Mutex :: new ( SanityChecker :: new ( ) ) ,
221
222
#[ cfg( feature = "sanity" ) ]
222
223
inside_sanity : AtomicBool :: new ( false ) ,
223
- inside_harness : AtomicBool :: new ( false ) ,
224
224
#[ cfg( feature = "extreme_assertions" ) ]
225
225
slot_logger : SlotLogger :: new ( ) ,
226
226
#[ cfg( feature = "analysis" ) ]
@@ -324,7 +324,7 @@ impl<VM: VMBinding> MMTK<VM> {
324
324
pub fn harness_begin ( & self , tls : VMMutatorThread ) {
325
325
probe ! ( mmtk, harness_begin) ;
326
326
self . handle_user_collection_request ( tls, true , true ) ;
327
- self . inside_harness . store ( true , Ordering :: SeqCst ) ;
327
+ self . state . inside_harness . store ( true , Ordering :: SeqCst ) ;
328
328
self . stats . start_all ( ) ;
329
329
self . scheduler . enable_stat ( ) ;
330
330
}
@@ -334,7 +334,7 @@ impl<VM: VMBinding> MMTK<VM> {
334
334
/// This is usually called by the benchmark harness right after the actual benchmark.
335
335
pub fn harness_end ( & ' static self ) {
336
336
self . stats . stop_all ( self ) ;
337
- self . inside_harness . store ( false , Ordering :: SeqCst ) ;
337
+ self . state . inside_harness . store ( false , Ordering :: SeqCst ) ;
338
338
probe ! ( mmtk, harness_end) ;
339
339
}
340
340
0 commit comments