8138833: Remove CMMarkStack::drain
authorkbarrett
Mon, 05 Oct 2015 21:17:11 -0400
changeset 33122 cdb3e19c1d9e
parent 33121 6580bf263d00
child 33123 8a67e36f19d3
8138833: Remove CMMarkStack::drain Summary: Remove unused functions and data members. Reviewed-by: pliden, brutisso
hotspot/src/share/vm/gc/g1/concurrentMark.cpp
hotspot/src/share/vm/gc/g1/concurrentMark.hpp
--- a/hotspot/src/share/vm/gc/g1/concurrentMark.cpp	Mon Oct 05 13:25:01 2015 -0700
+++ b/hotspot/src/share/vm/gc/g1/concurrentMark.cpp	Mon Oct 05 21:17:11 2015 -0400
@@ -246,10 +246,6 @@
 
 CMMarkStack::CMMarkStack(ConcurrentMark* cm) :
   _base(NULL), _cm(cm)
-#ifdef ASSERT
-  , _drain_in_progress(false)
-  , _drain_in_progress_yields(false)
-#endif
 {}
 
 bool CMMarkStack::allocate(size_t capacity) {
@@ -363,30 +359,6 @@
   }
 }
 
-template<class OopClosureClass>
-bool CMMarkStack::drain(OopClosureClass* cl, CMBitMap* bm, bool yield_after) {
-  assert(!_drain_in_progress || !_drain_in_progress_yields || yield_after
-         || SafepointSynchronize::is_at_safepoint(),
-         "Drain recursion must be yield-safe.");
-  bool res = true;
-  debug_only(_drain_in_progress = true);
-  debug_only(_drain_in_progress_yields = yield_after);
-  while (!isEmpty()) {
-    oop newOop = pop();
-    assert(G1CollectedHeap::heap()->is_in_reserved(newOop), "Bad pop");
-    assert(newOop->is_oop(), "Expected an oop");
-    assert(bm == NULL || bm->isMarked((HeapWord*)newOop),
-           "only grey objects on this stack");
-    newOop->oop_iterate(cl);
-    if (yield_after && _cm->do_yield_check()) {
-      res = false;
-      break;
-    }
-  }
-  debug_only(_drain_in_progress = false);
-  return res;
-}
-
 void CMMarkStack::note_start_of_gc() {
   assert(_saved_index == -1,
          "note_start_of_gc()/end_of_gc() bracketed incorrectly");
--- a/hotspot/src/share/vm/gc/g1/concurrentMark.hpp	Mon Oct 05 13:25:01 2015 -0700
+++ b/hotspot/src/share/vm/gc/g1/concurrentMark.hpp	Mon Oct 05 21:17:11 2015 -0400
@@ -182,15 +182,6 @@
 
   bool  _overflow;
   bool  _should_expand;
-  DEBUG_ONLY(bool _drain_in_progress;)
-  DEBUG_ONLY(bool _drain_in_progress_yields;)
-
-  oop pop() {
-    if (!isEmpty()) {
-      return _base[--_index] ;
-    }
-    return NULL;
-  }
 
  public:
   CMMarkStack(ConcurrentMark* cm);
@@ -212,17 +203,6 @@
   // operations, which use the same locking strategy.
   bool par_pop_arr(oop* ptr_arr, int max, int* n);
 
-  // Drain the mark stack, applying the given closure to all fields of
-  // objects on the stack.  (That is, continue until the stack is empty,
-  // even if closure applications add entries to the stack.)  The "bm"
-  // argument, if non-null, may be used to verify that only marked objects
-  // are on the mark stack.  If "yield_after" is "true", then the
-  // concurrent marker performing the drain offers to yield after
-  // processing each object.  If a yield occurs, stops the drain operation
-  // and returns false.  Otherwise, returns true.
-  template<class OopClosureClass>
-  bool drain(OopClosureClass* cl, CMBitMap* bm, bool yield_after = false);
-
   bool isEmpty()    { return _index == 0; }
   int  maxElems()   { return _capacity; }