diff --git a/mmtk/Cargo.lock b/mmtk/Cargo.lock index ef65098..ae062ac 100644 --- a/mmtk/Cargo.lock +++ b/mmtk/Cargo.lock @@ -13,9 +13,12 @@ dependencies = [ [[package]] name = "atomic" -version = "0.5.3" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59bdb34bc650a32731b31bd8f0829cc15d24a708ee31559e0bb34f2bc320cba" +checksum = "8d818003e740b63afc82337e3160717f4f63078720a810b7b903e70a5d1d2994" +dependencies = [ + "bytemuck", +] [[package]] name = "atomic-traits" @@ -39,12 +42,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - [[package]] name = "bitflags" version = "2.4.0" @@ -53,24 +50,31 @@ checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" [[package]] name = "built" -version = "0.6.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96f9cdd34d6eb553f9ea20e5bf84abb7b13c729f113fc1d8e49dc00ad9fa8738" +checksum = "38d17f4d6e4dc36d1a02fbedc2753a096848e7c1b0772f7654eab8e2c927dd53" dependencies = [ - "cargo-lock", "git2", ] [[package]] -name = "cargo-lock" -version = "8.0.3" +name = "bytemuck" +version = "1.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "031718ddb8f78aa5def78a09e90defe30151d1f6c672f937af4dd916429ed996" +checksum = "ed2490600f404f2b94c167e31d3ed1d5f3c225a0f3b80230053b3e0b7b962bd9" dependencies = [ - "semver 1.0.18", - "serde", - "toml", - "url", + "bytemuck_derive", +] + +[[package]] +name = "bytemuck_derive" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.31", ] [[package]] @@ -164,9 +168,9 @@ dependencies = [ [[package]] name = "delegate" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d358e0ec5c59a5e1603b933def447096886121660fc680dc1e64a0753981fe3c" +checksum = "0ee5df75c70b95bd3aacc8e2fd098797692fb1d54121019c4de481e42f04c8a1" dependencies = [ "proc-macro2", "quote", @@ -250,11 +254,11 @@ dependencies = [ [[package]] name = "git2" -version = "0.16.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccf7f68c2995f392c49fffb4f95ae2c873297830eb25c6bc4c114ce8f4562acc" +checksum = "fbf97ba92db08df386e10c8ede66a2a0369bd277090afd8710e19e38de9ec0cd" dependencies = [ - "bitflags 1.3.2", + "bitflags", "libc", "libgit2-sys", "log", @@ -302,9 +306,9 @@ dependencies = [ [[package]] name = "itertools" -version = "0.10.5" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" dependencies = [ "either", ] @@ -332,9 +336,9 @@ checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" [[package]] name = "libgit2-sys" -version = "0.14.2+1.5.1" +version = "0.16.1+1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f3d95f6b51075fe9810a7ae22c7095f12b98005ab364d8544797a825ce946a4" +checksum = "f2a2bb3680b094add03bb3732ec520ece34da31a8cd2d633d1389d0f0fb60d0c" dependencies = [ "cc", "libc", @@ -393,13 +397,14 @@ dependencies = [ [[package]] name = "mmtk" -version = "0.20.0" -source = "git+https://github.com/mmtk/mmtk-core.git?rev=57af17fbfd94ff0df2cd3b1e504abe299ce4f0ab#57af17fbfd94ff0df2cd3b1e504abe299ce4f0ab" +version = "0.24.0" +source = "git+https://github.com/mmtk/mmtk-core.git?rev=5ab62f96c006475285b00b6d20a8b1bf83b74a4d#5ab62f96c006475285b00b6d20a8b1bf83b74a4d" dependencies = [ "atomic", "atomic-traits", "atomic_refcell", "built", + "bytemuck", "cfg-if", "crossbeam", "delegate", @@ -427,8 +432,8 @@ dependencies = [ [[package]] name = "mmtk-macros" -version = "0.20.0" -source = "git+https://github.com/mmtk/mmtk-core.git?rev=57af17fbfd94ff0df2cd3b1e504abe299ce4f0ab#57af17fbfd94ff0df2cd3b1e504abe299ce4f0ab" +version = "0.24.0" +source = "git+https://github.com/mmtk/mmtk-core.git?rev=5ab62f96c006475285b00b6d20a8b1bf83b74a4d#5ab62f96c006475285b00b6d20a8b1bf83b74a4d" dependencies = [ "proc-macro-error", "proc-macro2", @@ -614,7 +619,7 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" dependencies = [ - "semver 0.11.0", + "semver", ] [[package]] @@ -623,7 +628,7 @@ version = "0.38.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0c3dde1fc030af041adc40e79c0e7fbcf431dd24870053d187d7c66e4b87453" dependencies = [ - "bitflags 2.4.0", + "bitflags", "errno", "libc", "linux-raw-sys", @@ -651,15 +656,6 @@ dependencies = [ "semver-parser", ] -[[package]] -name = "semver" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" -dependencies = [ - "serde", -] - [[package]] name = "semver-parser" version = "0.10.2" @@ -669,26 +665,6 @@ dependencies = [ "pest", ] -[[package]] -name = "serde" -version = "1.0.188" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.188" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.31", -] - [[package]] name = "spin" version = "0.9.8" @@ -706,21 +682,21 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "strum" -version = "0.24.1" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" +checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" [[package]] name = "strum_macros" -version = "0.24.3" +version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" +checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" dependencies = [ "heck", "proc-macro2", "quote", "rustversion", - "syn 1.0.109", + "syn 2.0.31", ] [[package]] @@ -804,15 +780,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" -[[package]] -name = "toml" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" -dependencies = [ - "serde", -] - [[package]] name = "ucd-trie" version = "0.1.6" diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index 3ff8500..5ac38de 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -27,7 +27,7 @@ log = "*" # - 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 = "57af17fbfd94ff0df2cd3b1e504abe299ce4f0ab" } +mmtk = { git = "https://github.com/mmtk/mmtk-core.git", rev="5ab62f96c006475285b00b6d20a8b1bf83b74a4d" } # Uncomment the following and fix the path to mmtk-core to build locally # mmtk = { path = "../repos/mmtk-core" } diff --git a/mmtk/src/api.rs b/mmtk/src/api.rs index 6a722dc..2e3c051 100644 --- a/mmtk/src/api.rs +++ b/mmtk/src/api.rs @@ -1,7 +1,7 @@ use libc::c_char; use libc::c_void; use mmtk::memory_manager; -use mmtk::scheduler::{GCController, GCWorker}; +use mmtk::scheduler::GCWorker; use mmtk::util::opaque_pointer::*; use mmtk::util::{Address, ObjectReference}; use mmtk::AllocationSemantics; @@ -97,18 +97,6 @@ pub extern "C" fn will_never_move(object: ObjectReference) -> bool { !object.is_movable() } -#[no_mangle] -// We trust the worker pointer is valid. -#[allow(clippy::not_unsafe_ptr_arg_deref)] -pub extern "C" fn start_control_collector( - mmtk: &'static mut MMTK, - tls: VMWorkerThread, - gc_controller: *mut GCController, -) { - let mut gc_controller = unsafe { Box::from_raw(gc_controller) }; - memory_manager::start_control_collector(&*mmtk, tls, &mut gc_controller); -} - #[no_mangle] // We trust the worker pointer is valid. #[allow(clippy::not_unsafe_ptr_arg_deref)] @@ -117,8 +105,8 @@ pub extern "C" fn start_worker( tls: VMWorkerThread, worker: *mut GCWorker, ) { - let mut worker = unsafe { Box::from_raw(worker) }; - memory_manager::start_worker::(mmtk, tls, &mut worker); + let worker = unsafe { Box::from_raw(worker) }; + memory_manager::start_worker::(mmtk, tls, worker); } #[no_mangle] diff --git a/mmtk/src/collection.rs b/mmtk/src/collection.rs index ac7d851..ea39a81 100644 --- a/mmtk/src/collection.rs +++ b/mmtk/src/collection.rs @@ -5,7 +5,6 @@ use mmtk::Mutator; use UPCALLS; use V8; -const GC_THREAD_KIND_CONTROLLER: libc::c_int = 0; const GC_THREAD_KIND_WORKER: libc::c_int = 1; pub struct VMCollection {} @@ -34,10 +33,6 @@ impl Collection for VMCollection { fn spawn_gc_thread(tls: VMThread, ctx: GCThreadContext) { let (ctx_ptr, kind) = match ctx { - GCThreadContext::Controller(b) => ( - Box::into_raw(b) as *mut libc::c_void, - GC_THREAD_KIND_CONTROLLER, - ), GCThreadContext::Worker(b) => { (Box::into_raw(b) as *mut libc::c_void, GC_THREAD_KIND_WORKER) } diff --git a/v8/third_party/heap/mmtk/mmtk.h b/v8/third_party/heap/mmtk/mmtk.h index a2b94b9..ae6ded8 100644 --- a/v8/third_party/heap/mmtk/mmtk.h +++ b/v8/third_party/heap/mmtk/mmtk.h @@ -52,7 +52,6 @@ extern bool process(void* builder, char* name, char* value); extern void scan_region(void *mmtk); extern void handle_user_collection_request(void *mmtk, void *tls); -extern void start_control_collector(void *tls, void* controller); extern void start_worker(void *tls, void* worker); /**