@@ -20,6 +20,7 @@ use crate::scheduler::{GCWork, GCWorker};
2020use crate :: util:: alloc:: allocators:: AllocatorSelector ;
2121use crate :: util:: constants:: { LOG_BYTES_IN_PAGE , MIN_OBJECT_SIZE } ;
2222use crate :: util:: heap:: layout:: vm_layout:: vm_layout;
23+ use crate :: util:: log;
2324use crate :: util:: opaque_pointer:: * ;
2425use crate :: util:: { Address , ObjectReference } ;
2526use crate :: vm:: slot:: MemorySlice ;
@@ -52,8 +53,8 @@ use crate::vm::VMBinding;
5253/// * `builder`: The reference to a MMTk builder.
5354pub fn mmtk_init < VM : VMBinding > ( builder : & MMTKBuilder ) -> Box < MMTK < VM > > {
5455 match crate :: util:: logger:: try_init ( ) {
55- Ok ( _) => debug ! ( "MMTk initialized the logger." ) ,
56- Err ( _) => debug ! (
56+ Ok ( _) => log :: debug!( "MMTk initialized the logger." ) ,
57+ Err ( _) => log :: debug!(
5758 "MMTk failed to initialize the logger. Possibly a logger has been initialized by user."
5859 ) ,
5960 }
@@ -69,19 +70,20 @@ pub fn mmtk_init<VM: VMBinding>(builder: &MMTKBuilder) -> Box<MMTK<VM>> {
6970 if split[ 0 ] == "Threads:" {
7071 let threads = split[ 1 ] . parse :: < i32 > ( ) . unwrap ( ) ;
7172 if threads != 1 {
72- warn ! ( "Current process has {} threads, process-wide perf event measurement will only include child threads spawned from this thread" , threads) ;
73+ log :: warn!( "Current process has {} threads, process-wide perf event measurement will only include child threads spawned from this thread" , threads) ;
7374 }
7475 }
7576 }
7677 }
7778 let mmtk = builder. build ( ) ;
7879
79- info ! (
80+ log :: info!(
8081 "Initialized MMTk with {:?} ({:?})" ,
81- * mmtk. options. plan, * mmtk. options. gc_trigger
82+ * mmtk. options. plan,
83+ * mmtk. options. gc_trigger
8284 ) ;
8385 #[ cfg( feature = "extreme_assertions" ) ]
84- warn ! ( "The feature 'extreme_assertions' is enabled. MMTk will run expensive run-time checks. Slow performance should be expected." ) ;
86+ log :: warn!( "The feature 'extreme_assertions' is enabled. MMTk will run expensive run-time checks. Slow performance should be expected." ) ;
8587 Box :: new ( mmtk)
8688}
8789
@@ -115,7 +117,7 @@ pub fn bind_mutator<VM: VMBinding>(
115117
116118 const LOG_ALLOCATOR_MAPPING : bool = false ;
117119 if LOG_ALLOCATOR_MAPPING {
118- info ! ( "{:?}" , mutator. config) ;
120+ log :: info!( "{:?}" , mutator. config) ;
119121 }
120122 mutator
121123}
@@ -477,7 +479,7 @@ pub fn gc_poll<VM: VMBinding>(mmtk: &MMTK<VM>, tls: VMMutatorThread) {
477479 ) ;
478480
479481 if VM :: VMCollection :: is_collection_enabled ( ) && mmtk. gc_trigger . poll ( false , None ) {
480- debug ! ( "Collection required" ) ;
482+ log :: debug!( "Collection required" ) ;
481483 assert ! ( mmtk. state. is_initialized( ) , "GC is not allowed here: collection is not initialized (did you call initialize_collection()?)." ) ;
482484 VM :: VMCollection :: block_for_gc ( tls) ;
483485 }
@@ -764,7 +766,7 @@ pub fn add_finalizer<VM: VMBinding>(
764766 object : <VM :: VMReferenceGlue as ReferenceGlue < VM > >:: FinalizableType ,
765767) {
766768 if * mmtk. options . no_finalizer {
767- warn ! ( "add_finalizer() is called when no_finalizer = true" ) ;
769+ log :: warn!( "add_finalizer() is called when no_finalizer = true" ) ;
768770 }
769771
770772 mmtk. finalizable_processor . lock ( ) . unwrap ( ) . add ( object) ;
@@ -823,7 +825,7 @@ pub fn get_finalized_object<VM: VMBinding>(
823825 mmtk : & ' static MMTK < VM > ,
824826) -> Option < <VM :: VMReferenceGlue as ReferenceGlue < VM > >:: FinalizableType > {
825827 if * mmtk. options . no_finalizer {
826- warn ! ( "get_finalized_object() is called when no_finalizer = true" ) ;
828+ log :: warn!( "get_finalized_object() is called when no_finalizer = true" ) ;
827829 }
828830
829831 mmtk. finalizable_processor
@@ -843,7 +845,7 @@ pub fn get_all_finalizers<VM: VMBinding>(
843845 mmtk : & ' static MMTK < VM > ,
844846) -> Vec < <VM :: VMReferenceGlue as ReferenceGlue < VM > >:: FinalizableType > {
845847 if * mmtk. options . no_finalizer {
846- warn ! ( "get_all_finalizers() is called when no_finalizer = true" ) ;
848+ log :: warn!( "get_all_finalizers() is called when no_finalizer = true" ) ;
847849 }
848850
849851 mmtk. finalizable_processor
@@ -863,7 +865,7 @@ pub fn get_finalizers_for<VM: VMBinding>(
863865 object : ObjectReference ,
864866) -> Vec < <VM :: VMReferenceGlue as ReferenceGlue < VM > >:: FinalizableType > {
865867 if * mmtk. options . no_finalizer {
866- warn ! ( "get_finalizers() is called when no_finalizer = true" ) ;
868+ log :: warn!( "get_finalizers() is called when no_finalizer = true" ) ;
867869 }
868870
869871 mmtk. finalizable_processor
0 commit comments