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 ac309c6 commit 097fff8
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 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 @@ -37,7 +37,7 @@ features = ["is_mmtk_object", "object_pinning"]

# Uncomment the following lines to use mmtk-core from the official repository.
git = "https://github.com/mmtk/mmtk-core.git"
rev = "d291cda52790a34ed10bf72b4c5e27c3ab89a242"
rev = "20e56c25713fc42ec6747f9a38d9c7f4fa820f12"

# Uncomment the following line to use mmtk-core from a local repository.
#path = "../../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 @@ -148,7 +148,7 @@ pub extern "C" fn mmtk_post_alloc(

#[no_mangle]
pub extern "C" fn mmtk_will_never_move(object: ObjectReference) -> bool {
!object.is_movable()
!object.is_movable::<Ruby>()
}

#[no_mangle]
Expand Down Expand Up @@ -199,18 +199,18 @@ pub extern "C" fn mmtk_total_bytes() -> usize {

#[no_mangle]
pub extern "C" fn mmtk_is_reachable(object: ObjectReference) -> bool {
object.is_reachable()
object.is_reachable::<Ruby>()
}

#[no_mangle]
pub extern "C" fn mmtk_is_live_object(object: ObjectReference) -> bool {
memory_manager::is_live_object(object)
memory_manager::is_live_object::<Ruby>(object)
}

#[no_mangle]
pub extern "C" fn mmtk_get_forwarded_object(object: ObjectReference) -> ObjectReference {
object
.get_forwarded_object()
.get_forwarded_object::<Ruby>()
.unwrap_or(ObjectReference::NULL)
}

Expand Down
4 changes: 2 additions & 2 deletions mmtk/src/ppp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ impl PPPRegistry {

probe!(mmtk_ruby, remove_dead_ppps_start, ppps.len());
ppps.retain_mut(|obj| {
if obj.is_live() {
*obj = obj.get_forwarded_object().unwrap_or(*obj);
if obj.is_live::<Ruby>() {
*obj = obj.get_forwarded_object::<Ruby>().unwrap_or(*obj);
true
} else {
log::trace!(" PPP removed: {}", *obj);
Expand Down
4 changes: 2 additions & 2 deletions mmtk/src/weak_proc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ impl GCWork<Ruby> for ProcessObjFreeCandidates {
let mut new_candidates = Vec::new();

for object in obj_free_candidates.iter().copied() {
if object.is_reachable() {
if object.is_reachable::<Ruby>() {
// Forward and add back to the candidate list.
let new_object = object.forward();
trace!(
Expand Down Expand Up @@ -216,6 +216,6 @@ trait Forwardable {

impl Forwardable for ObjectReference {
fn forward(&self) -> Self {
self.get_forwarded_object().unwrap_or(*self)
self.get_forwarded_object::<Ruby>().unwrap_or(*self)
}
}

0 comments on commit 097fff8

Please sign in to comment.