1660
1661 // Process the weak references.
1662 const ReferenceProcessorStats& stats =
1663 rp->process_discovered_references(&g1_is_alive,
1664 &g1_keep_alive,
1665 &g1_drain_mark_stack,
1666 executor,
1667 &pt);
1668 _gc_tracer_cm->report_gc_reference_stats(stats);
1669 pt.print_all_references();
1670
1671 // The do_oop work routines of the keep_alive and drain_marking_stack
1672 // oop closures will set the has_overflown flag if we overflow the
1673 // global marking stack.
1674
1675 assert(has_overflown() || _global_mark_stack.is_empty(),
1676 "Mark stack should be empty (unless it has overflown)");
1677
1678 assert(rp->num_queues() == active_workers, "why not");
1679
1680 rp->enqueue_discovered_references(executor, &pt);
1681
1682 rp->verify_no_references_recorded();
1683
1684 pt.print_enqueue_phase();
1685
1686 assert(!rp->discovery_enabled(), "Post condition");
1687 }
1688
1689 assert(has_overflown() || _global_mark_stack.is_empty(),
1690 "Mark stack should be empty (unless it has overflown)");
1691
1692 {
1693 GCTraceTime(Debug, gc, phases) debug("Weak Processing", _gc_timer_cm);
1694 WeakProcessor::weak_oops_do(&g1_is_alive, &do_nothing_cl);
1695 }
1696
1697 if (has_overflown()) {
1698 // We can not trust g1_is_alive if the marking stack overflowed
1699 return;
1700 }
1701
1702 assert(_global_mark_stack.is_empty(), "Marking should have completed");
1703
1704 // Unload Klasses, String, Symbols, Code Cache, etc.
1705 if (ClassUnloadingWithConcurrentMark) {
|
1660
1661 // Process the weak references.
1662 const ReferenceProcessorStats& stats =
1663 rp->process_discovered_references(&g1_is_alive,
1664 &g1_keep_alive,
1665 &g1_drain_mark_stack,
1666 executor,
1667 &pt);
1668 _gc_tracer_cm->report_gc_reference_stats(stats);
1669 pt.print_all_references();
1670
1671 // The do_oop work routines of the keep_alive and drain_marking_stack
1672 // oop closures will set the has_overflown flag if we overflow the
1673 // global marking stack.
1674
1675 assert(has_overflown() || _global_mark_stack.is_empty(),
1676 "Mark stack should be empty (unless it has overflown)");
1677
1678 assert(rp->num_queues() == active_workers, "why not");
1679
1680 rp->verify_no_references_recorded();
1681 assert(!rp->discovery_enabled(), "Post condition");
1682 }
1683
1684 assert(has_overflown() || _global_mark_stack.is_empty(),
1685 "Mark stack should be empty (unless it has overflown)");
1686
1687 {
1688 GCTraceTime(Debug, gc, phases) debug("Weak Processing", _gc_timer_cm);
1689 WeakProcessor::weak_oops_do(&g1_is_alive, &do_nothing_cl);
1690 }
1691
1692 if (has_overflown()) {
1693 // We can not trust g1_is_alive if the marking stack overflowed
1694 return;
1695 }
1696
1697 assert(_global_mark_stack.is_empty(), "Marking should have completed");
1698
1699 // Unload Klasses, String, Symbols, Code Cache, etc.
1700 if (ClassUnloadingWithConcurrentMark) {
|