6005 rp->process_discovered_references(&_is_alive_closure, |
6005 rp->process_discovered_references(&_is_alive_closure, |
6006 &cmsKeepAliveClosure, |
6006 &cmsKeepAliveClosure, |
6007 &cmsDrainMarkingStackClosure, |
6007 &cmsDrainMarkingStackClosure, |
6008 NULL); |
6008 NULL); |
6009 } |
6009 } |
6010 verify_work_stacks_empty(); |
6010 } |
6011 } |
6011 |
|
6012 // This is the point where the entire marking should have completed. |
|
6013 verify_work_stacks_empty(); |
6012 |
6014 |
6013 if (should_unload_classes()) { |
6015 if (should_unload_classes()) { |
6014 { |
6016 { |
6015 TraceTime t("class unloading", PrintGCDetails, false, gclog_or_tty); |
6017 TraceTime t("class unloading", PrintGCDetails, false, gclog_or_tty); |
6016 |
6018 |
6017 // Follow SystemDictionary roots and unload classes |
6019 // Unload classes and purge the SystemDictionary. |
6018 bool purged_class = SystemDictionary::do_unloading(&_is_alive_closure); |
6020 bool purged_class = SystemDictionary::do_unloading(&_is_alive_closure); |
6019 |
6021 |
6020 // Follow CodeCache roots and unload any methods marked for unloading |
6022 // Unload nmethods. |
6021 CodeCache::do_unloading(&_is_alive_closure, purged_class); |
6023 CodeCache::do_unloading(&_is_alive_closure, purged_class); |
6022 |
6024 |
6023 cmsDrainMarkingStackClosure.do_void(); |
6025 // Prune dead klasses from subklass/sibling/implementor lists. |
6024 verify_work_stacks_empty(); |
|
6025 |
|
6026 // Update subklass/sibling/implementor links in KlassKlass descendants |
|
6027 Klass::clean_weak_klass_links(&_is_alive_closure); |
6026 Klass::clean_weak_klass_links(&_is_alive_closure); |
6028 // Nothing should have been pushed onto the working stacks. |
|
6029 verify_work_stacks_empty(); |
|
6030 } |
6027 } |
6031 |
6028 |
6032 { |
6029 { |
6033 TraceTime t("scrub symbol table", PrintGCDetails, false, gclog_or_tty); |
6030 TraceTime t("scrub symbol table", PrintGCDetails, false, gclog_or_tty); |
6034 // Clean up unreferenced symbols in symbol table. |
6031 // Clean up unreferenced symbols in symbol table. |
6038 |
6035 |
6039 // CMS doesn't use the StringTable as hard roots when class unloading is turned off. |
6036 // CMS doesn't use the StringTable as hard roots when class unloading is turned off. |
6040 // Need to check if we really scanned the StringTable. |
6037 // Need to check if we really scanned the StringTable. |
6041 if ((roots_scanning_options() & SharedHeap::SO_Strings) == 0) { |
6038 if ((roots_scanning_options() & SharedHeap::SO_Strings) == 0) { |
6042 TraceTime t("scrub string table", PrintGCDetails, false, gclog_or_tty); |
6039 TraceTime t("scrub string table", PrintGCDetails, false, gclog_or_tty); |
6043 // Now clean up stale oops in StringTable |
6040 // Delete entries for dead interned strings. |
6044 StringTable::unlink(&_is_alive_closure); |
6041 StringTable::unlink(&_is_alive_closure); |
6045 } |
6042 } |
6046 |
6043 |
6047 verify_work_stacks_empty(); |
|
6048 // Restore any preserved marks as a result of mark stack or |
6044 // Restore any preserved marks as a result of mark stack or |
6049 // work queue overflow |
6045 // work queue overflow |
6050 restore_preserved_marks_if_any(); // done single-threaded for now |
6046 restore_preserved_marks_if_any(); // done single-threaded for now |
6051 |
6047 |
6052 rp->set_enqueuing_is_done(true); |
6048 rp->set_enqueuing_is_done(true); |