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) trace("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) trace("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 (G1StringDedup::is_enabled()) { 177 GCTraceTime(Debug, gc) trace("String Deduplication Unlink", gc_timer()); 178 G1StringDedup::unlink(&GenMarkSweep::is_alive); 179 } 180 181 if (VerifyDuringGC) { 182 HandleMark hm; // handle scope 183 #if defined(COMPILER2) || INCLUDE_JVMCI 184 DerivedPointerTableDeactivate dpt_deact; 185 #endif 186 g1h->prepare_for_verify(); 187 // Note: we can verify only the heap here. When an object is 188 // marked, the previous value of the mark word (including 189 // identity hash values, ages, etc) is preserved, and the mark 190 // word is set to markOop::marked_value - effectively removing 191 // any hash values from the mark word. These hash values are 192 // used when verifying the dictionaries and so removing them 193 // from the mark word can make verification of the dictionaries 194 // fail. At the end of the GC, the original mark word values 195 // (including hash values) are restored to the appropriate 196 // objects. 197 GCTraceTime(Info, gc, verify)("During GC (full)"); 198 g1h->verify(VerifyOption_G1UseMarkWord); 199 } |