< prev index next >

src/hotspot/share/gc/g1/g1ConcurrentMark.cpp

Print this page




1673     // The do_oop work routines of the keep_alive and drain_marking_stack
1674     // oop closures will set the has_overflown flag if we overflow the
1675     // global marking stack.
1676 
1677     assert(has_overflown() || _global_mark_stack.is_empty(),
1678             "Mark stack should be empty (unless it has overflown)");
1679 
1680     assert(rp->num_q() == active_workers, "why not");
1681 
1682     rp->enqueue_discovered_references(executor, &pt);
1683 
1684     rp->verify_no_references_recorded();
1685 
1686     pt.print_enqueue_phase();
1687 
1688     assert(!rp->discovery_enabled(), "Post condition");
1689   }
1690 
1691   {
1692     GCTraceTime(Debug, gc, phases) debug("Weak Processing", _gc_timer_cm);
1693     WeakProcessor::unlink_or_oops_do(&g1_is_alive, &g1_keep_alive, &g1_drain_mark_stack);
1694   }
1695 
1696   if (has_overflown()) {
1697     // We can not trust g1_is_alive if the marking stack overflowed
1698     return;
1699   }
1700 
1701   assert(_global_mark_stack.is_empty(), "Marking should have completed");
1702 
1703   // Unload Klasses, String, Symbols, Code Cache, etc.
1704   if (ClassUnloadingWithConcurrentMark) {
1705     GCTraceTime(Debug, gc, phases) debug("Class Unloading", _gc_timer_cm);
1706     bool purged_classes = SystemDictionary::do_unloading(&g1_is_alive, _gc_timer_cm, false /* Defer cleaning */);
1707     g1h->complete_cleaning(&g1_is_alive, purged_classes);
1708   } else {
1709     GCTraceTime(Debug, gc, phases) debug("Cleanup", _gc_timer_cm);
1710     // No need to clean string table and symbol table as they are treated as strong roots when
1711     // class unloading is disabled.
1712     g1h->partial_cleaning(&g1_is_alive, false, false, G1StringDedup::is_enabled());
1713 




1673     // The do_oop work routines of the keep_alive and drain_marking_stack
1674     // oop closures will set the has_overflown flag if we overflow the
1675     // global marking stack.
1676 
1677     assert(has_overflown() || _global_mark_stack.is_empty(),
1678             "Mark stack should be empty (unless it has overflown)");
1679 
1680     assert(rp->num_q() == active_workers, "why not");
1681 
1682     rp->enqueue_discovered_references(executor, &pt);
1683 
1684     rp->verify_no_references_recorded();
1685 
1686     pt.print_enqueue_phase();
1687 
1688     assert(!rp->discovery_enabled(), "Post condition");
1689   }
1690 
1691   {
1692     GCTraceTime(Debug, gc, phases) debug("Weak Processing", _gc_timer_cm);
1693     WeakProcessor::weak_oops_do(&g1_is_alive, &g1_keep_alive, &g1_drain_mark_stack);
1694   }
1695 
1696   if (has_overflown()) {
1697     // We can not trust g1_is_alive if the marking stack overflowed
1698     return;
1699   }
1700 
1701   assert(_global_mark_stack.is_empty(), "Marking should have completed");
1702 
1703   // Unload Klasses, String, Symbols, Code Cache, etc.
1704   if (ClassUnloadingWithConcurrentMark) {
1705     GCTraceTime(Debug, gc, phases) debug("Class Unloading", _gc_timer_cm);
1706     bool purged_classes = SystemDictionary::do_unloading(&g1_is_alive, _gc_timer_cm, false /* Defer cleaning */);
1707     g1h->complete_cleaning(&g1_is_alive, purged_classes);
1708   } else {
1709     GCTraceTime(Debug, gc, phases) debug("Cleanup", _gc_timer_cm);
1710     // No need to clean string table and symbol table as they are treated as strong roots when
1711     // class unloading is disabled.
1712     g1h->partial_cleaning(&g1_is_alive, false, false, G1StringDedup::is_enabled());
1713 


< prev index next >