From 499776558b38a94f68e4661e73bd09e6698accc7 Mon Sep 17 00:00:00 2001 From: Yi Lin Date: Thu, 10 Aug 2023 00:18:17 +1200 Subject: [PATCH] Update to MMTk core PR #875 (#86) Update to https://github.com/mmtk/mmtk-core/pull/875. --- mmtk/Cargo.lock | 15 +++++++++++---- mmtk/Cargo.toml | 2 +- mmtk/src/collection.rs | 18 ++++++++++-------- mmtk/src/scanning.rs | 8 -------- 4 files changed, 22 insertions(+), 21 deletions(-) diff --git a/mmtk/Cargo.lock b/mmtk/Cargo.lock index 14e94783..8a3d6e74 100644 --- a/mmtk/Cargo.lock +++ b/mmtk/Cargo.lock @@ -473,7 +473,7 @@ dependencies = [ [[package]] name = "mmtk" version = "0.18.0" -source = "git+https://github.com/mmtk/mmtk-core.git?rev=47ee126f91f25b911498b3d49c35f672f5e935f9#47ee126f91f25b911498b3d49c35f672f5e935f9" +source = "git+https://github.com/mmtk/mmtk-core.git?rev=04a47feb4598b2120598453c2cceec83986c2122#04a47feb4598b2120598453c2cceec83986c2122" dependencies = [ "atomic 0.5.3", "atomic-traits", @@ -493,6 +493,7 @@ dependencies = [ "mmtk-macros", "num-traits", "num_cpus", + "probe", "regex", "spin", "static_assertions", @@ -519,7 +520,7 @@ dependencies = [ [[package]] name = "mmtk-macros" version = "0.18.0" -source = "git+https://github.com/mmtk/mmtk-core.git?rev=47ee126f91f25b911498b3d49c35f672f5e935f9#47ee126f91f25b911498b3d49c35f672f5e935f9" +source = "git+https://github.com/mmtk/mmtk-core.git?rev=04a47feb4598b2120598453c2cceec83986c2122#04a47feb4598b2120598453c2cceec83986c2122" dependencies = [ "proc-macro-error", "proc-macro2", @@ -583,6 +584,12 @@ version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" +[[package]] +name = "probe" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "216e81fcf486280f0b8b18ca43ceafd32739eb0eb703eb024a8d00814eeba556" + [[package]] name = "proc-macro-error" version = "1.0.4" @@ -816,9 +823,9 @@ dependencies = [ [[package]] name = "sysinfo" -version = "0.29.6" +version = "0.29.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7cb97a5a85a136d84e75d5c3cf89655090602efb1be0d8d5337b7e386af2908" +checksum = "6b949f01f9c23823744b71e0060472ecbde578ef68cc2a9e46d114efd77c3034" dependencies = [ "cfg-if", "core-foundation-sys", diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index 6e4399a0..a72b243f 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -31,7 +31,7 @@ lazy_static = "1.1" # - change branch # - change repo name # But other changes including adding/removing whitespaces in commented lines may break the CI -mmtk = { git = "https://github.com/mmtk/mmtk-core.git", rev = "47ee126f91f25b911498b3d49c35f672f5e935f9" } +mmtk = { git = "https://github.com/mmtk/mmtk-core.git", rev = "04a47feb4598b2120598453c2cceec83986c2122" } # Uncomment the following to build locally # mmtk = { path = "../repos/mmtk-core" } log = {version = "0.4", features = ["max_level_trace", "release_max_level_off"] } diff --git a/mmtk/src/collection.rs b/mmtk/src/collection.rs index b6343e05..12a965d7 100644 --- a/mmtk/src/collection.rs +++ b/mmtk/src/collection.rs @@ -15,7 +15,7 @@ static GC_START: AtomicU64 = AtomicU64::new(0); pub struct VMCollection {} impl Collection for VMCollection { - fn stop_all_mutators(_tls: VMWorkerThread, _mutator_visitor: F) + fn stop_all_mutators(_tls: VMWorkerThread, mut mutator_visitor: F) where F: FnMut(&'static mut Mutator), { @@ -27,6 +27,15 @@ impl Collection for VMCollection { trace!("Stopped the world!"); + // Tell MMTk the stacks are ready. + { + use mmtk::vm::ActivePlan; + for mutator in crate::active_plan::VMActivePlan::mutators() { + info!("stop_all_mutators: visiting {:?}", mutator.mutator_tls); + mutator_visitor(mutator); + } + } + // Record the start time of the GC let now = unsafe { ((*UPCALLS).jl_hrtime)() }; trace!("gc_start = {}", now); @@ -130,13 +139,6 @@ impl Collection for VMCollection { unsafe { ((*UPCALLS).jl_throw_out_of_memory_error)() }; } - fn prepare_mutator>( - _tls_w: VMWorkerThread, - _tls_m: VMMutatorThread, - _mutator: &T, - ) { - } - fn vm_live_bytes() -> usize { crate::api::JULIA_MALLOC_BYTES.load(Ordering::SeqCst) } diff --git a/mmtk/src/scanning.rs b/mmtk/src/scanning.rs index 9a440e2e..30dcceee 100644 --- a/mmtk/src/scanning.rs +++ b/mmtk/src/scanning.rs @@ -20,19 +20,11 @@ use std::sync::MutexGuard; pub struct VMScanning {} impl Scanning for VMScanning { - fn scan_roots_in_all_mutator_threads( - _tls: VMWorkerThread, - _factory: impl RootsWorkFactory, - ) { - // Thread roots are collected by Julia before stopping the world - } - fn scan_roots_in_mutator_thread( _tls: VMWorkerThread, _mutator: &'static mut Mutator, _factory: impl RootsWorkFactory, ) { - unimplemented!() } fn scan_vm_specific_roots( _tls: VMWorkerThread,