Skip to content

Commit 00ffbae

Browse files
wksmmtkgc-bot
andauthored
Require ObjectReference to point inside object (#180)
This makes changes for upstream API changes. Upstream PR: mmtk/mmtk-core#1195 Fixes: #178 --------- Co-authored-by: mmtkgc-bot <mmtkgc.bot@gmail.com>
1 parent 5ecfd57 commit 00ffbae

File tree

4 files changed

+12
-15
lines changed

4 files changed

+12
-15
lines changed

mmtk/Cargo.lock

+6-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mmtk/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ log = {version = "0.4", features = ["max_level_trace", "release_max_level_off"]
2828
# - change branch/rev
2929
# - change repo name
3030
# But other changes including adding/removing whitespaces in commented lines may break the CI.
31-
mmtk = { git = "https://github.com/mmtk/mmtk-core.git", rev = "b3385b85fe1adf96ce820b0ceae1efdcaafa9120" }
31+
mmtk = { git = "https://github.com/mmtk/mmtk-core.git", rev = "45cdf31055b1b6a629bdb8032adaa6dd5a8e32b9" }
3232
# Uncomment the following to build locally - if you change the path locally, do not commit the change in a PR
3333
# mmtk = { path = "../repos/mmtk-core" }
3434

mmtk/src/api.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ pub extern "C" fn post_alloc(
116116
// For a syscall that returns bool, we have to return a i32 instead. See https://github.com/mmtk/mmtk-jikesrvm/issues/20
117117
pub extern "C" fn will_never_move(jikes_obj: JikesObj) -> i32 {
118118
let object = ObjectReference::try_from(jikes_obj).unwrap();
119-
!object.is_movable::<JikesRVM>() as i32
119+
!object.is_movable() as i32
120120
}
121121

122122
#[no_mangle]
@@ -169,14 +169,14 @@ pub extern "C" fn handle_user_collection_request(tls: VMMutatorThread) {
169169
// For a syscall that returns bool, we have to return a i32 instead. See https://github.com/mmtk/mmtk-jikesrvm/issues/20
170170
pub extern "C" fn is_live_object(jikes_obj: JikesObj) -> i32 {
171171
let object = ObjectReference::try_from(jikes_obj).unwrap();
172-
object.is_live::<JikesRVM>() as i32
172+
object.is_live() as i32
173173
}
174174

175175
#[no_mangle]
176176
// For a syscall that returns bool, we have to return a i32 instead. See https://github.com/mmtk/mmtk-jikesrvm/issues/20
177177
pub extern "C" fn is_mapped_object(jikes_obj: JikesObj) -> i32 {
178178
let object = ObjectReference::try_from(jikes_obj).unwrap();
179-
memory_manager::is_in_mmtk_spaces::<JikesRVM>(object) as i32
179+
memory_manager::is_in_mmtk_spaces(object) as i32
180180
}
181181

182182
#[no_mangle]
@@ -217,14 +217,14 @@ pub extern "C" fn add_phantom_candidate(jikes_reff: JikesObj, jikes_referent: Ji
217217
#[no_mangle]
218218
pub extern "C" fn get_forwarded_object(jikes_obj: JikesObj) -> JikesObj {
219219
let object = ObjectReference::try_from(jikes_obj).unwrap();
220-
let result = object.get_forwarded_object::<JikesRVM>();
220+
let result = object.get_forwarded_object();
221221
JikesObj::from_objref_nullable(result)
222222
}
223223

224224
#[no_mangle]
225225
pub extern "C" fn is_reachable(jikes_obj: JikesObj) -> i32 {
226226
let object = ObjectReference::try_from(jikes_obj).unwrap();
227-
object.is_reachable::<JikesRVM>() as i32
227+
object.is_reachable() as i32
228228
}
229229

230230
#[no_mangle]

mmtk/src/object_model.rs

-3
Original file line numberDiff line numberDiff line change
@@ -462,9 +462,6 @@ impl ObjectModel<JikesRVM> for VMObjectModel {
462462
/// code in the front. Its value is zero for now.
463463
const OBJECT_REF_OFFSET_LOWER_BOUND: isize = OBJECT_REF_OFFSET + JAVA_HEADER_OFFSET;
464464

465-
/// MMTk-level `ObjectReference` points at the JavaHeader which is always inside the object.
466-
const IN_OBJECT_ADDRESS_OFFSET: isize = 0;
467-
468465
fn dump_object(_object: ObjectReference) {
469466
unimplemented!()
470467
}

0 commit comments

Comments
 (0)