< prev index next >

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

Print this page




 137                                         &follow_code_closure);
 138   }
 139 
 140   // Process reference objects found during marking
 141   ReferenceProcessor* rp = GenMarkSweep::ref_processor();
 142   assert(rp == g1h->ref_processor_stw(), "Sanity");
 143 
 144   rp->setup_policy(clear_all_softrefs);
 145   const ReferenceProcessorStats& stats =
 146     rp->process_discovered_references(&GenMarkSweep::is_alive,
 147                                       &GenMarkSweep::keep_alive,
 148                                       &GenMarkSweep::follow_stack_closure,
 149                                       NULL,
 150                                       gc_timer());
 151   gc_tracer()->report_gc_reference_stats(stats);
 152 
 153 
 154   // This is the point where the entire marking should have completed.
 155   assert(GenMarkSweep::_marking_stack.is_empty(), "Marking should have completed");
 156 



 157   // Unload classes and purge the SystemDictionary.
 158   bool purged_class = SystemDictionary::do_unloading(&GenMarkSweep::is_alive);
 159 
 160   // Unload nmethods.
 161   CodeCache::do_unloading(&GenMarkSweep::is_alive, purged_class);
 162 
 163   // Prune dead klasses from subklass/sibling/implementor lists.
 164   Klass::clean_weak_klass_links(&GenMarkSweep::is_alive);

 165 


 166   // Delete entries for dead interned string and clean up unreferenced symbols in symbol table.
 167   g1h->unlink_string_and_symbol_table(&GenMarkSweep::is_alive);

 168 
 169   if (VerifyDuringGC) {
 170     HandleMark hm;  // handle scope
 171 #if defined(COMPILER2) || INCLUDE_JVMCI
 172     DerivedPointerTableDeactivate dpt_deact;
 173 #endif
 174     g1h->prepare_for_verify();
 175     // Note: we can verify only the heap here. When an object is
 176     // marked, the previous value of the mark word (including
 177     // identity hash values, ages, etc) is preserved, and the mark
 178     // word is set to markOop::marked_value - effectively removing
 179     // any hash values from the mark word. These hash values are
 180     // used when verifying the dictionaries and so removing them
 181     // from the mark word can make verification of the dictionaries
 182     // fail. At the end of the GC, the original mark word values
 183     // (including hash values) are restored to the appropriate
 184     // objects.
 185     GCTraceTime(Info, gc, verify)("During GC (full)");
 186     g1h->verify(VerifyOption_G1UseMarkWord);
 187   }




 137                                         &follow_code_closure);
 138   }
 139 
 140   // Process reference objects found during marking
 141   ReferenceProcessor* rp = GenMarkSweep::ref_processor();
 142   assert(rp == g1h->ref_processor_stw(), "Sanity");
 143 
 144   rp->setup_policy(clear_all_softrefs);
 145   const ReferenceProcessorStats& stats =
 146     rp->process_discovered_references(&GenMarkSweep::is_alive,
 147                                       &GenMarkSweep::keep_alive,
 148                                       &GenMarkSweep::follow_stack_closure,
 149                                       NULL,
 150                                       gc_timer());
 151   gc_tracer()->report_gc_reference_stats(stats);
 152 
 153 
 154   // This is the point where the entire marking should have completed.
 155   assert(GenMarkSweep::_marking_stack.is_empty(), "Marking should have completed");
 156 
 157   {
 158     GCTraceTime(Debug, gc) tm_m("Class Unloading", gc_timer());
 159 
 160     // Unload classes and purge the SystemDictionary.
 161     bool purged_class = SystemDictionary::do_unloading(&GenMarkSweep::is_alive);
 162 
 163     // Unload nmethods.
 164     CodeCache::do_unloading(&GenMarkSweep::is_alive, purged_class);
 165 
 166     // Prune dead klasses from subklass/sibling/implementor lists.
 167     Klass::clean_weak_klass_links(&GenMarkSweep::is_alive);
 168   }
 169 
 170   {
 171     GCTraceTime(Debug, gc) t("Scrub String and Symbol Tables", gc_timer());
 172     // Delete entries for dead interned string and clean up unreferenced symbols in symbol table.
 173     g1h->unlink_string_and_symbol_table(&GenMarkSweep::is_alive);
 174   }
 175 
 176   if (VerifyDuringGC) {
 177     HandleMark hm;  // handle scope
 178 #if defined(COMPILER2) || INCLUDE_JVMCI
 179     DerivedPointerTableDeactivate dpt_deact;
 180 #endif
 181     g1h->prepare_for_verify();
 182     // Note: we can verify only the heap here. When an object is
 183     // marked, the previous value of the mark word (including
 184     // identity hash values, ages, etc) is preserved, and the mark
 185     // word is set to markOop::marked_value - effectively removing
 186     // any hash values from the mark word. These hash values are
 187     // used when verifying the dictionaries and so removing them
 188     // from the mark word can make verification of the dictionaries
 189     // fail. At the end of the GC, the original mark word values
 190     // (including hash values) are restored to the appropriate
 191     // objects.
 192     GCTraceTime(Info, gc, verify)("During GC (full)");
 193     g1h->verify(VerifyOption_G1UseMarkWord);
 194   }


< prev index next >