Skip to content

Commit

Permalink
Update Ruby repo revision
Browse files Browse the repository at this point in the history
The upstream made some changes to the root-scanning functions, notably,

-   Introduced yjit roots.
-   Seperated root-scanning into the GC-implementation-agnostic
    rb_gc_mark_roots in gc.c and the GC-implementation-specific
    mark_roots in gc/default.c.

In the `ruby` repo, we reorder the root-scanning functions in the upcall
table so that the general functions come before the
implementation-specific functions.  Also added yjit roots as one upcall,
although its implementation is a no-op if yjit is not enabled.
  • Loading branch information
wks committed Aug 22, 2024
1 parent 5ea2e99 commit 7c02aca
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion 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 = "1c4102e7bcee03f66ca72f916cde0d2bd7a8638b"
rev = "a55df63fcc186880f2262ab7e54b442f2637ff2b"

[lib]
name = "mmtk_ruby"
Expand Down
3 changes: 2 additions & 1 deletion mmtk/src/abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -356,9 +356,10 @@ pub struct RubyUpcalls {
data: *mut libc::c_void,
),
pub scan_vm_roots: extern "C" fn(),
pub scan_finalizer_tbl_roots: extern "C" fn(),
pub scan_end_proc_roots: extern "C" fn(),
pub scan_global_tbl_roots: extern "C" fn(),
pub scan_yjit_roots: extern "C" fn(),
pub scan_finalizer_tbl_roots: extern "C" fn(),
pub scan_obj_to_id_tbl_roots: extern "C" fn(),
pub scan_misc_roots: extern "C" fn(),
pub scan_final_jobs_roots: extern "C" fn(),
Expand Down
15 changes: 10 additions & 5 deletions mmtk/src/scanning.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,10 @@ impl Scanning<Ruby> for VMScanning {
let gc_tls = unsafe { GCThreadTLS::from_vwt_check(tls) };
let root_scanning_work_packets: Vec<Box<dyn GCWork<Ruby>>> = vec![
Box::new(ScanVMRoots::new(factory.clone())),
Box::new(ScanFinalizerTblRoots::new(factory.clone())),
Box::new(ScanEndProcRoots::new(factory.clone())),
Box::new(ScanGlobalTblRoots::new(factory.clone())),
Box::new(ScanYjitRoots::new(factory.clone())),
Box::new(ScanFinalizerTblRoots::new(factory.clone())),
Box::new(ScanObjToIdTblRoots::new(factory.clone())),
Box::new(ScanMiscRoots::new(factory.clone())),
Box::new(ScanFinalJobsRoots::new(factory.clone())),
Expand Down Expand Up @@ -241,10 +242,6 @@ define_global_root_scanner!(ScanVMRoots, {
(crate::upcalls().scan_vm_roots)();
});

define_global_root_scanner!(ScanFinalizerTblRoots, {
(crate::upcalls().scan_finalizer_tbl_roots)();
});

define_global_root_scanner!(ScanEndProcRoots, {
(crate::upcalls().scan_end_proc_roots)();
});
Expand All @@ -253,6 +250,14 @@ define_global_root_scanner!(ScanGlobalTblRoots, {
(crate::upcalls().scan_global_tbl_roots)();
});

define_global_root_scanner!(ScanYjitRoots, {
(crate::upcalls().scan_yjit_roots)();
});

define_global_root_scanner!(ScanFinalizerTblRoots, {
(crate::upcalls().scan_finalizer_tbl_roots)();
});

define_global_root_scanner!(ScanObjToIdTblRoots, {
(crate::upcalls().scan_obj_to_id_tbl_roots)();
});
Expand Down

0 comments on commit 7c02aca

Please sign in to comment.