Struct mmtk::util::reference_processor::ReferenceProcessors
source · pub struct ReferenceProcessors {
soft: ReferenceProcessor,
weak: ReferenceProcessor,
phantom: ReferenceProcessor,
}
Expand description
Holds all reference processors for each weak reference Semantics. Currently this is based on Java’s weak reference semantics (soft/weak/phantom). We should make changes to make this general rather than Java specific.
Fields§
§soft: ReferenceProcessor
§weak: ReferenceProcessor
§phantom: ReferenceProcessor
Implementations§
source§impl ReferenceProcessors
impl ReferenceProcessors
pub fn new() -> Self
pub fn get(&self, semantics: Semantics) -> &ReferenceProcessor
pub fn add_soft_candidate(&self, reff: ObjectReference)
pub fn add_weak_candidate(&self, reff: ObjectReference)
pub fn add_phantom_candidate(&self, reff: ObjectReference)
sourcepub fn enqueue_refs<VM: VMBinding>(&self, tls: VMWorkerThread)
pub fn enqueue_refs<VM: VMBinding>(&self, tls: VMWorkerThread)
This will invoke enqueue for each reference processor, which will call back to the VM to enqueue references whose referents are cleared in this GC.
sourcepub fn forward_refs<E: ProcessEdgesWork>(
&self,
trace: &mut E,
mmtk: &'static MMTK<E::VM>
)
pub fn forward_refs<E: ProcessEdgesWork>( &self, trace: &mut E, mmtk: &'static MMTK<E::VM> )
A separate reference forwarding step. Normally when we scan refs, we deal with forwarding. However, for some plans like mark compact, at the point we do ref scanning, we do not know the forwarding addresses yet, thus we cannot do forwarding during scan refs. And for those plans, this separate step is required.
pub fn retain_soft_refs<E: ProcessEdgesWork>( &self, trace: &mut E, mmtk: &'static MMTK<E::VM> )
sourcepub fn scan_soft_refs<VM: VMBinding>(&self, mmtk: &'static MMTK<VM>)
pub fn scan_soft_refs<VM: VMBinding>(&self, mmtk: &'static MMTK<VM>)
Scan soft references.
sourcepub fn scan_weak_refs<VM: VMBinding>(&self, mmtk: &'static MMTK<VM>)
pub fn scan_weak_refs<VM: VMBinding>(&self, mmtk: &'static MMTK<VM>)
Scan weak references.
sourcepub fn scan_phantom_refs<VM: VMBinding>(&self, mmtk: &'static MMTK<VM>)
pub fn scan_phantom_refs<VM: VMBinding>(&self, mmtk: &'static MMTK<VM>)
Scan phantom references.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for ReferenceProcessors
impl Send for ReferenceProcessors
impl Sync for ReferenceProcessors
impl Unpin for ReferenceProcessors
impl UnwindSafe for ReferenceProcessors
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
Mutably borrows from an owned value. Read more
§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>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<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>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
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)
Convert
&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)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§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>
Converts
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>
Converts
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