2086 2087 // Process reference objects found during marking 2088 { 2089 GCTraceTime(Trace, gc, phases) tm("Reference Processing", &_gc_timer); 2090 2091 ReferenceProcessorStats stats; 2092 if (ref_processor()->processing_is_mt()) { 2093 RefProcTaskExecutor task_executor; 2094 stats = ref_processor()->process_discovered_references( 2095 is_alive_closure(), &mark_and_push_closure, &follow_stack_closure, 2096 &task_executor, &_gc_timer); 2097 } else { 2098 stats = ref_processor()->process_discovered_references( 2099 is_alive_closure(), &mark_and_push_closure, &follow_stack_closure, NULL, 2100 &_gc_timer); 2101 } 2102 2103 gc_tracer->report_gc_reference_stats(stats); 2104 } 2105 2106 GCTraceTime(Trace, gc) tm_m("Class Unloading", &_gc_timer); 2107 2108 // This is the point where the entire marking should have completed. 2109 assert(cm->marking_stacks_empty(), "Marking should have completed"); 2110 2111 // Follow system dictionary roots and unload classes. 2112 bool purged_class = SystemDictionary::do_unloading(is_alive_closure()); 2113 2114 // Unload nmethods. 2115 CodeCache::do_unloading(is_alive_closure(), purged_class); 2116 2117 // Prune dead klasses from subklass/sibling/implementor lists. 2118 Klass::clean_weak_klass_links(is_alive_closure()); 2119 2120 // Delete entries for dead interned strings. 2121 StringTable::unlink(is_alive_closure()); 2122 2123 // Clean up unreferenced symbols in symbol table. 2124 SymbolTable::unlink(); 2125 _gc_tracer.report_object_count_after_gc(is_alive_closure()); 2126 } 2127 2128 // This should be moved to the shared markSweep code! 2129 class PSAlwaysTrueClosure: public BoolObjectClosure { 2130 public: 2131 bool do_object_b(oop p) { return true; } 2132 }; 2133 static PSAlwaysTrueClosure always_true; 2134 2135 void PSParallelCompact::adjust_roots(ParCompactionManager* cm) { 2136 // Adjust the pointers to reflect the new locations 2137 GCTraceTime(Trace, gc, phases) tm("Adjust Roots", &_gc_timer); 2138 2139 // Need new claim bits when tracing through and adjusting pointers. 2140 ClassLoaderDataGraph::clear_claimed_marks(); 2141 2142 PSParallelCompact::AdjustPointerClosure oop_closure(cm); 2143 PSParallelCompact::AdjustKlassClosure klass_closure(cm); 2144 | 2086 2087 // Process reference objects found during marking 2088 { 2089 GCTraceTime(Trace, gc, phases) tm("Reference Processing", &_gc_timer); 2090 2091 ReferenceProcessorStats stats; 2092 if (ref_processor()->processing_is_mt()) { 2093 RefProcTaskExecutor task_executor; 2094 stats = ref_processor()->process_discovered_references( 2095 is_alive_closure(), &mark_and_push_closure, &follow_stack_closure, 2096 &task_executor, &_gc_timer); 2097 } else { 2098 stats = ref_processor()->process_discovered_references( 2099 is_alive_closure(), &mark_and_push_closure, &follow_stack_closure, NULL, 2100 &_gc_timer); 2101 } 2102 2103 gc_tracer->report_gc_reference_stats(stats); 2104 } 2105 2106 // This is the point where the entire marking should have completed. 2107 assert(cm->marking_stacks_empty(), "Marking should have completed"); 2108 2109 { 2110 GCTraceTime(Debug, gc) tm_m("Class Unloading", &_gc_timer); 2111 2112 // Follow system dictionary roots and unload classes. 2113 bool purged_class = SystemDictionary::do_unloading(is_alive_closure()); 2114 2115 // Unload nmethods. 2116 CodeCache::do_unloading(is_alive_closure(), purged_class); 2117 2118 // Prune dead klasses from subklass/sibling/implementor lists. 2119 Klass::clean_weak_klass_links(is_alive_closure()); 2120 } 2121 2122 { 2123 GCTraceTime(Debug, gc) t("Scrub String Table", &_gc_timer); 2124 // Delete entries for dead interned strings. 2125 StringTable::unlink(is_alive_closure()); 2126 } 2127 2128 { 2129 GCTraceTime(Debug, gc) t("Scrub Symbol Table", &_gc_timer); 2130 // Clean up unreferenced symbols in symbol table. 2131 SymbolTable::unlink(); 2132 } 2133 2134 _gc_tracer.report_object_count_after_gc(is_alive_closure()); 2135 } 2136 2137 // This should be moved to the shared markSweep code! 2138 class PSAlwaysTrueClosure: public BoolObjectClosure { 2139 public: 2140 bool do_object_b(oop p) { return true; } 2141 }; 2142 static PSAlwaysTrueClosure always_true; 2143 2144 void PSParallelCompact::adjust_roots(ParCompactionManager* cm) { 2145 // Adjust the pointers to reflect the new locations 2146 GCTraceTime(Trace, gc, phases) tm("Adjust Roots", &_gc_timer); 2147 2148 // Need new claim bits when tracing through and adjusting pointers. 2149 ClassLoaderDataGraph::clear_claimed_marks(); 2150 2151 PSParallelCompact::AdjustPointerClosure oop_closure(cm); 2152 PSParallelCompact::AdjustKlassClosure klass_closure(cm); 2153 |