5251 verify_work_stacks_empty();
5252
5253 {
5254 GCTraceTime(Debug, gc, phases) t("Weak Processing", _gc_timer_cm);
5255 WeakProcessor::weak_oops_do(&_is_alive_closure, &do_nothing_cl);
5256 }
5257
5258 if (should_unload_classes()) {
5259 {
5260 GCTraceTime(Debug, gc, phases) t("Class Unloading", _gc_timer_cm);
5261
5262 // Unload classes and purge the SystemDictionary.
5263 bool purged_class = SystemDictionary::do_unloading(_gc_timer_cm);
5264
5265 // Unload nmethods.
5266 CodeCache::do_unloading(&_is_alive_closure, purged_class);
5267
5268 // Prune dead klasses from subklass/sibling/implementor lists.
5269 Klass::clean_weak_klass_links(purged_class);
5270
5271 #if INCLUDE_JVMCI
5272 // Clean JVMCI metadata handles.
5273 JVMCI::do_unloading(&_is_alive_closure, purged_class);
5274 #endif
5275 }
5276 }
5277
5278 // Restore any preserved marks as a result of mark stack or
5279 // work queue overflow
5280 restore_preserved_marks_if_any(); // done single-threaded for now
5281
5282 rp->set_enqueuing_is_done(true);
5283 rp->verify_no_references_recorded();
5284 }
5285
5286 #ifndef PRODUCT
5287 void CMSCollector::check_correct_thread_executing() {
5288 Thread* t = Thread::current();
5289 // Only the VM thread or the CMS thread should be here.
5290 assert(t->is_ConcurrentGC_thread() || t->is_VM_thread(),
5291 "Unexpected thread type");
5292 // If this is the vm thread, the foreground process
5293 // should not be waiting. Note that _foregroundGCIsActive is
5294 // true while the foreground collector is waiting.
|
5251 verify_work_stacks_empty();
5252
5253 {
5254 GCTraceTime(Debug, gc, phases) t("Weak Processing", _gc_timer_cm);
5255 WeakProcessor::weak_oops_do(&_is_alive_closure, &do_nothing_cl);
5256 }
5257
5258 if (should_unload_classes()) {
5259 {
5260 GCTraceTime(Debug, gc, phases) t("Class Unloading", _gc_timer_cm);
5261
5262 // Unload classes and purge the SystemDictionary.
5263 bool purged_class = SystemDictionary::do_unloading(_gc_timer_cm);
5264
5265 // Unload nmethods.
5266 CodeCache::do_unloading(&_is_alive_closure, purged_class);
5267
5268 // Prune dead klasses from subklass/sibling/implementor lists.
5269 Klass::clean_weak_klass_links(purged_class);
5270
5271 // Clean JVMCI metadata handles.
5272 JVMCI_ONLY(JVMCI::do_unloading(&_is_alive_closure, purged_class));
5273 }
5274 }
5275
5276 // Restore any preserved marks as a result of mark stack or
5277 // work queue overflow
5278 restore_preserved_marks_if_any(); // done single-threaded for now
5279
5280 rp->set_enqueuing_is_done(true);
5281 rp->verify_no_references_recorded();
5282 }
5283
5284 #ifndef PRODUCT
5285 void CMSCollector::check_correct_thread_executing() {
5286 Thread* t = Thread::current();
5287 // Only the VM thread or the CMS thread should be here.
5288 assert(t->is_ConcurrentGC_thread() || t->is_VM_thread(),
5289 "Unexpected thread type");
5290 // If this is the vm thread, the foreground process
5291 // should not be waiting. Note that _foregroundGCIsActive is
5292 // true while the foreground collector is waiting.
|