diff --git a/mmtk/src/julia_scanning.rs b/mmtk/src/julia_scanning.rs index 39b1526..3fde85a 100644 --- a/mmtk/src/julia_scanning.rs +++ b/mmtk/src/julia_scanning.rs @@ -138,6 +138,11 @@ unsafe fn scan_julia_hidden_ptr_n( // INFO: *_custom() functions are acessors to bitfields that do not use bindgen generated code. #[inline(always)] pub unsafe fn scan_julia_object>(obj: Address, closure: &mut SV) { + if crate::object_model::is_addr_in_immortalspace(obj) { + // immortal space objects do not need to be scanned + return; + } + // get Julia object type let mut vtag = mmtk_jl_typetagof(obj); let mut vtag_usize = vtag.as_usize(); diff --git a/mmtk/src/object_model.rs b/mmtk/src/object_model.rs index d1317fe..cb465fb 100644 --- a/mmtk/src/object_model.rs +++ b/mmtk/src/object_model.rs @@ -318,6 +318,11 @@ pub fn is_object_in_nonmoving(object: &ObjectReference) -> bool { && (*object).to_raw_address().as_usize() < 0xa00_0000_0000 } +#[inline(always)] +pub fn is_addr_in_immortalspace(addr: Address) -> bool { + addr.as_usize() >= 0x400_0000_0000 && addr.as_usize() < 0x600_0000_0000 +} + // If an object has its type tag bits set as 'smalltag', but those bits are not recognizable, // very possibly the object is corrupted. This function asserts this case. pub fn assert_generic_datatype(obj: Address) {