Skip to content

Commit e9cb6e9

Browse files
wksmmtkgc-bot
andauthored
Remove the coordinator thread (#82)
Upstream PR: mmtk/mmtk-core#1067 --------- Co-authored-by: mmtkgc-bot <mmtkgc.bot@gmail.com>
1 parent 1dc0803 commit e9cb6e9

File tree

5 files changed

+47
-98
lines changed

5 files changed

+47
-98
lines changed

mmtk/Cargo.lock

+43-76
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mmtk/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ log = "*"
2727
# - change branch
2828
# - change repo name
2929
# But other changes including adding/removing whitespaces in commented lines may break the CI.
30-
mmtk = { git = "https://github.com/mmtk/mmtk-core.git", rev = "57af17fbfd94ff0df2cd3b1e504abe299ce4f0ab" }
30+
mmtk = { git = "https://github.com/mmtk/mmtk-core.git", rev="5ab62f96c006475285b00b6d20a8b1bf83b74a4d" }
3131
# Uncomment the following and fix the path to mmtk-core to build locally
3232
# mmtk = { path = "../repos/mmtk-core" }
3333

mmtk/src/api.rs

+3-15
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use libc::c_char;
22
use libc::c_void;
33
use mmtk::memory_manager;
4-
use mmtk::scheduler::{GCController, GCWorker};
4+
use mmtk::scheduler::GCWorker;
55
use mmtk::util::opaque_pointer::*;
66
use mmtk::util::{Address, ObjectReference};
77
use mmtk::AllocationSemantics;
@@ -97,18 +97,6 @@ pub extern "C" fn will_never_move(object: ObjectReference) -> bool {
9797
!object.is_movable()
9898
}
9999

100-
#[no_mangle]
101-
// We trust the worker pointer is valid.
102-
#[allow(clippy::not_unsafe_ptr_arg_deref)]
103-
pub extern "C" fn start_control_collector(
104-
mmtk: &'static mut MMTK<V8>,
105-
tls: VMWorkerThread,
106-
gc_controller: *mut GCController<V8>,
107-
) {
108-
let mut gc_controller = unsafe { Box::from_raw(gc_controller) };
109-
memory_manager::start_control_collector(&*mmtk, tls, &mut gc_controller);
110-
}
111-
112100
#[no_mangle]
113101
// We trust the worker pointer is valid.
114102
#[allow(clippy::not_unsafe_ptr_arg_deref)]
@@ -117,8 +105,8 @@ pub extern "C" fn start_worker(
117105
tls: VMWorkerThread,
118106
worker: *mut GCWorker<V8>,
119107
) {
120-
let mut worker = unsafe { Box::from_raw(worker) };
121-
memory_manager::start_worker::<V8>(mmtk, tls, &mut worker);
108+
let worker = unsafe { Box::from_raw(worker) };
109+
memory_manager::start_worker::<V8>(mmtk, tls, worker);
122110
}
123111

124112
#[no_mangle]

mmtk/src/collection.rs

-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ use mmtk::Mutator;
55
use UPCALLS;
66
use V8;
77

8-
const GC_THREAD_KIND_CONTROLLER: libc::c_int = 0;
98
const GC_THREAD_KIND_WORKER: libc::c_int = 1;
109

1110
pub struct VMCollection {}
@@ -34,10 +33,6 @@ impl Collection<V8> for VMCollection {
3433

3534
fn spawn_gc_thread(tls: VMThread, ctx: GCThreadContext<V8>) {
3635
let (ctx_ptr, kind) = match ctx {
37-
GCThreadContext::Controller(b) => (
38-
Box::into_raw(b) as *mut libc::c_void,
39-
GC_THREAD_KIND_CONTROLLER,
40-
),
4136
GCThreadContext::Worker(b) => {
4237
(Box::into_raw(b) as *mut libc::c_void, GC_THREAD_KIND_WORKER)
4338
}

v8/third_party/heap/mmtk/mmtk.h

-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ extern bool process(void* builder, char* name, char* value);
5252
extern void scan_region(void *mmtk);
5353
extern void handle_user_collection_request(void *mmtk, void *tls);
5454

55-
extern void start_control_collector(void *tls, void* controller);
5655
extern void start_worker(void *tls, void* worker);
5756

5857
/**

0 commit comments

Comments
 (0)