< prev index next >

src/share/vm/gc/g1/g1CollectedHeap.hpp

Print this page

        

@@ -28,10 +28,11 @@
 #include "gc/g1/concurrentMark.hpp"
 #include "gc/g1/evacuationInfo.hpp"
 #include "gc/g1/g1AllocationContext.hpp"
 #include "gc/g1/g1BiasedArray.hpp"
 #include "gc/g1/g1CollectorState.hpp"
+#include "gc/g1/g1HeapVerifier.hpp"
 #include "gc/g1/g1HRPrinter.hpp"
 #include "gc/g1/g1InCSetState.hpp"
 #include "gc/g1/g1MonitoringSupport.hpp"
 #include "gc/g1/g1EvacFailure.hpp"
 #include "gc/g1/g1EvacStats.hpp"

@@ -116,10 +117,11 @@
   friend class VM_G1CollectFull;
   friend class VM_G1IncCollectionPause;
   friend class VMStructs;
   friend class MutatorAllocRegion;
   friend class G1GCAllocRegion;
+  friend class G1HeapVerifier;
 
   // Closures used in implementation.
   friend class G1ParScanThreadState;
   friend class G1ParScanThreadStateSet;
   friend class G1ParTask;

@@ -179,10 +181,13 @@
   HeapRegionManager _hrm;
 
   // Manages all allocations with regions except humongous object allocations.
   G1Allocator* _allocator;
 
+  // Manages all heap verification.
+  G1HeapVerifier* _verifier;
+
   // Outside of GC pauses, the number of bytes used in all regions other
   // than the current allocation region(s).
   size_t _summary_bytes_used;
 
   void increase_used(size_t bytes);

@@ -284,14 +289,10 @@
   // translation factor.
   static G1RegionToSpaceMapper* create_aux_memory_mapper(const char* description,
                                                          size_t size,
                                                          size_t translation_factor);
 
-  double verify(bool guard, const char* msg);
-  void verify_before_gc();
-  void verify_after_gc();
-
   void log_gc_footer(jlong pause_time_counter);
 
   void trace_heap(GCWhen::Type when, const GCTracer* tracer);
 
   void process_weak_jni_handles();

@@ -525,10 +526,14 @@
 
   G1Allocator* allocator() {
     return _allocator;
   }
 
+  G1HeapVerifier* verifier() {
+    return _verifier;
+  }
+
   G1MonitoringSupport* g1mm() {
     assert(_g1mm != NULL, "should have been initialized");
     return _g1mm;
   }
 

@@ -1054,58 +1059,10 @@
   }
 
   // The number of regions that are not completely free.
   uint num_used_regions() const { return num_regions() - num_free_regions(); }
 
-  void verify_not_dirty_region(HeapRegion* hr) PRODUCT_RETURN;
-  void verify_dirty_region(HeapRegion* hr) PRODUCT_RETURN;
-  void verify_dirty_young_list(HeapRegion* head) PRODUCT_RETURN;
-  void verify_dirty_young_regions() PRODUCT_RETURN;
-
-#ifndef PRODUCT
-  // Make sure that the given bitmap has no marked objects in the
-  // range [from,limit). If it does, print an error message and return
-  // false. Otherwise, just return true. bitmap_name should be "prev"
-  // or "next".
-  bool verify_no_bits_over_tams(const char* bitmap_name, CMBitMapRO* bitmap,
-                                HeapWord* from, HeapWord* limit);
-
-  // Verify that the prev / next bitmap range [tams,end) for the given
-  // region has no marks. Return true if all is well, false if errors
-  // are detected.
-  bool verify_bitmaps(const char* caller, HeapRegion* hr);
-#endif // PRODUCT
-
-  // If G1VerifyBitmaps is set, verify that the marking bitmaps for
-  // the given region do not have any spurious marks. If errors are
-  // detected, print appropriate error messages and crash.
-  void check_bitmaps(const char* caller, HeapRegion* hr) PRODUCT_RETURN;
-
-  // If G1VerifyBitmaps is set, verify that the marking bitmaps do not
-  // have any spurious marks. If errors are detected, print
-  // appropriate error messages and crash.
-  void check_bitmaps(const char* caller) PRODUCT_RETURN;
-
-  // Do sanity check on the contents of the in-cset fast test table.
-  bool check_cset_fast_test() PRODUCT_RETURN_( return true; );
-
-  // verify_region_sets() performs verification over the region
-  // lists. It will be compiled in the product code to be used when
-  // necessary (i.e., during heap verification).
-  void verify_region_sets();
-
-  // verify_region_sets_optional() is planted in the code for
-  // list verification in non-product builds (and it can be enabled in
-  // product builds by defining HEAP_REGION_SET_FORCE_VERIFY to be 1).
-#if HEAP_REGION_SET_FORCE_VERIFY
-  void verify_region_sets_optional() {
-    verify_region_sets();
-  }
-#else // HEAP_REGION_SET_FORCE_VERIFY
-  void verify_region_sets_optional() { }
-#endif // HEAP_REGION_SET_FORCE_VERIFY
-
 #ifdef ASSERT
   bool is_on_master_free_list(HeapRegion* hr) {
     return _hrm.is_free(hr);
   }
 #endif // ASSERT

@@ -1423,15 +1380,10 @@
 
   inline bool is_obj_dead(const oop obj) const;
 
   inline bool is_obj_ill(const oop obj) const;
 
-  bool allocated_since_marking(oop obj, HeapRegion* hr, VerifyOption vo);
-  HeapWord* top_at_mark_start(HeapRegion* hr, VerifyOption vo);
-  bool is_marked(oop obj, VerifyOption vo);
-  const char* top_at_mark_start_str(VerifyOption vo);
-
   ConcurrentMark* concurrent_mark() const { return _cm; }
 
   // Refinement
 
   ConcurrentG1Refine* concurrent_g1_refine() const { return _cg1r; }

@@ -1488,11 +1440,13 @@
   // vo == UseNextMarking, which is to verify the "next" marking
   // information at the end of remark.
   // Currently there is only one place where this is called with
   // vo == UseMarkWord, which is to verify the marking during a
   // full GC.
-  void verify(VerifyOption vo);
+  void verify(VerifyOption vo) {
+    _verifier->verify(vo);
+  }
 
   // The methods below are here for convenience and dispatch the
   // appropriate method depending on value of the given VerifyOption
   // parameter. The values for that parameter, and their meanings,
   // are the same as those above.
< prev index next >