src/hotspot/share/gc/g1/g1HeapVerifier.cpp
changeset 47885 5caa1d5f74c1
parent 47678 c84eeb55c55e
child 48179 34fe70d22e9c
--- a/src/hotspot/share/gc/g1/g1HeapVerifier.cpp	Mon Oct 30 08:34:54 2017 +0100
+++ b/src/hotspot/share/gc/g1/g1HeapVerifier.cpp	Tue Nov 14 11:33:23 2017 +0100
@@ -48,7 +48,7 @@
 public:
   // _vo == UsePrevMarking -> use "prev" marking information,
   // _vo == UseNextMarking -> use "next" marking information,
-  // _vo == UseMarkWord    -> use mark word from object header.
+  // _vo == UseFullMarking -> use "next" marking bitmap but no TAMS
   VerifyRootsClosure(VerifyOption vo) :
     _g1h(G1CollectedHeap::heap()),
     _vo(vo),
@@ -63,9 +63,6 @@
       if (_g1h->is_obj_dead_cond(obj, _vo)) {
         Log(gc, verify) log;
         log.error("Root location " PTR_FORMAT " points to dead obj " PTR_FORMAT, p2i(p), p2i(obj));
-        if (_vo == VerifyOption_G1UseMarkWord) {
-          log.error("  Mark word: " PTR_FORMAT, p2i(obj->mark()));
-        }
         ResourceMark rm;
         LogStream ls(log.error());
         obj->print_on(&ls);
@@ -95,7 +92,7 @@
     }
 
     // Don't check the code roots during marking verification in a full GC
-    if (_vo == VerifyOption_G1UseMarkWord) {
+    if (_vo == VerifyOption_G1UseFullMarking) {
       return;
     }
 
@@ -203,7 +200,7 @@
 public:
   // _vo == UsePrevMarking -> use "prev" marking information,
   // _vo == UseNextMarking -> use "next" marking information,
-  // _vo == UseMarkWord    -> use mark word from object header.
+  // _vo == UseFullMarking -> use "next" marking bitmap but no TAMS.
   VerifyObjsInRegionClosure(HeapRegion *hr, VerifyOption vo)
     : _live_bytes(0), _hr(hr), _vo(vo) {
     _g1h = G1CollectedHeap::heap();
@@ -212,15 +209,15 @@
     VerifyLivenessOopClosure isLive(_g1h, _vo);
     assert(o != NULL, "Huh?");
     if (!_g1h->is_obj_dead_cond(o, _vo)) {
-      // If the object is alive according to the mark word,
+      // If the object is alive according to the full gc mark,
       // then verify that the marking information agrees.
       // Note we can't verify the contra-positive of the
       // above: if the object is dead (according to the mark
       // word), it may not be marked, or may have been marked
       // but has since became dead, or may have been allocated
       // since the last marking.
-      if (_vo == VerifyOption_G1UseMarkWord) {
-        guarantee(!_g1h->is_obj_dead(o), "mark word and concurrent mark mismatch");
+      if (_vo == VerifyOption_G1UseFullMarking) {
+        guarantee(!_g1h->is_obj_dead(o), "Full GC marking and concurrent mark mismatch");
       }
 
       o->oop_iterate_no_header(&isLive);
@@ -299,7 +296,7 @@
 public:
   // _vo == UsePrevMarking -> use "prev" marking information,
   // _vo == UseNextMarking -> use "next" marking information,
-  // _vo == UseMarkWord    -> use mark word from object header.
+  // _vo == UseFullMarking -> use "next" marking bitmap but no TAMS
   VerifyRegionClosure(bool par, VerifyOption vo)
     : _par(par),
       _vo(vo),
@@ -357,7 +354,7 @@
 public:
   // _vo == UsePrevMarking -> use "prev" marking information,
   // _vo == UseNextMarking -> use "next" marking information,
-  // _vo == UseMarkWord    -> use mark word from object header.
+  // _vo == UseFullMarking -> use "next" marking bitmap but no TAMS
   G1ParVerifyTask(G1CollectedHeap* g1h, VerifyOption vo) :
       AbstractGangTask("Parallel verify task"),
       _g1h(g1h),
@@ -372,7 +369,7 @@
   void work(uint worker_id) {
     HandleMark hm;
     VerifyRegionClosure blk(true, _vo);
-    _g1h->heap_region_par_iterate(&blk, worker_id, &_hrclaimer);
+    _g1h->heap_region_par_iterate_from_worker_offset(&blk, &_hrclaimer, worker_id);
     if (blk.failures()) {
       _failures = true;
     }
@@ -407,7 +404,7 @@
 
   bool failures = rootsCl.failures() || codeRootsCl.failures();
 
-  if (vo != VerifyOption_G1UseMarkWord) {
+  if (!_g1h->g1_policy()->collector_state()->full_collection()) {
     // If we're verifying during a full GC then the region sets
     // will have been torn down at the start of the GC. Therefore
     // verifying the region sets will fail. So we only verify