pub struct LargeObjectSpace<VM: VMBinding> {
common: CommonSpace<VM>,
pr: FreeListPageResource<VM>,
mark_state: u8,
in_nursery_gc: bool,
treadmill: TreadMill,
clear_log_bit_on_sweep: bool,
pub num_pages_released_lazy: AtomicUsize,
pub rc_enabled: bool,
pub(crate) rc: RefCountHelper<VM>,
pub is_end_of_satb_or_full_gc: bool,
pub(crate) bump_page_reuse_count: AtomicBool,
}Expand description
This type implements a policy for large objects. Each instance corresponds to one Treadmill space.
Fields§
§common: CommonSpace<VM>§pr: FreeListPageResource<VM>§mark_state: u8§in_nursery_gc: bool§treadmill: TreadMill§clear_log_bit_on_sweep: bool§num_pages_released_lazy: AtomicUsize§rc_enabled: bool§rc: RefCountHelper<VM>§is_end_of_satb_or_full_gc: bool§bump_page_reuse_count: AtomicBoolWhether newly allocated LOS objects should bump LOS_PAGE_REUSE_COUNT on their pages, so
remembered-set entries recorded against a page’s previous occupant are invalidated. Only
needed while concurrent marking can be validating a remembered set; set/cleared by the
owning plan (currently only LXR) as concurrent marking starts/ends.
Implementations§
Source§impl<VM: VMBinding> LargeObjectSpace<VM>
impl<VM: VMBinding> LargeObjectSpace<VM>
pub fn new( args: PlanCreateSpaceArgs<'_, VM>, protect_memory_on_release: bool, clear_log_bit_on_sweep: bool, ) -> Self
fn release_object(&self, object: ObjectReference) -> usize
pub fn release_rc_nursery_objects(&self)
pub fn prepare(&mut self, full_heap: bool)
pub fn release(&mut self, full_heap: bool)
pub fn trace_object<Q: ObjectQueue>( &self, queue: &mut Q, object: ObjectReference, ) -> ObjectReference
fn sweep_large_pages(&mut self, sweep_nursery: bool)
Sourcepub(crate) fn enumerate_to_space_objects(
&self,
enumerator: &mut dyn ObjectEnumerator,
)
pub(crate) fn enumerate_to_space_objects( &self, enumerator: &mut dyn ObjectEnumerator, )
Enumerate objects in the to-space. It is a workaround for OVC which currently needs to enumerate reachable objects for during reference forwarding.
Sourcepub fn allocate_pages(
&self,
tls: VMThread,
pages: usize,
alloc_options: AllocationOptions,
) -> Address
pub fn allocate_pages( &self, tls: VMThread, pages: usize, alloc_options: AllocationOptions, ) -> Address
Allocate an object
pub fn attempt_mark(&self, object: ObjectReference) -> bool
pub fn rc_free(&self, o: ObjectReference)
Sourcefn test_and_mark(&self, object: ObjectReference, value: u8) -> bool
fn test_and_mark(&self, object: ObjectReference, value: u8) -> bool
Test if the object’s mark bit is the same as the given value. If it is not the same, the method will attemp to mark the object and clear its nursery bit. If the attempt succeeds, the method will return true, meaning the object is marked by this invocation. Otherwise, it returns false.
fn test_mark_bit(&self, object: ObjectReference, value: u8) -> bool
Sourcefn is_in_nursery(&self, object: ObjectReference) -> bool
fn is_in_nursery(&self, object: ObjectReference) -> bool
Check if a given object is in nursery
pub fn sweep_rc_mature_objects_after_satb( &self, is_live: &impl Fn(ObjectReference) -> bool, )
pub fn is_marked(&self, object: ObjectReference) -> bool
Trait Implementations§
Source§impl<VM: VMBinding> PolicyTraceObject<VM> for LargeObjectSpace<VM>
impl<VM: VMBinding> PolicyTraceObject<VM> for LargeObjectSpace<VM>
Source§fn trace_object<Q: ObjectQueue, const KIND: u8>(
&self,
queue: &mut Q,
object: ObjectReference,
_copy: Option<CopySemantics>,
_worker: &mut GCWorker<VM>,
) -> ObjectReference
fn trace_object<Q: ObjectQueue, const KIND: u8>( &self, queue: &mut Q, object: ObjectReference, _copy: Option<CopySemantics>, _worker: &mut GCWorker<VM>, ) -> ObjectReference
copy to be a Some value.Source§fn may_move_objects<const KIND: u8>() -> bool
fn may_move_objects<const KIND: u8>() -> bool
Source§fn post_scan_object(&self, _object: ObjectReference)
fn post_scan_object(&self, _object: ObjectReference)
Source§impl<VM: VMBinding> SFT for LargeObjectSpace<VM>
impl<VM: VMBinding> SFT for LargeObjectSpace<VM>
Source§fn is_live(&self, object: ObjectReference) -> bool
fn is_live(&self, object: ObjectReference) -> bool
Source§fn is_reachable(&self, object: ObjectReference) -> bool
fn is_reachable(&self, object: ObjectReference) -> bool
is_live = true but are actually unreachable.Source§fn pin_object(&self, _object: ObjectReference) -> bool
fn pin_object(&self, _object: ObjectReference) -> bool
Source§fn unpin_object(&self, _object: ObjectReference) -> bool
fn unpin_object(&self, _object: ObjectReference) -> bool
Source§fn is_object_pinned(&self, _object: ObjectReference) -> bool
fn is_object_pinned(&self, _object: ObjectReference) -> bool
Source§fn is_movable(&self) -> bool
fn is_movable(&self) -> bool
Source§fn is_sane(&self) -> bool
fn is_sane(&self) -> bool
Source§fn initialize_object_metadata(&self, object: ObjectReference, bytes: usize)
fn initialize_object_metadata(&self, object: ObjectReference, bytes: usize)
Source§fn is_mmtk_object(&self, addr: Address) -> Option<ObjectReference>
fn is_mmtk_object(&self, addr: Address) -> Option<ObjectReference>
addr a valid object reference to an object allocated in this space?
This default implementation works for all spaces that use MMTk’s mapper to allocate memory.
Some spaces, like MallocSpace, use third-party libraries to allocate memory.
Such spaces needs to override this method.fn find_object_from_internal_pointer( &self, ptr: Address, max_search_bytes: usize, ) -> Option<ObjectReference>
Source§fn sft_trace_object(
&self,
queue: &mut Option<ObjectReference>,
object: ObjectReference,
_worker: GCWorkerMutRef<'_>,
) -> ObjectReference
fn sft_trace_object( &self, queue: &mut Option<ObjectReference>, object: ObjectReference, _worker: GCWorkerMutRef<'_>, ) -> ObjectReference
crate::plan::tracing::SFTTrace
provides an easy way for most plans to trace objects without the need to implement any plan-specific
code. However, tracing objects for some policies are more complicated, and they do not provide an
implementation of this method. For example, mark compact space requires trace twice in each GC.
Immix has defrag trace and fast trace.Source§fn debug_print_object_info(&self, object: ObjectReference)
fn debug_print_object_info(&self, object: ObjectReference)
Source§fn get_forwarded_object(
&self,
_object: ObjectReference,
) -> Option<ObjectReference>
fn get_forwarded_object( &self, _object: ObjectReference, ) -> Option<ObjectReference>
Source§fn is_in_space(&self, _object: ObjectReference) -> bool
fn is_in_space(&self, _object: ObjectReference) -> bool
Source§impl<VM: VMBinding> Space<VM> for LargeObjectSpace<VM>
impl<VM: VMBinding> Space<VM> for LargeObjectSpace<VM>
fn as_space(&self) -> &dyn Space<VM>
fn as_sft(&self) -> &(dyn SFT + Sync + 'static)
fn get_page_resource(&self) -> &dyn PageResource<VM>
Source§fn maybe_get_page_resource_mut(&mut self) -> Option<&mut dyn PageResource<VM>>
fn maybe_get_page_resource_mut(&mut self) -> Option<&mut dyn PageResource<VM>>
None if the space does not
have a page resource.Source§fn initialize_sft(&self, sft_map: &mut dyn SFTMap)
fn initialize_sft(&self, sft_map: &mut dyn SFTMap)
fn common(&self) -> &CommonSpace<VM>
fn release_multiple_pages(&mut self, start: Address)
Source§fn enumerate_objects(&self, enumerator: &mut dyn ObjectEnumerator)
fn enumerate_objects(&self, enumerator: &mut dyn ObjectEnumerator)
Source§fn clear_side_log_bits(&self)
fn clear_side_log_bits(&self)
Source§fn set_side_log_bits(&self)
fn set_side_log_bits(&self)
Source§fn initialize_side_metadata(&self)
fn initialize_side_metadata(&self)
fn acquire( &self, tls: VMThread, pages: usize, alloc_options: AllocationOptions, ) -> Address
Source§fn get_new_pages_and_initialize(
&self,
tls: VMThread,
pages: usize,
pr: &dyn PageResource<VM>,
pages_reserved: usize,
) -> Option<Address>
fn get_new_pages_and_initialize( &self, tls: VMThread, pages: usize, pr: &dyn PageResource<VM>, pages_reserved: usize, ) -> Option<Address>
Source§fn not_acquiring(
&self,
tls: VMThread,
alloc_options: AllocationOptions,
pr: &dyn PageResource<VM>,
pages_reserved: usize,
attempted_allocation_and_failed: bool,
)
fn not_acquiring( &self, tls: VMThread, alloc_options: AllocationOptions, pr: &dyn PageResource<VM>, pages_reserved: usize, attempted_allocation_and_failed: bool, )
Space::acquire will not or can not acquire pages from the page
resource. This may happen when Read morefn address_in_space(&self, start: Address) -> bool
fn in_space(&self, object: ObjectReference) -> bool
Source§fn grow_space(&self, start: Address, bytes: usize, new_chunk: bool)
fn grow_space(&self, start: Address, bytes: usize, new_chunk: bool)
Source§fn estimate_side_meta_pages(&self, data_pages: usize) -> usize
fn estimate_side_meta_pages(&self, data_pages: usize) -> usize
fn reserved_pages(&self) -> usize
Source§fn available_physical_pages(&self) -> usize
fn available_physical_pages(&self) -> usize
fn get_name(&self) -> &'static str
fn get_descriptor(&self) -> SpaceDescriptor
fn get_gc_trigger(&self) -> &GCTrigger<VM>
Source§fn set_copy_for_sft_trace(&mut self, _semantics: Option<CopySemantics>)
fn set_copy_for_sft_trace(&mut self, _semantics: Option<CopySemantics>)
crate::plan::tracing::SFTTrace.Source§fn verify_side_metadata_sanity(
&self,
side_metadata_sanity_checker: &mut SideMetadataSanity,
)
fn verify_side_metadata_sanity( &self, side_metadata_sanity_checker: &mut SideMetadataSanity, )
extreme_assertions feature is active.
Internally this calls verify_metadata_context() from util::metadata::sanity Read morefn set_allocate_as_live(&self, live: bool)
fn should_allocate_as_live(&self) -> bool
Auto Trait Implementations§
impl<VM> !Freeze for LargeObjectSpace<VM>
impl<VM> !RefUnwindSafe for LargeObjectSpace<VM>
impl<VM> Send for LargeObjectSpace<VM>
impl<VM> Sync for LargeObjectSpace<VM>
impl<VM> Unpin for LargeObjectSpace<VM>where
VM: Unpin,
impl<VM> !UnwindSafe for LargeObjectSpace<VM>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more