Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions gc/mmtk/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,7 @@ pub extern "C" fn mmtk_builder_default() -> *mut MMTKBuilder {
if let Some(threads) = mmtk_builder_default_parse_threads() {
if !builder.options.threads.set(threads) {
// MMTk will validate it and reject 0.
eprintln!(
"[FATAL] Failed to set the number of MMTk threads to {}",
threads
);
eprintln!("[FATAL] Failed to set the number of MMTk threads to {threads}");
std::process::exit(1);
}
}
Expand All @@ -120,10 +117,7 @@ pub extern "C" fn mmtk_builder_default() -> *mut MMTKBuilder {
let heap_max = mmtk_builder_default_parse_heap_max();

if heap_min >= heap_max {
eprintln!(
"[FATAL] MMTK_HEAP_MIN({}) >= MMTK_HEAP_MAX({})",
heap_min, heap_max
);
eprintln!("[FATAL] MMTK_HEAP_MIN({heap_min}) >= MMTK_HEAP_MAX({heap_max})");
std::process::exit(1);
}

Expand Down
2 changes: 1 addition & 1 deletion gc/mmtk/src/binding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ impl RubyBinding {
}

pub fn register_wb_unprotected_object(&self, object: ObjectReference) {
debug!("Registering WB-unprotected object: {}", object);
debug!("Registering WB-unprotected object: {object}");
let mut objects = self.wb_unprotected_objects.lock().unwrap();
objects.insert(object);
}
Expand Down
10 changes: 2 additions & 8 deletions gc/mmtk/src/collection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,7 @@ impl Collection<Ruby> for VMCollection {
.name("MMTk Worker Thread".to_string())
.spawn(move || {
let ordinal = worker.ordinal;
debug!(
"Hello! This is MMTk Worker Thread running! ordinal: {}",
ordinal
);
debug!("Hello! This is MMTk Worker Thread running! ordinal: {ordinal}");
crate::register_gc_thread(thread::current().id());
let ptr_worker = &mut *worker as *mut GCWorker<Ruby>;
let gc_thread_tls =
Expand All @@ -55,10 +52,7 @@ impl Collection<Ruby> for VMCollection {
GCThreadTLS::to_vwt(gc_thread_tls),
worker,
);
debug!(
"An MMTk Worker Thread is quitting. Good bye! ordinal: {}",
ordinal
);
debug!("An MMTk Worker Thread is quitting. Good bye! ordinal: {ordinal}");
crate::unregister_gc_thread(thread::current().id());
})
.unwrap(),
Expand Down
14 changes: 3 additions & 11 deletions gc/mmtk/src/scanning.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,7 @@ impl Scanning<Ruby> for VMScanning {
);
let forwarded_target = object_tracer.trace_object(target_object);
if forwarded_target != target_object {
trace!(
" Forwarded target {} -> {}",
target_object,
forwarded_target
);
trace!(" Forwarded target {target_object} -> {forwarded_target}");
}
forwarded_target
};
Expand Down Expand Up @@ -251,15 +247,11 @@ impl<F: RootsWorkFactory<RubySlot>> GCWork<Ruby> for ScanWbUnprotectedRoots<F> {
VMScanning::collect_object_roots_in("wb_unprot_roots", gc_tls, &mut self.factory, || {
for object in self.objects.iter().copied() {
if object.is_reachable() {
debug!(
"[wb_unprot_roots] Visiting WB-unprotected object (parent): {}",
object
);
debug!("[wb_unprot_roots] Visiting WB-unprotected object (parent): {object}");
(upcalls().scan_object_ruby_style)(object);
} else {
debug!(
"[wb_unprot_roots] Skipping young WB-unprotected object (parent): {}",
object
"[wb_unprot_roots] Skipping young WB-unprotected object (parent): {object}"
);
}
}
Expand Down
21 changes: 6 additions & 15 deletions gc/mmtk/src/weak_proc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ impl GCWork<Ruby> for ProcessObjFreeCandidates {

let n_cands = obj_free_candidates.len();

debug!("Total: {} candidates", n_cands);
debug!("Total: {n_cands} candidates");

// Process obj_free
let mut new_candidates = Vec::new();
Expand All @@ -112,11 +112,7 @@ impl GCWork<Ruby> for ProcessObjFreeCandidates {
if object.is_reachable() {
// Forward and add back to the candidate list.
let new_object = object.forward();
trace!(
"Forwarding obj_free candidate: {} -> {}",
object,
new_object
);
trace!("Forwarding obj_free candidate: {object} -> {new_object}");
new_candidates.push(new_object);
} else {
(upcalls().call_obj_free)(object);
Expand Down Expand Up @@ -158,11 +154,10 @@ trait GlobalTableProcessingWork {
let forward_object = |_worker, object: ObjectReference, _pin| {
debug_assert!(
mmtk::memory_manager::is_mmtk_object(object.to_raw_address()).is_some(),
"{} is not an MMTk object",
object
"{object} is not an MMTk object"
);
let result = object.forward();
trace!("Forwarding reference: {} -> {}", object, result);
trace!("Forwarding reference: {object} -> {result}");
result
};

Expand Down Expand Up @@ -216,14 +211,10 @@ impl GCWork<Ruby> for UpdateWbUnprotectedObjectsList {
if object.is_reachable() {
// Forward and add back to the candidate list.
let new_object = object.forward();
trace!(
"Forwarding WB-unprotected object: {} -> {}",
object,
new_object
);
trace!("Forwarding WB-unprotected object: {object} -> {new_object}");
objects.insert(new_object);
} else {
trace!("Removing WB-unprotected object from list: {}", object);
trace!("Removing WB-unprotected object from list: {object}");
}
}

Expand Down
Loading