Skip to content

Commit

Permalink
Use to_address for SFT access
Browse files Browse the repository at this point in the history
Upstream change: mmtk/mmtk-core#1122
  • Loading branch information
wks committed Apr 17, 2024
1 parent 410d17f commit a794d1d
Show file tree
Hide file tree
Showing 5 changed files with 117 additions and 96 deletions.
199 changes: 110 additions & 89 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 = "5ab62f96c006475285b00b6d20a8b1bf83b74a4d" }
mmtk = { git = "https://github.com/wks/mmtk-core.git", rev = "954ad7df0301c07687048a23ebe455b13054ebcb" }
# 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
8 changes: 4 additions & 4 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(
#[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 will_never_move(object: ObjectReference) -> i32 {
!object.is_movable() as i32
!object.is_movable::<JikesRVM>() as i32
}

#[no_mangle]
Expand Down Expand Up @@ -168,7 +168,7 @@ pub extern "C" fn handle_user_collection_request(tls: VMMutatorThread) {
#[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_live_object(object: ObjectReference) -> i32 {
object.is_live() as i32
object.is_live::<JikesRVM>() as i32
}

#[no_mangle]
Expand Down Expand Up @@ -211,15 +211,15 @@ pub extern "C" fn add_phantom_candidate(reff: ObjectReference, referent: ObjectR

#[no_mangle]
pub extern "C" fn get_forwarded_object(object: ObjectReference) -> ObjectReference {
match object.get_forwarded_object() {
match object.get_forwarded_object::<JikesRVM>() {
Some(ref_obj) => ref_obj,
None => ObjectReference::NULL,
}
}

#[no_mangle]
pub extern "C" fn is_reachable(object: ObjectReference) -> i32 {
object.is_reachable() as i32
object.is_reachable::<JikesRVM>() as i32
}

#[no_mangle]
Expand Down
2 changes: 1 addition & 1 deletion mmtk/src/object_model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ impl VMObjectModel {
// Do we need to copy the hash code?
if hash_state == HASH_STATE_HASHED {
unsafe {
let hash_code = from_obj.value() >> LOG_BYTES_IN_ADDRESS;
let hash_code = from_obj.to_raw_address().as_usize() >> LOG_BYTES_IN_ADDRESS;
if DYNAMIC_HASH_OFFSET {
(to_obj.to_raw_address()
+ num_bytes
Expand Down
Loading

0 comments on commit a794d1d

Please sign in to comment.