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
4 changes: 2 additions & 2 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 @@ -37,7 +37,7 @@ features = ["is_mmtk_object", "object_pinning"]

# Uncomment the following lines to use mmtk-core from the official repository.
git = "https://github.com/mmtk/mmtk-core.git"
rev = "dccce9063b57dde96d2e97670297aed4dc32e6e1"
rev = "56b2521d2b99848ee0613a0a5288fe6d81b754ba"

# Uncomment the following line to use mmtk-core from a local repository.
# path = "../../mmtk-core"
Expand Down
14 changes: 7 additions & 7 deletions mmtk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use std::thread::ThreadId;

use abi::RubyUpcalls;
use binding::{RubyBinding, RubyBindingFast, RubyBindingFastMut};
use mmtk::vm::edge_shape::{SimpleEdge, UnimplementedMemorySlice};
use mmtk::vm::slot::{SimpleSlot, UnimplementedMemorySlice};
use mmtk::vm::VMBinding;
use mmtk::MMTK;
use once_cell::sync::OnceCell;
Expand All @@ -31,15 +31,15 @@ pub mod weak_proc;
#[derive(Default)]
pub struct Ruby;

/// Ruby edge type, i.e. a slot that holds a VALUE.
/// Currently we use SimpleEdge.
/// It doesn't matter, becaues we have not started using edge-enqueuing, yet.
pub type RubyEdge = SimpleEdge;
/// Ruby slot type, i.e. a slot that holds a VALUE.
/// Currently we use SimpleSlot.
/// It doesn't matter, becaues we have not started using slot-enqueuing, yet.
pub type RubySlot = SimpleSlot;

/// Ruby memory slice, i.e. an array of VALUEs.
/// It is used by array-copy barriers which is supposed to perform bettern than copying array
/// elements one by one. At this moment, we just leave it unimplemented.
pub type RubyMemorySlice = UnimplementedMemorySlice<RubyEdge>;
pub type RubyMemorySlice = UnimplementedMemorySlice<RubySlot>;

impl VMBinding for Ruby {
type VMObjectModel = object_model::VMObjectModel;
Expand All @@ -48,7 +48,7 @@ impl VMBinding for Ruby {
type VMActivePlan = active_plan::VMActivePlan;
type VMReferenceGlue = reference_glue::VMReferenceGlue;

type VMEdge = RubyEdge;
type VMSlot = RubySlot;
type VMMemorySlice = RubyMemorySlice;
}

Expand Down
18 changes: 9 additions & 9 deletions mmtk/src/scanning.rs
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
use crate::abi::GCThreadTLS;

use crate::{upcalls, Ruby, RubyEdge};
use crate::{upcalls, Ruby, RubySlot};
use mmtk::scheduler::GCWorker;
use mmtk::util::{ObjectReference, VMWorkerThread};
use mmtk::vm::{EdgeVisitor, ObjectTracer, RootsWorkFactory, Scanning};
use mmtk::vm::{ObjectTracer, RootsWorkFactory, Scanning, SlotVisitor};
use mmtk::{Mutator, MutatorContext};

pub struct VMScanning {}

impl Scanning<Ruby> for VMScanning {
fn support_edge_enqueuing(_tls: VMWorkerThread, _object: ObjectReference) -> bool {
fn support_slot_enqueuing(_tls: VMWorkerThread, _object: ObjectReference) -> bool {
false
}

fn scan_object<EV: EdgeVisitor<RubyEdge>>(
fn scan_object<EV: SlotVisitor<RubySlot>>(
_tls: VMWorkerThread,
_object: ObjectReference,
_edge_visitor: &mut EV,
_slot_visitor: &mut EV,
) {
unreachable!("We have not enabled edge enqueuing for any types, yet.");
unreachable!("We have not enabled slot enqueuing for any types, yet.");
}

fn scan_object_and_trace_edges<OT: ObjectTracer>(
Expand Down Expand Up @@ -66,15 +66,15 @@ impl Scanning<Ruby> for VMScanning {
fn scan_roots_in_mutator_thread(
tls: VMWorkerThread,
mutator: &'static mut Mutator<Ruby>,
mut factory: impl RootsWorkFactory<RubyEdge>,
mut factory: impl RootsWorkFactory<RubySlot>,
) {
let gc_tls = unsafe { GCThreadTLS::from_vwt_check(tls) };
Self::collect_object_roots_in("scan_thread_root", gc_tls, &mut factory, || {
(upcalls().scan_roots_in_mutator_thread)(mutator.get_tls(), tls);
});
}

fn scan_vm_specific_roots(tls: VMWorkerThread, mut factory: impl RootsWorkFactory<RubyEdge>) {
fn scan_vm_specific_roots(tls: VMWorkerThread, mut factory: impl RootsWorkFactory<RubySlot>) {
let gc_tls = unsafe { GCThreadTLS::from_vwt_check(tls) };
Self::collect_object_roots_in("scan_vm_specific_roots", gc_tls, &mut factory, || {
(upcalls().scan_vm_specific_roots)();
Expand Down Expand Up @@ -114,7 +114,7 @@ impl VMScanning {
fn collect_object_roots_in<F: FnMut()>(
root_scan_kind: &str,
gc_tls: &mut GCThreadTLS,
factory: &mut impl RootsWorkFactory<RubyEdge>,
factory: &mut impl RootsWorkFactory<RubySlot>,
callback: F,
) {
let mut buffer: Vec<ObjectReference> = Vec::new();
Expand Down