// Find the default mark bitmap. void FindDefaultSpaceBitmap() REQUIRES_SHARED(Locks::mutator_lock_);
// Marks all objects in the root set at the start of a garbage collection. void MarkRoots(Thread* self)
REQUIRES(Locks::heap_bitmap_lock_)
REQUIRES(!mark_stack_lock_)
REQUIRES_SHARED(Locks::mutator_lock_);
// Builds a mark stack and recursively mark until it empties. void RecursiveMark()
REQUIRES(Locks::heap_bitmap_lock_)
REQUIRES(!mark_stack_lock_)
REQUIRES_SHARED(Locks::mutator_lock_);
// Bind the live bits to the mark bits of bitmaps for spaces that are never collected, ie // the image. Mark that portion of the heap as immune. virtualvoid BindBitmaps() REQUIRES_SHARED(Locks::mutator_lock_);
// Builds a mark stack with objects on dirty cards and recursively mark until it empties. void RecursiveMarkDirtyObjects(bool paused, uint8_t minimum_age)
REQUIRES(Locks::heap_bitmap_lock_)
REQUIRES(!mark_stack_lock_)
REQUIRES_SHARED(Locks::mutator_lock_);
// Remarks the root set after completing the concurrent mark. void ReMarkRoots()
REQUIRES(Locks::heap_bitmap_lock_)
REQUIRES(!mark_stack_lock_)
REQUIRES_SHARED(Locks::mutator_lock_);
// Update and mark references from immune spaces. void UpdateAndMarkModUnion()
REQUIRES(!mark_stack_lock_)
REQUIRES_SHARED(Locks::mutator_lock_);
// Pre clean cards to reduce how much work is needed in the pause. void PreCleanCards()
REQUIRES(Locks::heap_bitmap_lock_)
REQUIRES(!mark_stack_lock_)
REQUIRES_SHARED(Locks::mutator_lock_);
// Sweeps unmarked objects to complete the garbage collection. Virtual as by default it sweeps // all allocation spaces. Partial and sticky GCs want to just sweep a subset of the heap. virtualvoid Sweep(bool swap_bitmaps)
REQUIRES(Locks::heap_bitmap_lock_)
REQUIRES_SHARED(Locks::mutator_lock_);
// Sweeps unmarked objects to complete the garbage collection. void SweepLargeObjects(bool swap_bitmaps) REQUIRES(Locks::heap_bitmap_lock_);
// Verify that an object is live, either in a live bitmap or in the allocation stack. void VerifyIsLive(const mirror::Object* obj)
REQUIRES_SHARED(Locks::mutator_lock_, Locks::heap_bitmap_lock_);
// Schedules an unmarked object for reference processing. void DelayReferenceReferent(ObjPtr<mirror::Class> klass, ObjPtr<mirror::Reference> reference)
override REQUIRES_SHARED(Locks::heap_bitmap_lock_, Locks::mutator_lock_);
protected: // Returns object if the object is marked in the heap bitmap, otherwise null.
mirror::Object* IsMarked(mirror::Object* object) override
REQUIRES_SHARED(Locks::heap_bitmap_lock_, Locks::mutator_lock_);
// Marks an object atomically, safe to use from multiple threads. void MarkObjectNonNullParallel(mirror::Object* obj)
REQUIRES(!mark_stack_lock_)
REQUIRES_SHARED(Locks::mutator_lock_);
// Returns true if we need to add obj to a mark stack. bool MarkObjectParallel(mirror::Object* obj) NO_THREAD_SAFETY_ANALYSIS;
// Verify the roots of the heap and print out information related to any invalid roots. // Called in MarkObject, so may we may not hold the mutator lock. void VerifySuspendedThreadRoots(std::ostream& os)
REQUIRES_SHARED(Locks::mutator_lock_);
// Expand mark stack to 2x its current size. void ExpandMarkStack()
REQUIRES(mark_stack_lock_)
REQUIRES_SHARED(Locks::mutator_lock_);
// Returns how many threads we should use for the current GC phase based on if we are paused, // whether or not we care about pauses.
size_t GetThreadCount(bool paused) const;
// Push a single reference on a mark stack. void PushOnMarkStack(mirror::Object* obj)
REQUIRES(!mark_stack_lock_)
REQUIRES_SHARED(Locks::mutator_lock_);
// Blackens objects grayed during a garbage collection. void ScanGrayObjects(bool paused, uint8_t minimum_age)
REQUIRES(Locks::heap_bitmap_lock_)
REQUIRES(!mark_stack_lock_)
REQUIRES_SHARED(Locks::mutator_lock_);
// Recursively blackens objects on the mark stack. void ProcessMarkStack(bool paused)
REQUIRES(Locks::heap_bitmap_lock_)
REQUIRES(!mark_stack_lock_)
REQUIRES_SHARED(Locks::mutator_lock_);
// Used to Get around thread safety annotations. The call is from MarkingPhase and is guarded by // IsExclusiveHeld. void RevokeAllThreadLocalAllocationStacks(Thread* self) NO_THREAD_SAFETY_ANALYSIS;
// Revoke all the thread-local buffers. void RevokeAllThreadLocalBuffers() override;
// Whether or not we count how many of each type of object were scanned. static constexpr bool kCountScannedTypes = false;
// Current space, we check this space first to avoid searching for the appropriate space for an // object.
accounting::ContinuousSpaceBitmap* current_space_bitmap_; // Cache the heap's mark bitmap to prevent having to do 2 loads during slow path marking.
accounting::HeapBitmap* mark_bitmap_;
accounting::ObjectStack* mark_stack_;
// Every object inside the immune spaces is assumed to be marked. Immune spaces that aren't in the // immune region are handled by the normal marking logic.
ImmuneSpaces immune_spaces_;
// Parallel finger.
AtomicInteger atomic_finger_;
AtomicInteger no_reference_class_count_;
AtomicInteger normal_count_; // Number of classes scanned, if kCountScannedTypes.
AtomicInteger class_count_; // Number of object arrays scanned, if kCountScannedTypes.
AtomicInteger object_array_count_; // Number of non-class/arrays scanned, if kCountScannedTypes.
AtomicInteger other_count_; // Number of java.lang.ref.Reference instances.
AtomicInteger reference_count_;
private: class CardScanTask; class CheckpointMarkThreadRoots; class DelayReferenceReferentVisitor; template<bool kUseFinger> class MarkStackTask; class MarkObjectSlowPath; class RecursiveMarkTask; class ScanObjectParallelVisitor; class ScanObjectVisitor; class VerifyRootMarkedVisitor; class VerifyRootVisitor; class VerifySystemWeakVisitor;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.