< prev index next >
src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp
Print this page
@@ -29,10 +29,11 @@
#include "gc_implementation/g1/g1Allocator.hpp"
#include "gc_implementation/g1/concurrentMark.hpp"
#include "gc_implementation/g1/evacuationInfo.hpp"
#include "gc_implementation/g1/g1AllocRegion.hpp"
#include "gc_implementation/g1/g1BiasedArray.hpp"
+#include "gc_implementation/g1/g1CollectorState.hpp"
#include "gc_implementation/g1/g1HRPrinter.hpp"
#include "gc_implementation/g1/g1InCSetState.hpp"
#include "gc_implementation/g1/g1MonitoringSupport.hpp"
#include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
#include "gc_implementation/g1/g1YCTypes.hpp"
@@ -325,19 +326,21 @@
// (a) cause == _gc_locker and +GCLockerInvokesConcurrent, or
// (b) cause == _java_lang_system_gc and +ExplicitGCInvokesConcurrent.
// (c) cause == _g1_humongous_allocation
bool should_do_concurrent_full_gc(GCCause::Cause cause);
+ // indicates whether we are in young or mixed GC mode
+ G1CollectorState _collector_state;
+
// Keeps track of how many "old marking cycles" (i.e., Full GCs or
// concurrent cycles) we have started.
volatile uint _old_marking_cycles_started;
// Keeps track of how many "old marking cycles" (i.e., Full GCs or
// concurrent cycles) we have completed.
volatile uint _old_marking_cycles_completed;
- bool _concurrent_cycle_started;
bool _heap_summary_sent;
// This is a non-product method that is helpful for testing. It is
// called at the end of a GC and artificially expands the heap by
// allocating a number of dead regions. This way we can induce very
@@ -788,11 +791,10 @@
void abandon_collection_set(HeapRegion* cs_head);
// The concurrent marker (and the thread it runs in.)
ConcurrentMark* _cm;
ConcurrentMarkThread* _cmThread;
- bool _mark_in_progress;
// The concurrent refiner.
ConcurrentG1Refine* _cg1r;
// The parallel task queues
@@ -1019,10 +1021,12 @@
virtual Name kind() const {
return CollectedHeap::G1CollectedHeap;
}
+ G1CollectorState* collector_state() { return &_collector_state; }
+
// The current policy object for the collector.
G1CollectorPolicy* g1_policy() const { return _g1_policy; }
virtual CollectorPolicy* collector_policy() const { return (CollectorPolicy*) g1_policy(); }
@@ -1399,21 +1403,10 @@
// Set the mod union bits corresponding to the given memRegion. Note
// that this is always a safe operation, since it doesn't clear any
// bits.
void markModUnionRange(MemRegion mr);
- // Records the fact that a marking phase is no longer in progress.
- void set_marking_complete() {
- _mark_in_progress = false;
- }
- void set_marking_started() {
- _mark_in_progress = true;
- }
- bool mark_in_progress() {
- return _mark_in_progress;
- }
-
// Print the maximum heap capacity.
virtual size_t max_capacity() const;
virtual jlong millis_since_last_gc();
@@ -1525,14 +1518,11 @@
// Verification
// The following is just to alert the verification code
// that a full collection has occurred and that the
// remembered sets are no longer up to date.
- bool _full_collection;
- void set_full_collection() { _full_collection = true;}
- void clear_full_collection() {_full_collection = false;}
- bool full_collection() {return _full_collection;}
+ bool full_collection() { return collector_state()->full_collection(); }
// Perform any cleanup actions necessary before allowing a verification.
virtual void prepare_for_verify();
// Perform verification.
< prev index next >