--- old/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp 2015-05-12 17:05:55.297355431 -0400 +++ new/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp 2015-05-12 17:05:55.153347163 -0400 @@ -31,6 +31,7 @@ #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" @@ -326,6 +327,9 @@ // (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. @@ -335,7 +339,6 @@ // 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 @@ -790,7 +793,6 @@ // The concurrent marker (and the thread it runs in.) ConcurrentMark* _cm; ConcurrentMarkThread* _cmThread; - bool _mark_in_progress; // The concurrent refiner. ConcurrentG1Refine* _cg1r; @@ -1021,11 +1023,13 @@ 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(); } - + // Adaptive size policy. No such thing for g1. virtual AdaptiveSizePolicy* size_policy() { return NULL; } @@ -1401,17 +1405,6 @@ // 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; @@ -1527,10 +1520,7 @@ // 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();