/* * Copyright (c) 2013, 2021, Red Hat, Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. *
*/
class ConcurrentGCTimer; class ObjectIterateScanRootClosure; class ShenandoahCollectorPolicy; class ShenandoahControlThread; class ShenandoahGCSession; class ShenandoahGCStateResetter; class ShenandoahHeuristics; class ShenandoahMarkingContext; class ShenandoahMode; class ShenandoahPhaseTimings; class ShenandoahHeap; class ShenandoahHeapRegion; class ShenandoahHeapRegionClosure; class ShenandoahCollectionSet; class ShenandoahFreeSet; class ShenandoahConcurrentMark; class ShenandoahFullGC; class ShenandoahMonitoringSupport; class ShenandoahPacer; class ShenandoahReferenceProcessor; class ShenandoahVerifier; class ShenandoahWorkerThreads; class VMStructs;
// Used for buffering per-region liveness data. // Needed since ShenandoahHeapRegion uses atomics to update liveness. // The ShenandoahHeap array has max-workers elements, each of which is an array of // uint16_t * max_regions. The choice of uint16_t is not accidental: // there is a tradeoff between static/dynamic footprint that translates // into cache pressure (which is already high during marking), and // too many atomic updates. uint32_t is too large, uint8_t is too small. typedef uint16_t ShenandoahLiveData; #define SHENANDOAH_LIVEDATA_MAX ((ShenandoahLiveData)-1)
class ShenandoahRegionIterator : public StackObj { private:
ShenandoahHeap* _heap;
// Returns next region, or NULL if there are no more regions. // This is multi-thread-safe. inline ShenandoahHeapRegion* next();
// This is *not* MT safe. However, in the absence of multithreaded access, it // can be used to determine if there is more work to do. bool has_next() const;
};
class ShenandoahHeapRegionClosure : public StackObj { public: virtualvoid heap_region_do(ShenandoahHeapRegion* r) = 0; virtualbool is_thread_safe() { returnfalse; }
};
// ---------- GC state machinery // // GC state describes the important parts of collector state, that may be // used to make barrier selection decisions in the native and generated code. // Multiple bits can be set at once. // // Important invariant: when GC state is zero, the heap is stable, and no barriers // are required. // public: enum GCStateBitPos { // Heap has forwarded objects: needs LRB barriers.
HAS_FORWARDED_BITPOS = 0,
// Heap is under marking: needs SATB barriers.
MARKING_BITPOS = 1,
// Heap is under evacuation: needs LRB barriers. (Set together with HAS_FORWARDED)
EVACUATION_BITPOS = 2,
// Heap is under updating: needs no additional barriers.
UPDATEREFS_BITPOS = 3,
// Heap is under weak-reference/roots processing: needs weak-LRB barriers.
WEAK_ROOTS_BITPOS = 4,
};
private: enum CancelState { // Normal state. GC has not been cancelled and is open for cancellation. // Worker threads can suspend for safepoint.
CANCELLABLE,
// GC has been cancelled. Worker threads can not suspend for // safepoint but must finish their work as soon as possible.
CANCELLED,
// GC has not been cancelled and must not be cancelled. At least // one worker thread checks for pending safepoint and may suspend // if a safepoint is pending.
NOT_CANCELLED
};
// ---------- Generic interface hooks // Minor things that super-interface expects us to implement to play nice with // the rest of runtime. Some of the things here are not required to be implemented, // and can be stubbed out. // public:
AdaptiveSizePolicy* size_policy() shenandoah_not_implemented_return(NULL); bool is_maximal_no_gc() const shenandoah_not_implemented_return(false);
// Checks if object is in the collection set. inlinebool in_collection_set(oop obj) const;
// Checks if location is in the collection set. Can be interior pointer, not the oop itself. inlinebool in_collection_set_loc(void* loc) const;
// Evacuates object src. Returns the evacuated object, either evacuated // by this thread, or by some other thread. inline oop evacuate_object(oop src, Thread* thread);
¤ 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.0.15Bemerkung:
(vorverarbeitet am 2026-06-08)
¤
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.