Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require ObjectReference to point inside object #180

Merged
merged 2 commits into from
Sep 6, 2024
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
12 changes: 6 additions & 6 deletions mmtk/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mmtk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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/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" }

Expand Down
10 changes: 5 additions & 5 deletions mmtk/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<JikesRVM>() as i32
!object.is_movable() as i32
}

#[no_mangle]
Expand Down Expand Up @@ -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::<JikesRVM>() 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::<JikesRVM>(object) as i32
memory_manager::is_in_mmtk_spaces(object) as i32
}

#[no_mangle]
Expand Down Expand Up @@ -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::<JikesRVM>();
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::<JikesRVM>() as i32
object.is_reachable() as i32
}

#[no_mangle]
Expand Down
3 changes: 0 additions & 3 deletions mmtk/src/object_model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -462,9 +462,6 @@ impl ObjectModel<JikesRVM> 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!()
}
Expand Down
Loading