1.1 --- a/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp Tue Jun 14 10:33:43 2011 -0400 1.2 +++ b/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp Tue Jun 14 11:01:10 2011 -0700 1.3 @@ -84,11 +84,6 @@ 1.4 1.5 mark_sweep_phase1(marked_for_unloading, clear_all_softrefs); 1.6 1.7 - if (VerifyDuringGC) { 1.8 - G1CollectedHeap* g1h = G1CollectedHeap::heap(); 1.9 - g1h->checkConcurrentMark(); 1.10 - } 1.11 - 1.12 mark_sweep_phase2(); 1.13 1.14 // Don't add any more derived pointers during phase3 1.15 @@ -179,6 +174,29 @@ 1.16 1.17 assert(GenMarkSweep::_marking_stack.is_empty(), 1.18 "stack should be empty by now"); 1.19 + 1.20 + if (VerifyDuringGC) { 1.21 + HandleMark hm; // handle scope 1.22 + COMPILER2_PRESENT(DerivedPointerTableDeactivate dpt_deact); 1.23 + gclog_or_tty->print(" VerifyDuringGC:(full)[Verifying "); 1.24 + Universe::heap()->prepare_for_verify(); 1.25 + // Note: we can verify only the heap here. When an object is 1.26 + // marked, the previous value of the mark word (including 1.27 + // identity hash values, ages, etc) is preserved, and the mark 1.28 + // word is set to markOop::marked_value - effectively removing 1.29 + // any hash values from the mark word. These hash values are 1.30 + // used when verifying the dictionaries and so removing them 1.31 + // from the mark word can make verification of the dictionaries 1.32 + // fail. At the end of the GC, the orginal mark word values 1.33 + // (including hash values) are restored to the appropriate 1.34 + // objects. 1.35 + Universe::heap()->verify(/* allow dirty */ true, 1.36 + /* silent */ false, 1.37 + /* option */ VerifyOption_G1UseMarkWord); 1.38 + 1.39 + G1CollectedHeap* g1h = G1CollectedHeap::heap(); 1.40 + gclog_or_tty->print_cr("]"); 1.41 + } 1.42 } 1.43 1.44 class G1PrepareCompactClosure: public HeapRegionClosure {