changeset 50161:55f8f5635ef7

8200074: Remove G1ConcurrentMark::_concurrent_marking_in_progress Reviewed-by: sjohanss, sangheki
author tschatzl
date Wed, 04 Apr 2018 11:21:14 +0200
parents 8bad6c08a732
children 8263950638ed
files src/hotspot/share/gc/g1/g1ConcurrentMark.cpp src/hotspot/share/gc/g1/g1ConcurrentMark.hpp
diffstat 2 files changed, 2 insertions(+), 40 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp	Wed Apr 04 11:21:14 2018 +0200
+++ b/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp	Wed Apr 04 11:21:14 2018 +0200
@@ -373,7 +373,6 @@
   _concurrent(false),
   _has_aborted(false),
   _restart_for_overflow(false),
-  _concurrent_marking_in_progress(false),
   _gc_timer_cm(new (ResourceObj::C_HEAP, mtGC) ConcurrentGCTimer()),
   _gc_tracer_cm(new (ResourceObj::C_HEAP, mtGC) G1OldTracer()),
 
@@ -508,10 +507,6 @@
     _top_at_rebuild_starts[i] = NULL;
     _region_mark_stats[i].clear();
   }
-
-  // we need this to make sure that the flag is on during the evac
-  // pause with initial mark piggy-backed
-  set_concurrent_marking_in_progress();
 }
 
 void G1ConcurrentMark::clear_statistics_in_region(uint region_idx) {
@@ -589,14 +584,9 @@
 
   _concurrent = concurrent;
 
-  if (concurrent) {
-    set_concurrent_marking_in_progress();
-  } else {
-    // We currently assume that the concurrent flag has been set to
-    // false before we start remark. At this point we should also be
-    // in a STW phase.
+  if (!concurrent) {
+    // At this point we should be in a STW phase, and completed marking.
     assert_at_safepoint_on_vm_thread();
-    assert(!concurrent_marking_in_progress(), "invariant");
     assert(out_of_regions(),
            "only way to get here: _finger: " PTR_FORMAT ", _heap_end: " PTR_FORMAT,
            p2i(_finger), p2i(_heap.end()));
@@ -608,7 +598,6 @@
   // not doing marking.
   reset_marking_for_restart();
   _num_active_tasks = 0;
-  clear_concurrent_marking_in_progress();
 }
 
 G1ConcurrentMark::~G1ConcurrentMark() {
@@ -2694,17 +2683,6 @@
     if (finished) {
       // We're all done.
 
-      if (_worker_id == 0) {
-        // Let's allow task 0 to do this
-        if (_cm->concurrent()) {
-          assert(_cm->concurrent_marking_in_progress(), "invariant");
-          // We need to set this to false before the next
-          // safepoint. This way we ensure that the marking phase
-          // doesn't observe any more heap expansions.
-          _cm->clear_concurrent_marking_in_progress();
-        }
-      }
-
       // We can now guarantee that the global stack is empty, since
       // all other tasks have finished. We separated the guarantees so
       // that, if a condition is false, we can immediately find out
--- a/src/hotspot/share/gc/g1/g1ConcurrentMark.hpp	Wed Apr 04 11:21:14 2018 +0200
+++ b/src/hotspot/share/gc/g1/g1ConcurrentMark.hpp	Wed Apr 04 11:21:14 2018 +0200
@@ -342,12 +342,6 @@
   // another concurrent marking phase should start
   volatile bool           _restart_for_overflow;
 
-  // This is true from the very start of concurrent marking until the
-  // point when all the tasks complete their work. It is really used
-  // to determine the points between the end of concurrent marking and
-  // time of remark.
-  volatile bool           _concurrent_marking_in_progress;
-
   ConcurrentGCTimer*      _gc_timer_cm;
 
   G1OldTracer*            _gc_tracer_cm;
@@ -498,16 +492,6 @@
 
   G1CMRootRegions* root_regions() { return &_root_regions; }
 
-  bool concurrent_marking_in_progress() const {
-    return _concurrent_marking_in_progress;
-  }
-  void set_concurrent_marking_in_progress() {
-    _concurrent_marking_in_progress = true;
-  }
-  void clear_concurrent_marking_in_progress() {
-    _concurrent_marking_in_progress = false;
-  }
-
   void concurrent_cycle_start();
   // Abandon current marking iteration due to a Full GC.
   void concurrent_cycle_abort();