Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
d00e4c6
Support for object pinning
udesou Nov 21, 2022
00a33f2
Adding pinning metadata to immix space side metadata specs; Returning…
udesou Nov 22, 2022
a062970
Proper semantics for pin/unpin; Fixing checks in immixspace.
udesou Nov 23, 2022
dd0a28b
Applying discussed semantics for pinning/unpinning
udesou Nov 30, 2022
b56af7d
Merge branch 'mmtk:master' into feature/pinning-objects
udesou Nov 30, 2022
b574a75
Updating to latest master
udesou Nov 30, 2022
66e2709
Adding support for tracing 'red roots'
udesou Dec 1, 2022
38d2f6e
Minor fix
udesou Dec 1, 2022
b86b321
Fixing object model for DummyVM
udesou Dec 1, 2022
8e99228
Merge branch 'master' into feature/pinning-objects
udesou Dec 1, 2022
c013513
Fixing clippy issues
udesou Dec 1, 2022
2ded32d
Merge branch 'feature/pinning-objects' of https://github.com/udesou/m…
udesou Dec 1, 2022
235f83a
Converting object pinning into a feature
udesou Dec 2, 2022
13accdb
Renaming object-pinning => object_pinning
udesou Dec 2, 2022
b73d892
Merge branch 'master' into feature/pinning-objects
qinsoon Dec 2, 2022
57f5dcb
Removing assertion that was useful if pin bin happens to be the same …
udesou Dec 5, 2022
0dedd14
Revert "Minor fix"
udesou Dec 5, 2022
a915c22
Revert "Adding support for tracing 'red roots'"
udesou Dec 5, 2022
72bc39d
Merge branch 'feature/pinning-objects' into feature/object-moving
udesou Dec 5, 2022
3fe039d
Refactoring support for red roots
udesou Dec 5, 2022
c1feb58
Merge branch 'master' into feature/object-moving
udesou Dec 6, 2022
86ffdcf
Adding pinning methods to native ms space
udesou Dec 6, 2022
23090bb
Merge branch 'master' into feature/object-moving
udesou Dec 6, 2022
45209c0
Merge branch 'master' into feature/object-moving
qinsoon Jun 26, 2023
dc0582b
Merge remote-tracking branch 'upstream/master' into feature/object-mo…
udesou Aug 1, 2023
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
16 changes: 11 additions & 5 deletions src/plan/generational/gc_work.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,13 @@ impl<VM: VMBinding, P: GenerationalPlanExt<VM> + PlanTraceObject<VM>> ProcessEdg
type VM = VM;
type ScanObjectsWorkType = PlanScanObjects<Self, P>;

fn new(edges: Vec<EdgeOf<Self>>, roots: bool, mmtk: &'static MMTK<VM>) -> Self {
let base = ProcessEdgesBase::new(edges, roots, mmtk);
fn new(
edges: Vec<EdgeOf<Self>>,
roots: bool,
mmtk: &'static MMTK<VM>,
is_immovable: bool,
) -> Self {
let base = ProcessEdgesBase::new(edges, roots, mmtk, is_immovable);
let plan = base.plan().downcast_ref().unwrap();
Self { plan, base }
}
Expand All @@ -50,8 +55,9 @@ impl<VM: VMBinding, P: GenerationalPlanExt<VM> + PlanTraceObject<VM>> ProcessEdg
&self,
nodes: Vec<ObjectReference>,
roots: bool,
is_immovable: bool
) -> Self::ScanObjectsWorkType {
PlanScanObjects::new(self.plan, nodes, false, roots)
PlanScanObjects::new(self.plan, nodes, false, roots, is_immovable)
}
}

Expand Down Expand Up @@ -106,7 +112,7 @@ impl<E: ProcessEdgesWork> GCWork<E::VM> for ProcessModBuf<E> {
// Scan objects in the modbuf and forward pointers
let modbuf = std::mem::take(&mut self.modbuf);
GCWork::do_work(
&mut ScanObjects::<E>::new(modbuf, false, false),
&mut ScanObjects::<E>::new(modbuf, false, false, false),
worker,
mmtk,
)
Expand Down Expand Up @@ -144,7 +150,7 @@ impl<E: ProcessEdgesWork> GCWork<E::VM> for ProcessRegionModBuf<E> {
}
}
// Forward entries
GCWork::do_work(&mut E::new(edges, false, mmtk), worker, mmtk)
GCWork::do_work(&mut E::new(edges, false, mmtk, false), worker, mmtk)
}
}
}
19 changes: 14 additions & 5 deletions src/plan/tracing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,23 +75,32 @@ impl ObjectQueue for VectorQueue<ObjectReference> {
pub struct ObjectsClosure<'a, E: ProcessEdgesWork> {
buffer: VectorQueue<EdgeOf<E>>,
worker: &'a mut GCWorker<E::VM>,
is_immovable: bool,
}

impl<'a, E: ProcessEdgesWork> ObjectsClosure<'a, E> {
pub fn new(worker: &'a mut GCWorker<E::VM>) -> Self {
pub fn new(worker: &'a mut GCWorker<E::VM>, is_immovable: bool) -> Self {
Self {
buffer: VectorQueue::new(),
worker,
is_immovable,
}
}

fn flush(&mut self) {
let buf = self.buffer.take();
if !buf.is_empty() {
self.worker.add_work(
WorkBucketStage::Closure,
E::new(buf, false, self.worker.mmtk),
);
if self.is_immovable {
self.worker.add_work(
WorkBucketStage::ClosureImmovable,
E::new(buf, false, self.worker.mmtk, true),
);
} else {
self.worker.add_work(
WorkBucketStage::Closure,
E::new(buf, false, self.worker.mmtk, false),
);
}
}
}
}
Expand Down
12 changes: 12 additions & 0 deletions src/policy/immortalspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,18 @@ impl<VM: VMBinding> SFT for ImmortalSpace<VM> {
fn is_object_pinned(&self, _object: ObjectReference) -> bool {
true
}
#[cfg(feature = "object_pinning")]
fn pin_object(&self, _object: ObjectReference) -> bool {
false
}
#[cfg(feature = "object_pinning")]
fn unpin_object(&self, _object: ObjectReference) -> bool {
false
}
#[cfg(feature = "object_pinning")]
fn is_object_pinned(&self, _object: ObjectReference) -> bool {
true
}
fn is_movable(&self) -> bool {
false
}
Expand Down
Loading