src/share/vm/gc_implementation/g1/g1MarkSweep.cpp

Print this page




 189     HandleMark hm;  // handle scope
 190     COMPILER2_PRESENT(DerivedPointerTableDeactivate dpt_deact);
 191     gclog_or_tty->print(" VerifyDuringGC:(full)[Verifying ");
 192     Universe::heap()->prepare_for_verify();
 193     // Note: we can verify only the heap here. When an object is
 194     // marked, the previous value of the mark word (including
 195     // identity hash values, ages, etc) is preserved, and the mark
 196     // word is set to markOop::marked_value - effectively removing
 197     // any hash values from the mark word. These hash values are
 198     // used when verifying the dictionaries and so removing them
 199     // from the mark word can make verification of the dictionaries
 200     // fail. At the end of the GC, the orginal mark word values
 201     // (including hash values) are restored to the appropriate
 202     // objects.
 203     Universe::heap()->verify(/* silent      */ false,
 204                              /* option      */ VerifyOption_G1UseMarkWord);
 205 
 206     G1CollectedHeap* g1h = G1CollectedHeap::heap();
 207     gclog_or_tty->print_cr("]");
 208   }


 209 }
 210 
 211 class G1PrepareCompactClosure: public HeapRegionClosure {
 212   G1CollectedHeap* _g1h;
 213   ModRefBarrierSet* _mrbs;
 214   CompactPoint _cp;
 215   HumongousRegionSet _humongous_proxy_set;
 216 
 217   void free_humongous_region(HeapRegion* hr) {
 218     HeapWord* end = hr->end();
 219     size_t dummy_pre_used;
 220     FreeRegionList dummy_free_list("Dummy Free List for G1MarkSweep");
 221 
 222     assert(hr->startsHumongous(),
 223            "Only the start of a humongous region should be freed.");
 224     _g1h->free_humongous_region(hr, &dummy_pre_used, &dummy_free_list,
 225                                 &_humongous_proxy_set, false /* par */);
 226     hr->prepare_for_compaction(&_cp);
 227     // Also clear the part of the card table that will be unused after
 228     // compaction.




 189     HandleMark hm;  // handle scope
 190     COMPILER2_PRESENT(DerivedPointerTableDeactivate dpt_deact);
 191     gclog_or_tty->print(" VerifyDuringGC:(full)[Verifying ");
 192     Universe::heap()->prepare_for_verify();
 193     // Note: we can verify only the heap here. When an object is
 194     // marked, the previous value of the mark word (including
 195     // identity hash values, ages, etc) is preserved, and the mark
 196     // word is set to markOop::marked_value - effectively removing
 197     // any hash values from the mark word. These hash values are
 198     // used when verifying the dictionaries and so removing them
 199     // from the mark word can make verification of the dictionaries
 200     // fail. At the end of the GC, the orginal mark word values
 201     // (including hash values) are restored to the appropriate
 202     // objects.
 203     Universe::heap()->verify(/* silent      */ false,
 204                              /* option      */ VerifyOption_G1UseMarkWord);
 205 
 206     G1CollectedHeap* g1h = G1CollectedHeap::heap();
 207     gclog_or_tty->print_cr("]");
 208   }
 209 
 210   gc_tracer()->report_object_count_after_gc(&GenMarkSweep::is_alive);
 211 }
 212 
 213 class G1PrepareCompactClosure: public HeapRegionClosure {
 214   G1CollectedHeap* _g1h;
 215   ModRefBarrierSet* _mrbs;
 216   CompactPoint _cp;
 217   HumongousRegionSet _humongous_proxy_set;
 218 
 219   void free_humongous_region(HeapRegion* hr) {
 220     HeapWord* end = hr->end();
 221     size_t dummy_pre_used;
 222     FreeRegionList dummy_free_list("Dummy Free List for G1MarkSweep");
 223 
 224     assert(hr->startsHumongous(),
 225            "Only the start of a humongous region should be freed.");
 226     _g1h->free_humongous_region(hr, &dummy_pre_used, &dummy_free_list,
 227                                 &_humongous_proxy_set, false /* par */);
 228     hr->prepare_for_compaction(&_cp);
 229     // Also clear the part of the card table that will be unused after
 230     // compaction.