165 GCTraceTime(Debug, gc, phases) trace("Class Unloading", gc_timer()); |
165 GCTraceTime(Debug, gc, phases) trace("Class Unloading", gc_timer()); |
166 |
166 |
167 // Unload classes and purge the SystemDictionary. |
167 // Unload classes and purge the SystemDictionary. |
168 bool purged_class = SystemDictionary::do_unloading(&GenMarkSweep::is_alive); |
168 bool purged_class = SystemDictionary::do_unloading(&GenMarkSweep::is_alive); |
169 |
169 |
170 // Unload nmethods. |
170 g1h->complete_cleaning(&GenMarkSweep::is_alive, purged_class); |
171 CodeCache::do_unloading(&GenMarkSweep::is_alive, purged_class); |
171 } else { |
172 |
172 GCTraceTime(Debug, gc, phases) trace("Cleanup", gc_timer()); |
173 // Prune dead klasses from subklass/sibling/implementor lists. |
173 g1h->partial_cleaning(&GenMarkSweep::is_alive, true, true, G1StringDedup::is_enabled()); |
174 Klass::clean_weak_klass_links(&GenMarkSweep::is_alive); |
|
175 } |
|
176 |
|
177 { |
|
178 GCTraceTime(Debug, gc, phases) trace("Scrub String and Symbol Tables", gc_timer()); |
|
179 // Delete entries for dead interned string and clean up unreferenced symbols in symbol table. |
|
180 g1h->unlink_string_and_symbol_table(&GenMarkSweep::is_alive); |
|
181 } |
|
182 |
|
183 if (G1StringDedup::is_enabled()) { |
|
184 GCTraceTime(Debug, gc, phases) trace("String Deduplication Unlink", gc_timer()); |
|
185 G1StringDedup::unlink(&GenMarkSweep::is_alive); |
|
186 } |
174 } |
187 |
175 |
188 if (VerifyDuringGC) { |
176 if (VerifyDuringGC) { |
189 HandleMark hm; // handle scope |
177 HandleMark hm; // handle scope |
190 #if defined(COMPILER2) || INCLUDE_JVMCI |
178 #if defined(COMPILER2) || INCLUDE_JVMCI |