152 |
152 |
153 |
153 |
154 // This is the point where the entire marking should have completed. |
154 // This is the point where the entire marking should have completed. |
155 assert(GenMarkSweep::_marking_stack.is_empty(), "Marking should have completed"); |
155 assert(GenMarkSweep::_marking_stack.is_empty(), "Marking should have completed"); |
156 |
156 |
157 // Unload classes and purge the SystemDictionary. |
157 { |
158 bool purged_class = SystemDictionary::do_unloading(&GenMarkSweep::is_alive); |
158 GCTraceTime(Debug, gc) trace("Class Unloading", gc_timer()); |
159 |
159 |
160 // Unload nmethods. |
160 // Unload classes and purge the SystemDictionary. |
161 CodeCache::do_unloading(&GenMarkSweep::is_alive, purged_class); |
161 bool purged_class = SystemDictionary::do_unloading(&GenMarkSweep::is_alive); |
162 |
162 |
163 // Prune dead klasses from subklass/sibling/implementor lists. |
163 // Unload nmethods. |
164 Klass::clean_weak_klass_links(&GenMarkSweep::is_alive); |
164 CodeCache::do_unloading(&GenMarkSweep::is_alive, purged_class); |
165 |
165 |
166 // Delete entries for dead interned string and clean up unreferenced symbols in symbol table. |
166 // Prune dead klasses from subklass/sibling/implementor lists. |
167 g1h->unlink_string_and_symbol_table(&GenMarkSweep::is_alive); |
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 } |
168 |
180 |
169 if (VerifyDuringGC) { |
181 if (VerifyDuringGC) { |
170 HandleMark hm; // handle scope |
182 HandleMark hm; // handle scope |
171 #if defined(COMPILER2) || INCLUDE_JVMCI |
183 #if defined(COMPILER2) || INCLUDE_JVMCI |
172 DerivedPointerTableDeactivate dpt_deact; |
184 DerivedPointerTableDeactivate dpt_deact; |