< prev index next >

src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp

Print this page
rev 60538 : imported patch jep387-misc.patch


2185   {
2186     ShenandoahGCPhase phase(full_gc ?
2187                             ShenandoahPhaseTimings::full_gc_purge_class_unload :
2188                             ShenandoahPhaseTimings::purge_class_unload);
2189     bool purged_class = SystemDictionary::do_unloading(gc_timer());
2190 
2191     ShenandoahIsAliveSelector is_alive;
2192     uint num_workers = _workers->active_workers();
2193     ShenandoahClassUnloadingTask unlink_task(is_alive.is_alive_closure(), num_workers, purged_class);
2194     _workers->run_task(&unlink_task);
2195   }
2196 
2197   {
2198     ShenandoahGCPhase phase(full_gc ?
2199                             ShenandoahPhaseTimings::full_gc_purge_cldg :
2200                             ShenandoahPhaseTimings::purge_cldg);
2201     ClassLoaderDataGraph::purge();
2202   }
2203   // Resize and verify metaspace
2204   MetaspaceGC::compute_new_size();
2205   MetaspaceUtils::verify_metrics();
2206 }
2207 
2208 // Weak roots are either pre-evacuated (final mark) or updated (final updaterefs),
2209 // so they should not have forwarded oops.
2210 // However, we do need to "null" dead oops in the roots, if can not be done
2211 // in concurrent cycles.
2212 void ShenandoahHeap::stw_process_weak_roots(bool full_gc) {
2213   ShenandoahGCPhase root_phase(full_gc ?
2214                                ShenandoahPhaseTimings::full_gc_purge :
2215                                ShenandoahPhaseTimings::purge);
2216   uint num_workers = _workers->active_workers();
2217   ShenandoahPhaseTimings::Phase timing_phase = full_gc ?
2218                                                ShenandoahPhaseTimings::full_gc_purge_weak_par :
2219                                                ShenandoahPhaseTimings::purge_weak_par;
2220   ShenandoahGCPhase phase(timing_phase);
2221   ShenandoahGCWorkerPhase worker_phase(timing_phase);
2222 
2223   // Cleanup weak roots
2224   if (has_forwarded_objects()) {
2225     ShenandoahForwardedIsAliveClosure is_alive;




2185   {
2186     ShenandoahGCPhase phase(full_gc ?
2187                             ShenandoahPhaseTimings::full_gc_purge_class_unload :
2188                             ShenandoahPhaseTimings::purge_class_unload);
2189     bool purged_class = SystemDictionary::do_unloading(gc_timer());
2190 
2191     ShenandoahIsAliveSelector is_alive;
2192     uint num_workers = _workers->active_workers();
2193     ShenandoahClassUnloadingTask unlink_task(is_alive.is_alive_closure(), num_workers, purged_class);
2194     _workers->run_task(&unlink_task);
2195   }
2196 
2197   {
2198     ShenandoahGCPhase phase(full_gc ?
2199                             ShenandoahPhaseTimings::full_gc_purge_cldg :
2200                             ShenandoahPhaseTimings::purge_cldg);
2201     ClassLoaderDataGraph::purge();
2202   }
2203   // Resize and verify metaspace
2204   MetaspaceGC::compute_new_size();
2205   DEBUG_ONLY(MetaspaceUtils::verify(false);)
2206 }
2207 
2208 // Weak roots are either pre-evacuated (final mark) or updated (final updaterefs),
2209 // so they should not have forwarded oops.
2210 // However, we do need to "null" dead oops in the roots, if can not be done
2211 // in concurrent cycles.
2212 void ShenandoahHeap::stw_process_weak_roots(bool full_gc) {
2213   ShenandoahGCPhase root_phase(full_gc ?
2214                                ShenandoahPhaseTimings::full_gc_purge :
2215                                ShenandoahPhaseTimings::purge);
2216   uint num_workers = _workers->active_workers();
2217   ShenandoahPhaseTimings::Phase timing_phase = full_gc ?
2218                                                ShenandoahPhaseTimings::full_gc_purge_weak_par :
2219                                                ShenandoahPhaseTimings::purge_weak_par;
2220   ShenandoahGCPhase phase(timing_phase);
2221   ShenandoahGCWorkerPhase worker_phase(timing_phase);
2222 
2223   // Cleanup weak roots
2224   if (has_forwarded_objects()) {
2225     ShenandoahForwardedIsAliveClosure is_alive;


< prev index next >