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

Fix conditional PPP handling #83

Closed
wants to merge 2 commits into from
Closed
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
86 changes: 43 additions & 43 deletions mmtk/Cargo.lock

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

4 changes: 2 additions & 2 deletions mmtk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ edition = "2021"
# Metadata for the Ruby repository
[package.metadata.ci-repos.ruby]
repo = "mmtk/ruby" # This is used by actions/checkout, so the format is "owner/repo", not URL.
rev = "c9ff790aa7692fc941757cd9ca1d2e64e63cb9b6"
rev = "63eeaad09bf7b134793740b88e80f98497d4c7bc"

[lib]
name = "mmtk_ruby"
Expand All @@ -37,7 +37,7 @@ features = ["is_mmtk_object", "object_pinning", "sticky_immix_non_moving_nursery

# Uncomment the following lines to use mmtk-core from the official repository.
git = "https://github.com/mmtk/mmtk-core.git"
rev = "3be73b8048df17f1f2bd019d0b109488a2c5e313"
rev = "6cae51c40104d84bb74598ab3eba4f9ef8173e8e"

# Uncomment the following line to use mmtk-core from a local repository.
# path = "../../mmtk-core"
Expand Down
1 change: 1 addition & 0 deletions mmtk/src/abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ pub struct RubyUpcalls {
pub get_original_givtbl: extern "C" fn(object: ObjectReference) -> *mut libc::c_void,
pub move_givtbl: extern "C" fn(old_objref: ObjectReference, new_objref: ObjectReference),
pub vm_live_bytes: extern "C" fn() -> usize,
pub is_no_longer_ppp: extern "C" fn(object: ObjectReference) -> bool,
pub update_frozen_strings_table: extern "C" fn(),
pub update_finalizer_table: extern "C" fn(),
pub update_obj_id_tables: extern "C" fn(),
Expand Down
17 changes: 13 additions & 4 deletions mmtk/src/ppp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,15 @@ impl PPPRegistry {
probe!(mmtk_ruby, remove_dead_ppps_start, ppps.len());
ppps.retain_mut(|obj| {
if obj.is_live::<Ruby>() {
*obj = obj.get_forwarded_object::<Ruby>().unwrap_or(*obj);
true
if (upcalls().is_no_longer_ppp)(*obj) {
log::trace!(" No longer PPP. Removed: {}", *obj);
false
} else {
*obj = obj.get_forwarded_object::<Ruby>().unwrap_or(*obj);
true
}
} else {
log::trace!(" PPP removed: {}", *obj);
log::trace!(" Dead PPP removed: {}", *obj);
false
}
});
Expand Down Expand Up @@ -142,7 +147,11 @@ impl GCWork<Ruby> for PinPPPChildren {
.set_temporarily_and_run_code(visit_object, || {
for obj in self.ppps.iter().cloned() {
log::trace!(" PPP: {}", obj);
(upcalls().call_gc_mark_children)(obj);
if (upcalls().is_no_longer_ppp)(obj) {
log::trace!(" No longer PPP. Skip {}", obj);
} else {
(upcalls().call_gc_mark_children)(obj);
}
}
});

Expand Down
Loading