Skip to content

Commit b86ed3f

Browse files
authored
Update to MMTk core PR #875 (#225)
Updates to mmtk/mmtk-core#875.
1 parent 54a249e commit b86ed3f

File tree

7 files changed

+111
-72
lines changed

7 files changed

+111
-72
lines changed

mmtk/Cargo.lock

Lines changed: 100 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mmtk/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ once_cell = "1.10.0"
3030
# - change branch
3131
# - change repo name
3232
# But other changes including adding/removing whitespaces in commented lines may break the CI.
33-
mmtk = { git = "https://github.com/mmtk/mmtk-core.git", rev = "f1a0bb7fbec97dd84e35a40e8be01cf5018f2f9e" }
33+
mmtk = { git = "https://github.com/mmtk/mmtk-core.git", rev = "04a47feb4598b2120598453c2cceec83986c2122" }
3434
# Uncomment the following to build locally
3535
# mmtk = { path = "../repos/mmtk-core" }
3636

mmtk/src/collection.rs

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use mmtk::util::alloc::AllocationError;
22
use mmtk::util::opaque_pointer::*;
3-
use mmtk::vm::{Collection, GCThreadContext, Scanning, VMBinding};
4-
use mmtk::{Mutator, MutatorContext};
3+
use mmtk::vm::{Collection, GCThreadContext};
4+
use mmtk::Mutator;
55

66
use crate::UPCALLS;
77
use crate::{MutatorClosure, OpenJDK};
@@ -16,13 +16,9 @@ impl Collection<OpenJDK> for VMCollection {
1616
where
1717
F: FnMut(&'static mut Mutator<OpenJDK>),
1818
{
19-
let scan_mutators_in_safepoint =
20-
<OpenJDK as VMBinding>::VMScanning::SCAN_MUTATORS_IN_SAFEPOINT;
21-
2219
unsafe {
2320
((*UPCALLS).stop_all_mutators)(
2421
tls,
25-
scan_mutators_in_safepoint,
2622
MutatorClosure::from_rust_closure(&mut mutator_visitor),
2723
);
2824
}
@@ -55,14 +51,6 @@ impl Collection<OpenJDK> for VMCollection {
5551
}
5652
}
5753

58-
fn prepare_mutator<T: MutatorContext<OpenJDK>>(
59-
_tls_w: VMWorkerThread,
60-
_tls_m: VMMutatorThread,
61-
_m: &T,
62-
) {
63-
// unimplemented!()
64-
}
65-
6654
fn out_of_memory(tls: VMThread, err_kind: AllocationError) {
6755
unsafe {
6856
((*UPCALLS).out_of_memory)(tls, err_kind);

mmtk/src/lib.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,7 @@ pub struct EdgesClosure {
7575

7676
#[repr(C)]
7777
pub struct OpenJDK_Upcalls {
78-
pub stop_all_mutators: extern "C" fn(
79-
tls: VMWorkerThread,
80-
scan_mutators_in_safepoint: bool,
81-
closure: MutatorClosure,
82-
),
78+
pub stop_all_mutators: extern "C" fn(tls: VMWorkerThread, closure: MutatorClosure),
8379
pub resume_mutators: extern "C" fn(tls: VMWorkerThread),
8480
pub spawn_gc_thread: extern "C" fn(tls: VMThread, kind: libc::c_int, ctx: *mut libc::c_void),
8581
pub block_for_gc: extern "C" fn(),

mmtk/src/scanning.rs

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ pub(crate) fn to_edges_closure<F: RootsWorkFactory<OpenJDKEdge>>(factory: &mut F
4242
}
4343

4444
impl Scanning<OpenJDK> for VMScanning {
45-
const SCAN_MUTATORS_IN_SAFEPOINT: bool = false;
46-
const SINGLE_THREAD_MUTATOR_SCANNING: bool = false;
47-
4845
fn scan_object<EV: EdgeVisitor<OpenJDKEdge>>(
4946
tls: VMWorkerThread,
5047
object: ObjectReference,
@@ -58,15 +55,6 @@ impl Scanning<OpenJDK> for VMScanning {
5855
// TODO
5956
}
6057

61-
fn scan_roots_in_all_mutator_threads(
62-
_tls: VMWorkerThread,
63-
mut factory: impl RootsWorkFactory<OpenJDKEdge>,
64-
) {
65-
unsafe {
66-
((*UPCALLS).scan_roots_in_all_mutator_threads)(to_edges_closure(&mut factory));
67-
}
68-
}
69-
7058
fn scan_roots_in_mutator_thread(
7159
_tls: VMWorkerThread,
7260
mutator: &'static mut Mutator<OpenJDK>,
@@ -94,15 +82,9 @@ impl Scanning<OpenJDK> for VMScanning {
9482
Box::new(ScanStringTableRoots::new(factory.clone())) as _,
9583
Box::new(ScanClassLoaderDataGraphRoots::new(factory.clone())) as _,
9684
Box::new(ScanWeakProcessorRoots::new(factory.clone())) as _,
85+
Box::new(ScanVMThreadRoots::new(factory)) as _,
9786
],
9887
);
99-
if !(Self::SCAN_MUTATORS_IN_SAFEPOINT && Self::SINGLE_THREAD_MUTATOR_SCANNING) {
100-
memory_manager::add_work_packet(
101-
&SINGLETON,
102-
WorkBucketStage::Prepare,
103-
ScanVMThreadRoots::new(factory),
104-
);
105-
}
10688
}
10789

10890
fn supports_return_barrier() -> bool {

openjdk/mmtk.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ struct EdgesClosure {
144144
* OpenJDK-specific
145145
*/
146146
typedef struct {
147-
void (*stop_all_mutators) (void *tls, bool scan_mutators_in_safepoint, MutatorClosure closure);
147+
void (*stop_all_mutators) (void *tls, MutatorClosure closure);
148148
void (*resume_mutators) (void *tls);
149149
void (*spawn_gc_thread) (void *tls, int kind, void *ctx);
150150
void (*block_for_gc) ();

0 commit comments

Comments
 (0)