Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
215 changes: 212 additions & 3 deletions mmtk/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion mmtk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ 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 = "a96e8f991c91a81df51e7975849441f52fdbcdcc" }
#mmtk = { git = "https://github.com/mmtk/mmtk-core.git", rev = "a96e8f991c91a81df51e7975849441f52fdbcdcc" }
mmtk = { git = "https://github.com/wks/mmtk-core.git", branch = "edge-shape" }
# 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
8 changes: 8 additions & 0 deletions mmtk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,21 @@ pub static mut JTOC_BASE: Address = Address::ZERO;
#[derive(Default)]
pub struct JikesRVM;

/// The type of edges in JikesRVM.
///
/// TODO: We start with Address to ease the transition.
/// We should switch to the equivalent `mmtk::vm::edge_shape::SimpleEdge` later.
pub type JikesRVMEdge = Address;

impl VMBinding for JikesRVM {
type VMObjectModel = object_model::VMObjectModel;
type VMScanning = scanning::VMScanning;
type VMCollection = collection::VMCollection;
type VMActivePlan = active_plan::VMActivePlan;
type VMReferenceGlue = reference_glue::VMReferenceGlue;

type VMEdge = JikesRVMEdge;

const ALLOC_END_ALIGNMENT: usize = 4;
}

Expand Down
9 changes: 5 additions & 4 deletions mmtk/src/scan_boot_image.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use crate::scanning::EDGES_BUFFER_CAPACITY;
use crate::unboxed_size_constants::*;
use crate::JikesRVM;
use crate::JikesRVMEdge;
use entrypoint::*;
use java_size_constants::*;
use mmtk::scheduler::*;
Expand All @@ -25,7 +26,7 @@ static REFS: AtomicUsize = AtomicUsize::new(0);

pub fn scan_boot_image(
_tls: OpaquePointer,
factory: &mut impl RootsWorkFactory,
factory: &mut impl RootsWorkFactory<JikesRVMEdge>,
subwork_id: usize,
total_subwork: usize,
) {
Expand Down Expand Up @@ -140,13 +141,13 @@ fn decode_long_encoding(cursor: Address) -> usize {
}
}

pub struct ScanBootImageRoots<F: RootsWorkFactory> {
pub struct ScanBootImageRoots<F: RootsWorkFactory<JikesRVMEdge>> {
factory: F,
subwork_id: usize,
total_subwork: usize,
}

impl<F: RootsWorkFactory> ScanBootImageRoots<F> {
impl<F: RootsWorkFactory<JikesRVMEdge>> ScanBootImageRoots<F> {
pub fn new(factory: F, subwork_id: usize, total_subwork: usize) -> Self {
Self {
factory,
Expand All @@ -156,7 +157,7 @@ impl<F: RootsWorkFactory> ScanBootImageRoots<F> {
}
}

impl<F: RootsWorkFactory> GCWork<JikesRVM> for ScanBootImageRoots<F> {
impl<F: RootsWorkFactory<JikesRVMEdge>> GCWork<JikesRVM> for ScanBootImageRoots<F> {
fn do_work(&mut self, _worker: &mut GCWorker<JikesRVM>, _mmtk: &'static MMTK<JikesRVM>) {
scan_boot_image(
OpaquePointer::UNINITIALIZED,
Expand Down
Loading