From e8ab43d333c48abff995ee61540b0c2f809b41ad Mon Sep 17 00:00:00 2001 From: Kunshan Wang Date: Thu, 5 Sep 2024 14:52:18 +0800 Subject: [PATCH 1/2] Require ObjectReference to point inside object This makes changes for upstream API changes. Upstream PR: https://github.com/mmtk/mmtk-core/pull/1195 Fixes: https://github.com/mmtk/mmtk-jikesrvm/issues/178 --- mmtk/Cargo.lock | 8 ++++---- mmtk/Cargo.toml | 2 +- mmtk/src/api.rs | 10 +++++----- mmtk/src/object_model.rs | 3 --- 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/mmtk/Cargo.lock b/mmtk/Cargo.lock index bcc5b40..196fe9e 100644 --- a/mmtk/Cargo.lock +++ b/mmtk/Cargo.lock @@ -128,9 +128,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.15" +version = "1.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57b6a275aa2903740dc87da01c62040406b8812552e97129a63ea8850a17c6e6" +checksum = "e9d013ecb737093c0e86b151a7b837993cf9ec6c502946cfb44bedc392421e0b" dependencies = [ "jobserver", "libc", @@ -438,7 +438,7 @@ dependencies = [ [[package]] name = "mmtk" version = "0.27.0" -source = "git+https://github.com/mmtk/mmtk-core.git?rev=b3385b85fe1adf96ce820b0ceae1efdcaafa9120#b3385b85fe1adf96ce820b0ceae1efdcaafa9120" +source = "git+https://github.com/wks/mmtk-core.git?rev=57a98749ff37093b355d7b2f496b8a67315e158b#57a98749ff37093b355d7b2f496b8a67315e158b" dependencies = [ "atomic", "atomic-traits", @@ -474,7 +474,7 @@ dependencies = [ [[package]] name = "mmtk-macros" version = "0.27.0" -source = "git+https://github.com/mmtk/mmtk-core.git?rev=b3385b85fe1adf96ce820b0ceae1efdcaafa9120#b3385b85fe1adf96ce820b0ceae1efdcaafa9120" +source = "git+https://github.com/wks/mmtk-core.git?rev=57a98749ff37093b355d7b2f496b8a67315e158b#57a98749ff37093b355d7b2f496b8a67315e158b" dependencies = [ "proc-macro-error", "proc-macro2", diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index e50fd43..990d718 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -28,7 +28,7 @@ log = {version = "0.4", features = ["max_level_trace", "release_max_level_off"] # - change branch/rev # - 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 = "b3385b85fe1adf96ce820b0ceae1efdcaafa9120" } +mmtk = { git = "https://github.com/wks/mmtk-core.git", rev = "57a98749ff37093b355d7b2f496b8a67315e158b" } # Uncomment the following to build locally - if you change the path locally, do not commit the change in a PR # mmtk = { path = "../repos/mmtk-core" } diff --git a/mmtk/src/api.rs b/mmtk/src/api.rs index eabbf95..afbf3ad 100644 --- a/mmtk/src/api.rs +++ b/mmtk/src/api.rs @@ -116,7 +116,7 @@ pub extern "C" fn post_alloc( // For a syscall that returns bool, we have to return a i32 instead. See https://github.com/mmtk/mmtk-jikesrvm/issues/20 pub extern "C" fn will_never_move(jikes_obj: JikesObj) -> i32 { let object = ObjectReference::try_from(jikes_obj).unwrap(); - !object.is_movable::() as i32 + !object.is_movable() as i32 } #[no_mangle] @@ -169,14 +169,14 @@ pub extern "C" fn handle_user_collection_request(tls: VMMutatorThread) { // For a syscall that returns bool, we have to return a i32 instead. See https://github.com/mmtk/mmtk-jikesrvm/issues/20 pub extern "C" fn is_live_object(jikes_obj: JikesObj) -> i32 { let object = ObjectReference::try_from(jikes_obj).unwrap(); - object.is_live::() as i32 + object.is_live() as i32 } #[no_mangle] // For a syscall that returns bool, we have to return a i32 instead. See https://github.com/mmtk/mmtk-jikesrvm/issues/20 pub extern "C" fn is_mapped_object(jikes_obj: JikesObj) -> i32 { let object = ObjectReference::try_from(jikes_obj).unwrap(); - memory_manager::is_in_mmtk_spaces::(object) as i32 + memory_manager::is_in_mmtk_spaces(object) as i32 } #[no_mangle] @@ -217,14 +217,14 @@ pub extern "C" fn add_phantom_candidate(jikes_reff: JikesObj, jikes_referent: Ji #[no_mangle] pub extern "C" fn get_forwarded_object(jikes_obj: JikesObj) -> JikesObj { let object = ObjectReference::try_from(jikes_obj).unwrap(); - let result = object.get_forwarded_object::(); + let result = object.get_forwarded_object(); JikesObj::from_objref_nullable(result) } #[no_mangle] pub extern "C" fn is_reachable(jikes_obj: JikesObj) -> i32 { let object = ObjectReference::try_from(jikes_obj).unwrap(); - object.is_reachable::() as i32 + object.is_reachable() as i32 } #[no_mangle] diff --git a/mmtk/src/object_model.rs b/mmtk/src/object_model.rs index 4b178a5..5145e93 100644 --- a/mmtk/src/object_model.rs +++ b/mmtk/src/object_model.rs @@ -462,9 +462,6 @@ impl ObjectModel for VMObjectModel { /// code in the front. Its value is zero for now. const OBJECT_REF_OFFSET_LOWER_BOUND: isize = OBJECT_REF_OFFSET + JAVA_HEADER_OFFSET; - /// MMTk-level `ObjectReference` points at the JavaHeader which is always inside the object. - const IN_OBJECT_ADDRESS_OFFSET: isize = 0; - fn dump_object(_object: ObjectReference) { unimplemented!() } From d98b68e536f7cea14432c403757a1d4420dd49d9 Mon Sep 17 00:00:00 2001 From: mmtkgc-bot Date: Fri, 6 Sep 2024 09:42:17 +0000 Subject: [PATCH 2/2] Update mmtk-core to 45cdf31055b1b6a629bdb8032adaa6dd5a8e32b9 --- mmtk/Cargo.lock | 8 ++++---- mmtk/Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mmtk/Cargo.lock b/mmtk/Cargo.lock index 196fe9e..2c23519 100644 --- a/mmtk/Cargo.lock +++ b/mmtk/Cargo.lock @@ -108,9 +108,9 @@ dependencies = [ [[package]] name = "bytemuck" -version = "1.17.1" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773d90827bc3feecfb67fab12e24de0749aad83c74b9504ecde46237b5cd24e2" +checksum = "94bbb0ad554ad961ddc5da507a12a29b14e4ae5bda06b19f575a3e6079d2e2ae" dependencies = [ "bytemuck_derive", ] @@ -438,7 +438,7 @@ dependencies = [ [[package]] name = "mmtk" version = "0.27.0" -source = "git+https://github.com/wks/mmtk-core.git?rev=57a98749ff37093b355d7b2f496b8a67315e158b#57a98749ff37093b355d7b2f496b8a67315e158b" +source = "git+https://github.com/mmtk/mmtk-core.git?rev=45cdf31055b1b6a629bdb8032adaa6dd5a8e32b9#45cdf31055b1b6a629bdb8032adaa6dd5a8e32b9" dependencies = [ "atomic", "atomic-traits", @@ -474,7 +474,7 @@ dependencies = [ [[package]] name = "mmtk-macros" version = "0.27.0" -source = "git+https://github.com/wks/mmtk-core.git?rev=57a98749ff37093b355d7b2f496b8a67315e158b#57a98749ff37093b355d7b2f496b8a67315e158b" +source = "git+https://github.com/mmtk/mmtk-core.git?rev=45cdf31055b1b6a629bdb8032adaa6dd5a8e32b9#45cdf31055b1b6a629bdb8032adaa6dd5a8e32b9" dependencies = [ "proc-macro-error", "proc-macro2", diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index 990d718..9806204 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -28,7 +28,7 @@ log = {version = "0.4", features = ["max_level_trace", "release_max_level_off"] # - change branch/rev # - change repo name # But other changes including adding/removing whitespaces in commented lines may break the CI. -mmtk = { git = "https://github.com/wks/mmtk-core.git", rev = "57a98749ff37093b355d7b2f496b8a67315e158b" } +mmtk = { git = "https://github.com/mmtk/mmtk-core.git", rev = "45cdf31055b1b6a629bdb8032adaa6dd5a8e32b9" } # Uncomment the following to build locally - if you change the path locally, do not commit the change in a PR # mmtk = { path = "../repos/mmtk-core" }