Skip to content

Commit

Permalink
Update to MMTk core PR #875 (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
qinsoon authored Aug 9, 2023
1 parent 72c87fd commit 4997765
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 21 deletions.
15 changes: 11 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 @@ -31,7 +31,7 @@ lazy_static = "1.1"
# - change branch
# - 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 = "47ee126f91f25b911498b3d49c35f672f5e935f9" }
mmtk = { git = "https://github.com/mmtk/mmtk-core.git", rev = "04a47feb4598b2120598453c2cceec83986c2122" }
# Uncomment the following to build locally
# mmtk = { path = "../repos/mmtk-core" }
log = {version = "0.4", features = ["max_level_trace", "release_max_level_off"] }
Expand Down
18 changes: 10 additions & 8 deletions mmtk/src/collection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ static GC_START: AtomicU64 = AtomicU64::new(0);
pub struct VMCollection {}

impl Collection<JuliaVM> for VMCollection {
fn stop_all_mutators<F>(_tls: VMWorkerThread, _mutator_visitor: F)
fn stop_all_mutators<F>(_tls: VMWorkerThread, mut mutator_visitor: F)
where
F: FnMut(&'static mut Mutator<JuliaVM>),
{
Expand All @@ -27,6 +27,15 @@ impl Collection<JuliaVM> for VMCollection {

trace!("Stopped the world!");

// Tell MMTk the stacks are ready.
{
use mmtk::vm::ActivePlan;
for mutator in crate::active_plan::VMActivePlan::mutators() {
info!("stop_all_mutators: visiting {:?}", mutator.mutator_tls);
mutator_visitor(mutator);
}
}

// Record the start time of the GC
let now = unsafe { ((*UPCALLS).jl_hrtime)() };
trace!("gc_start = {}", now);
Expand Down Expand Up @@ -130,13 +139,6 @@ impl Collection<JuliaVM> for VMCollection {
unsafe { ((*UPCALLS).jl_throw_out_of_memory_error)() };
}

fn prepare_mutator<T: MutatorContext<JuliaVM>>(
_tls_w: VMWorkerThread,
_tls_m: VMMutatorThread,
_mutator: &T,
) {
}

fn vm_live_bytes() -> usize {
crate::api::JULIA_MALLOC_BYTES.load(Ordering::SeqCst)
}
Expand Down
8 changes: 0 additions & 8 deletions mmtk/src/scanning.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,11 @@ use std::sync::MutexGuard;
pub struct VMScanning {}

impl Scanning<JuliaVM> for VMScanning {
fn scan_roots_in_all_mutator_threads(
_tls: VMWorkerThread,
_factory: impl RootsWorkFactory<JuliaVMEdge>,
) {
// Thread roots are collected by Julia before stopping the world
}

fn scan_roots_in_mutator_thread(
_tls: VMWorkerThread,
_mutator: &'static mut Mutator<JuliaVM>,
_factory: impl RootsWorkFactory<JuliaVMEdge>,
) {
unimplemented!()
}
fn scan_vm_specific_roots(
_tls: VMWorkerThread,
Expand Down

0 comments on commit 4997765

Please sign in to comment.