< prev index next >

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

Print this page

        

@@ -36,11 +36,10 @@
 #include "gc/g1/g1StringDedup.hpp"
 #include "logging/log.hpp"
 #include "logging/logStream.hpp"
 #include "memory/iterator.inline.hpp"
 #include "memory/resourceArea.hpp"
-#include "memory/universe.hpp"
 #include "oops/access.inline.hpp"
 #include "oops/compressedOops.inline.hpp"
 #include "oops/oop.inline.hpp"
 #include "runtime/handles.inline.hpp"
 

@@ -370,11 +369,10 @@
   bool failures() {
     return _failures;
   }
 
   bool do_heap_region(HeapRegion* r) {
-    guarantee(!r->has_index_in_opt_cset(), "Region %u still has opt collection set index %u", r->hrm_index(), r->index_in_opt_cset());
     guarantee(!r->is_young() || r->rem_set()->is_complete(), "Remembered set for Young region %u must be complete, is %s", r->hrm_index(), r->rem_set()->get_state_str());
     // Humongous and old regions regions might be of any state, so can't check here.
     guarantee(!r->is_free() || !r->rem_set()->is_tracked(), "Remembered set for free region %u must be untracked, is %s", r->hrm_index(), r->rem_set()->get_state_str());
     // Verify that the continues humongous regions' remembered set state matches the
     // one from the starts humongous region.

@@ -780,63 +778,62 @@
   G1VerifyBitmapClosure cl(caller, this);
   _g1h->heap_region_iterate(&cl);
   guarantee(!cl.failures(), "bitmap verification");
 }
 
-class G1CheckRegionAttrTableClosure : public HeapRegionClosure {
-private:
+class G1CheckCSetFastTableClosure : public HeapRegionClosure {
+ private:
   bool _failures;
-
-public:
-  G1CheckRegionAttrTableClosure() : HeapRegionClosure(), _failures(false) { }
+ public:
+  G1CheckCSetFastTableClosure() : HeapRegionClosure(), _failures(false) { }
 
   virtual bool do_heap_region(HeapRegion* hr) {
     uint i = hr->hrm_index();
-    G1HeapRegionAttr region_attr = (G1HeapRegionAttr) G1CollectedHeap::heap()->_region_attr.get_by_index(i);
+    InCSetState cset_state = (InCSetState) G1CollectedHeap::heap()->_in_cset_fast_test.get_by_index(i);
     if (hr->is_humongous()) {
       if (hr->in_collection_set()) {
         log_error(gc, verify)("## humongous region %u in CSet", i);
         _failures = true;
         return true;
       }
-      if (region_attr.is_in_cset()) {
-        log_error(gc, verify)("## inconsistent region attr type %s for humongous region %u", region_attr.get_type_str(), i);
+      if (cset_state.is_in_cset()) {
+        log_error(gc, verify)("## inconsistent cset state " CSETSTATE_FORMAT " for humongous region %u", cset_state.value(), i);
         _failures = true;
         return true;
       }
-      if (hr->is_continues_humongous() && region_attr.is_humongous()) {
-        log_error(gc, verify)("## inconsistent region attr type %s for continues humongous region %u", region_attr.get_type_str(), i);
+      if (hr->is_continues_humongous() && cset_state.is_humongous()) {
+        log_error(gc, verify)("## inconsistent cset state " CSETSTATE_FORMAT " for continues humongous region %u", cset_state.value(), i);
         _failures = true;
         return true;
       }
     } else {
-      if (region_attr.is_humongous()) {
-        log_error(gc, verify)("## inconsistent region attr type %s for non-humongous region %u", region_attr.get_type_str(), i);
+      if (cset_state.is_humongous()) {
+        log_error(gc, verify)("## inconsistent cset state " CSETSTATE_FORMAT " for non-humongous region %u", cset_state.value(), i);
         _failures = true;
         return true;
       }
-      if (hr->in_collection_set() != region_attr.is_in_cset()) {
-        log_error(gc, verify)("## in CSet %d / region attr type %s inconsistency for region %u",
-                             hr->in_collection_set(), region_attr.get_type_str(), i);
+      if (hr->in_collection_set() != cset_state.is_in_cset()) {
+        log_error(gc, verify)("## in CSet %d / cset state " CSETSTATE_FORMAT " inconsistency for region %u",
+                             hr->in_collection_set(), cset_state.value(), i);
         _failures = true;
         return true;
       }
-      if (region_attr.is_in_cset()) {
+      if (cset_state.is_in_cset()) {
         if (hr->is_archive()) {
           log_error(gc, verify)("## is_archive in collection set for region %u", i);
           _failures = true;
           return true;
         }
-        if (hr->is_young() != (region_attr.is_young())) {
-          log_error(gc, verify)("## is_young %d / region attr type %s inconsistency for region %u",
-                               hr->is_young(), region_attr.get_type_str(), i);
+        if (hr->is_young() != (cset_state.is_young())) {
+          log_error(gc, verify)("## is_young %d / cset state " CSETSTATE_FORMAT " inconsistency for region %u",
+                               hr->is_young(), cset_state.value(), i);
           _failures = true;
           return true;
         }
-        if (hr->is_old() != (region_attr.is_old())) {
-          log_error(gc, verify)("## is_old %d / region attr type %s inconsistency for region %u",
-                               hr->is_old(), region_attr.get_type_str(), i);
+        if (hr->is_old() != (cset_state.is_old())) {
+          log_error(gc, verify)("## is_old %d / cset state " CSETSTATE_FORMAT " inconsistency for region %u",
+                               hr->is_old(), cset_state.value(), i);
           _failures = true;
           return true;
         }
       }
     }

@@ -844,11 +841,11 @@
   }
 
   bool failures() const { return _failures; }
 };
 
-bool G1HeapVerifier::check_region_attr_table() {
-  G1CheckRegionAttrTableClosure cl;
+bool G1HeapVerifier::check_cset_fast_test() {
+  G1CheckCSetFastTableClosure cl;
   _g1h->_hrm->iterate(&cl);
   return !cl.failures();
 }
 #endif // PRODUCT
< prev index next >