class OopStack; class ReferenceProcessor; class ParallelScavengeHeap; class ParallelScavengeTracer; class PSIsAliveClosure; class PSRefProcTaskExecutor; class STWGCTimer;
class PSScavenge: AllStatic { friendclass PSIsAliveClosure; friendclass PSKeepAliveClosure; friendclass PSPromotionManager;
protected: // Flags/counters static SpanSubjectToDiscoveryClosure _span_based_discoverer; static ReferenceProcessor* _ref_processor; // Reference processor for scavenging. static PSIsAliveClosure _is_alive_closure; // Closure used for reference processing static PSCardTable* _card_table; // We cache the card table for fast access. staticbool _survivor_overflow; // Overflow this collection static uint _tenuring_threshold; // tenuring threshold for next scavenge static elapsedTimer _accumulated_time; // total time spent on scavenge static STWGCTimer _gc_timer; // GC time book keeper static ParallelScavengeTracer _gc_tracer; // GC tracing // The lowest address possible for the young_gen. // This is used to decide if an oop should be scavenged, // cards should be marked, etc. static HeapWord* _young_generation_boundary; // Used to optimize compressed oops young gen boundary checking. static uintptr_t _young_generation_boundary_compressed; static CollectorCounters* _counters; // collector performance counters
staticvoid set_subject_to_discovery_span(MemRegion mr) {
_span_based_discoverer.set_span(mr);
} // Used by scavenge_contents static ReferenceProcessor* const reference_processor() {
assert(_ref_processor != NULL, "Sanity"); return _ref_processor;
} // The promotion managers tell us if they encountered overflow staticvoid set_survivor_overflow(bool state) {
_survivor_overflow = state;
} // Adaptive size policy support. staticvoid set_young_generation_boundary(HeapWord* v);
// Called by parallelScavengeHeap to init the tenuring threshold staticvoid initialize();
// Scavenge entry point. This may invoke a full gc; return true if so. staticbool invoke(); // Return true if a collection was done; false otherwise. staticbool invoke_no_policy();
// These call should_scavenge() above and, if it returns true, also check that // the object was not newly copied into to_space. The version with the bool // argument is a convenience wrapper that fetches the to_space pointer from // the heap and calls the other version (if the arg is true). template <class T> staticinlinebool should_scavenge(T* p, MutableSpace* to_space); template <class T> staticinlinebool should_scavenge(T* p, bool check_to_space);
// Is an object in the young generation // This assumes that the 'o' is in the heap, // so it only checks one side of the complete predicate.