Skip to content

Fix ImmixSpace liveness check #552

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
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
21 changes: 20 additions & 1 deletion src/policy/immix/immixspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use crate::util::heap::HeapMeta;
use crate::util::heap::PageResource;
use crate::util::heap::VMRequest;
use crate::util::metadata::side_metadata::{self, *};
use crate::util::metadata::{self, compare_exchange_metadata, load_metadata, MetadataSpec};
use crate::util::metadata::{self, compare_exchange_metadata, load_metadata, MetadataSpec, store_metadata};
use crate::util::object_forwarding as ForwardingWord;
use crate::util::{Address, ObjectReference};
use crate::vm::*;
Expand Down Expand Up @@ -87,6 +87,15 @@ impl<VM: VMBinding> SFT for ImmixSpace<VM> {
) -> ObjectReference {
panic!("We do not use SFT to trace objects for Immix. sft_trace_object() cannot be used.")
}
#[inline(always)]
fn get_forwarded_object(&self, object: ObjectReference) -> Option<ObjectReference> {
debug_assert!(!object.is_null());
if ForwardingWord::is_forwarded::<VM>(object) {
Some(ForwardingWord::read_forwarding_pointer::<VM>(object))
} else {
None
}
}
}

impl<VM: VMBinding> Space<VM> for ImmixSpace<VM> {
Expand Down Expand Up @@ -649,6 +658,16 @@ impl<VM: VMBinding> PolicyCopyContext for ImmixCopyContext<VM> {
self.copy_allocator.alloc(bytes, align, offset)
}
}
#[inline(always)]
fn post_copy(&mut self, object: ObjectReference, _bytes: usize) {
store_metadata::<VM>(
&VM::VMObjectModel::LOCAL_MARK_BIT_SPEC,
object,
self.defrag_allocator.immix_space().mark_state as _,
None,
None,
);
}
}

impl<VM: VMBinding> ImmixCopyContext<VM> {
Expand Down