Skip to content
Merged
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
44 changes: 26 additions & 18 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 = "f780a11d4e9df58e06e3eb666c3fd7f41e0a9a41" }
mmtk = { git = "https://github.com/mmtk/mmtk-core.git", rev = "04a47feb4598b2120598453c2cceec83986c2122" }
# 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
33 changes: 16 additions & 17 deletions mmtk/src/collection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ use entrypoint::*;
use mmtk::util::alloc::AllocationError;
use mmtk::util::opaque_pointer::*;
use mmtk::util::Address;
use mmtk::vm::ActivePlan;
use mmtk::vm::{Collection, GCThreadContext};
use mmtk::Mutator;
use mmtk::MutatorContext;
use JikesRVM;
use JTOC_BASE;

Expand All @@ -18,13 +18,27 @@ pub struct VMCollection {}
// FIXME: Shouldn't these all be unsafe because of tls?
impl Collection<JikesRVM> for VMCollection {
#[inline(always)]
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<JikesRVM>),
{
unsafe {
jtoc_call!(BLOCK_ALL_MUTATORS_FOR_GC_METHOD_OFFSET, tls);
}

for mutator in crate::active_plan::VMActivePlan::mutators() {
// Prepare mutator
unsafe {
jtoc_call!(
PREPARE_MUTATOR_METHOD_OFFSET,
// convert to primitive types, so they can be used in asm!
std::mem::transmute::<_, usize>(tls),
std::mem::transmute::<_, usize>(mutator.mutator_tls)
);
}
// Tell MMTk the thread is ready for stack scanning
mutator_visitor(mutator);
}
}

#[inline(always)]
Expand Down Expand Up @@ -56,21 +70,6 @@ impl Collection<JikesRVM> for VMCollection {
}
}

fn prepare_mutator<T: MutatorContext<JikesRVM>>(
tls_worker: VMWorkerThread,
tls_mutator: VMMutatorThread,
_m: &T,
) {
unsafe {
jtoc_call!(
PREPARE_MUTATOR_METHOD_OFFSET,
// convert to primitive types, so they can be used in asm!
std::mem::transmute::<_, usize>(tls_worker),
std::mem::transmute::<_, usize>(tls_mutator)
);
}
}

fn out_of_memory(tls: VMThread, _err_kind: AllocationError) {
unsafe {
jtoc_call!(OUT_OF_MEMORY_METHOD_OFFSET, tls);
Expand Down
7 changes: 0 additions & 7 deletions mmtk/src/scanning.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,6 @@ extern "C" fn report_edges_and_renew_buffer<F: RootsWorkFactory<JikesRVMEdge>>(
}

impl Scanning<JikesRVM> for VMScanning {
const SINGLE_THREAD_MUTATOR_SCANNING: bool = false;
fn scan_roots_in_all_mutator_threads(
_tls: VMWorkerThread,
_factory: impl RootsWorkFactory<JikesRVMEdge>,
) {
unreachable!()
}
fn scan_roots_in_mutator_thread(
tls: VMWorkerThread,
mutator: &'static mut Mutator<JikesRVM>,
Expand Down