hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp
changeset 9995 290620c08233
parent 8680 f1c414e16a4c
child 10670 4ea0e7d2ffbc
equal deleted inserted replaced
9994:efb74fdbd46e 9995:290620c08233
    82   // The marking doesn't preserve the marks of biased objects.
    82   // The marking doesn't preserve the marks of biased objects.
    83   BiasedLocking::preserve_marks();
    83   BiasedLocking::preserve_marks();
    84 
    84 
    85   mark_sweep_phase1(marked_for_unloading, clear_all_softrefs);
    85   mark_sweep_phase1(marked_for_unloading, clear_all_softrefs);
    86 
    86 
    87   if (VerifyDuringGC) {
       
    88       G1CollectedHeap* g1h = G1CollectedHeap::heap();
       
    89       g1h->checkConcurrentMark();
       
    90   }
       
    91 
       
    92   mark_sweep_phase2();
    87   mark_sweep_phase2();
    93 
    88 
    94   // Don't add any more derived pointers during phase3
    89   // Don't add any more derived pointers during phase3
    95   COMPILER2_PRESENT(DerivedPointerTable::set_active(false));
    90   COMPILER2_PRESENT(DerivedPointerTable::set_active(false));
    96 
    91 
   177   // Clean up unreferenced symbols in symbol table.
   172   // Clean up unreferenced symbols in symbol table.
   178   SymbolTable::unlink();
   173   SymbolTable::unlink();
   179 
   174 
   180   assert(GenMarkSweep::_marking_stack.is_empty(),
   175   assert(GenMarkSweep::_marking_stack.is_empty(),
   181          "stack should be empty by now");
   176          "stack should be empty by now");
       
   177 
       
   178   if (VerifyDuringGC) {
       
   179     HandleMark hm;  // handle scope
       
   180     COMPILER2_PRESENT(DerivedPointerTableDeactivate dpt_deact);
       
   181     gclog_or_tty->print(" VerifyDuringGC:(full)[Verifying ");
       
   182     Universe::heap()->prepare_for_verify();
       
   183     // Note: we can verify only the heap here. When an object is
       
   184     // marked, the previous value of the mark word (including
       
   185     // identity hash values, ages, etc) is preserved, and the mark
       
   186     // word is set to markOop::marked_value - effectively removing
       
   187     // any hash values from the mark word. These hash values are
       
   188     // used when verifying the dictionaries and so removing them
       
   189     // from the mark word can make verification of the dictionaries
       
   190     // fail. At the end of the GC, the orginal mark word values
       
   191     // (including hash values) are restored to the appropriate
       
   192     // objects.
       
   193     Universe::heap()->verify(/* allow dirty */ true,
       
   194                              /* silent      */ false,
       
   195                              /* option      */ VerifyOption_G1UseMarkWord);
       
   196 
       
   197     G1CollectedHeap* g1h = G1CollectedHeap::heap();
       
   198     gclog_or_tty->print_cr("]");
       
   199   }
   182 }
   200 }
   183 
   201 
   184 class G1PrepareCompactClosure: public HeapRegionClosure {
   202 class G1PrepareCompactClosure: public HeapRegionClosure {
   185   G1CollectedHeap* _g1h;
   203   G1CollectedHeap* _g1h;
   186   ModRefBarrierSet* _mrbs;
   204   ModRefBarrierSet* _mrbs;