8061748: Remove check_ct_logs_at_safepoint()
authorkbarrett
Thu, 23 Oct 2014 16:19:32 -0400
changeset 27439 c0c3c18318be
parent 27437 68a6992ef996
child 27441 4cdc382e53c5
8061748: Remove check_ct_logs_at_safepoint() Summary: Remove unused function and related closure class Reviewed-by: jwilhelm, mgerdin
hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Thu Oct 23 11:43:29 2014 +0200
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Thu Oct 23 16:19:32 2014 -0400
@@ -127,41 +127,6 @@
 };
 
 
-class ClearLoggedCardTableEntryClosure: public CardTableEntryClosure {
-  size_t _num_processed;
-  CardTableModRefBS* _ctbs;
-  int _histo[256];
-
- public:
-  ClearLoggedCardTableEntryClosure() :
-    _num_processed(0), _ctbs(G1CollectedHeap::heap()->g1_barrier_set())
-  {
-    for (int i = 0; i < 256; i++) _histo[i] = 0;
-  }
-
-  bool do_card_ptr(jbyte* card_ptr, uint worker_i) {
-    unsigned char* ujb = (unsigned char*)card_ptr;
-    int ind = (int)(*ujb);
-    _histo[ind]++;
-
-    *card_ptr = (jbyte)CardTableModRefBS::clean_card_val();
-    _num_processed++;
-
-    return true;
-  }
-
-  size_t num_processed() { return _num_processed; }
-
-  void print_histo() {
-    gclog_or_tty->print_cr("Card table value histogram:");
-    for (int i = 0; i < 256; i++) {
-      if (_histo[i] != 0) {
-        gclog_or_tty->print_cr("  %d: %d", i, _histo[i]);
-      }
-    }
-  }
-};
-
 class RedirtyLoggedCardTableEntryClosure : public CardTableEntryClosure {
  private:
   size_t _num_processed;
@@ -475,48 +440,6 @@
   return !hr->is_humongous();
 }
 
-void G1CollectedHeap::check_ct_logs_at_safepoint() {
-  DirtyCardQueueSet& dcqs = JavaThread::dirty_card_queue_set();
-  CardTableModRefBS* ct_bs = g1_barrier_set();
-
-  // Count the dirty cards at the start.
-  CountNonCleanMemRegionClosure count1(this);
-  ct_bs->mod_card_iterate(&count1);
-  int orig_count = count1.n();
-
-  // First clear the logged cards.
-  ClearLoggedCardTableEntryClosure clear;
-  dcqs.apply_closure_to_all_completed_buffers(&clear);
-  dcqs.iterate_closure_all_threads(&clear, false);
-  clear.print_histo();
-
-  // Now ensure that there's no dirty cards.
-  CountNonCleanMemRegionClosure count2(this);
-  ct_bs->mod_card_iterate(&count2);
-  if (count2.n() != 0) {
-    gclog_or_tty->print_cr("Card table has %d entries; %d originally",
-                           count2.n(), orig_count);
-  }
-  guarantee(count2.n() == 0, "Card table should be clean.");
-
-  RedirtyLoggedCardTableEntryClosure redirty;
-  dcqs.apply_closure_to_all_completed_buffers(&redirty);
-  dcqs.iterate_closure_all_threads(&redirty, false);
-  gclog_or_tty->print_cr("Log entries = %d, dirty cards = %d.",
-                         clear.num_processed(), orig_count);
-  guarantee(redirty.num_processed() == clear.num_processed(),
-            err_msg("Redirtied "SIZE_FORMAT" cards, bug cleared "SIZE_FORMAT,
-                    redirty.num_processed(), clear.num_processed()));
-
-  CountNonCleanMemRegionClosure count3(this);
-  ct_bs->mod_card_iterate(&count3);
-  if (count3.n() != orig_count) {
-    gclog_or_tty->print_cr("Should have restored them all: orig = %d, final = %d.",
-                           orig_count, count3.n());
-    guarantee(count3.n() >= orig_count, "Should have restored them all.");
-  }
-}
-
 // Private class members.
 
 G1CollectedHeap* G1CollectedHeap::_g1h;
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp	Thu Oct 23 11:43:29 2014 +0200
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp	Thu Oct 23 16:19:32 2014 -0400
@@ -797,9 +797,6 @@
   // The closure used to refine a single card.
   RefineCardTableEntryClosure* _refine_cte_cl;
 
-  // A function to check the consistency of dirty card logs.
-  void check_ct_logs_at_safepoint();
-
   // A DirtyCardQueueSet that is used to hold cards that contain
   // references into the current collection set. This is used to
   // update the remembered sets of the regions in the collection