< prev index next >

src/hotspot/share/gc/g1/g1ConcurrentMark.cpp

Print this page
rev 49670 : imported patch 8178105-switch-at-remark
rev 49671 : imported patch 8178105-stefanj-review
rev 49672 : imported patch 8178105-stefanj-review2
rev 49674 : imported patch 8154528-reclaim-at-remark
rev 49675 : imported patch 8154528-stefanj-review
rev 49678 : imported patch 8200426-sangheon-review
rev 49679 : imported patch 8200730-timing-in-remark-cleanup
rev 49682 : imported patch 8201172-parallelize-remark-phase
rev 49683 : imported patch 8201172-stefanj-review
rev 49685 : imported patch 8201490-improve-conc-mark-keepalive

@@ -1425,12 +1425,18 @@
 
   virtual void do_oop(narrowOop* p) { do_oop_work(p); }
   virtual void do_oop(      oop* p) { do_oop_work(p); }
 
   template <class T> void do_oop_work(T* p) {
-    if (!_cm->has_overflown()) {
-      _task->deal_with_reference(p);
+    if (_cm->has_overflown()) {
+      return;
+    }
+    if (!_task->deal_with_reference(p)) {
+      // We did not add anything to the mark bitmap (or mark stack), so there is
+      // no point trying to drain it.
+      return;
+    }
       _ref_counter--;
 
       if (_ref_counter == 0) {
         // We have dealt with _ref_counter_limit references, pushing them
         // and objects reachable from them on to the local stack (and

@@ -1455,11 +1461,10 @@
                                  _is_serial);
         } while (_task->has_aborted() && !_cm->has_overflown());
         _ref_counter = _ref_counter_limit;
       }
     }
-  }
 };
 
 // 'Drain' oop closure used by both serial and parallel reference processing.
 // Uses the G1CMTask associated with a given worker thread (for serial
 // reference processing the G1CMtask for worker 0 is used). Calls the
< prev index next >