1638
1639 if (has_overflown()) {
1640 // We can not trust g1_is_alive and the contents of the heap if the marking stack
1641 // overflowed while processing references. Exit the VM.
1642 fatal("Overflow during reference processing, can not continue. Please "
1643 "increase MarkStackSizeMax (current value: " SIZE_FORMAT ") and "
1644 "restart.", MarkStackSizeMax);
1645 return;
1646 }
1647
1648 assert(_global_mark_stack.is_empty(), "Marking should have completed");
1649
1650 {
1651 GCTraceTime(Debug, gc, phases) debug("Weak Processing", _gc_timer_cm);
1652 WeakProcessor::weak_oops_do(_g1h->workers(), &g1_is_alive, &do_nothing_cl, 1);
1653 }
1654
1655 // Unload Klasses, String, Code Cache, etc.
1656 if (ClassUnloadingWithConcurrentMark) {
1657 GCTraceTime(Debug, gc, phases) debug("Class Unloading", _gc_timer_cm);
1658 bool purged_classes = SystemDictionary::do_unloading(_gc_timer_cm, false /* Defer cleaning */);
1659 _g1h->complete_cleaning(&g1_is_alive, purged_classes);
1660 } else {
1661 GCTraceTime(Debug, gc, phases) debug("Cleanup", _gc_timer_cm);
1662 // No need to clean string table as it is treated as strong roots when
1663 // class unloading is disabled.
1664 _g1h->partial_cleaning(&g1_is_alive, false, G1StringDedup::is_enabled());
1665 }
1666 }
1667
1668 class G1PrecleanYieldClosure : public YieldClosure {
1669 G1ConcurrentMark* _cm;
1670
1671 public:
1672 G1PrecleanYieldClosure(G1ConcurrentMark* cm) : _cm(cm) { }
1673
1674 virtual bool should_return() {
1675 return _cm->has_aborted();
1676 }
1677
1678 virtual bool should_return_fine_grain() {
|
1638
1639 if (has_overflown()) {
1640 // We can not trust g1_is_alive and the contents of the heap if the marking stack
1641 // overflowed while processing references. Exit the VM.
1642 fatal("Overflow during reference processing, can not continue. Please "
1643 "increase MarkStackSizeMax (current value: " SIZE_FORMAT ") and "
1644 "restart.", MarkStackSizeMax);
1645 return;
1646 }
1647
1648 assert(_global_mark_stack.is_empty(), "Marking should have completed");
1649
1650 {
1651 GCTraceTime(Debug, gc, phases) debug("Weak Processing", _gc_timer_cm);
1652 WeakProcessor::weak_oops_do(_g1h->workers(), &g1_is_alive, &do_nothing_cl, 1);
1653 }
1654
1655 // Unload Klasses, String, Code Cache, etc.
1656 if (ClassUnloadingWithConcurrentMark) {
1657 GCTraceTime(Debug, gc, phases) debug("Class Unloading", _gc_timer_cm);
1658 bool purged_classes = SystemDictionary::do_unloading(_gc_timer_cm);
1659 _g1h->complete_cleaning(&g1_is_alive, purged_classes);
1660 } else {
1661 GCTraceTime(Debug, gc, phases) debug("Cleanup", _gc_timer_cm);
1662 // No need to clean string table as it is treated as strong roots when
1663 // class unloading is disabled.
1664 _g1h->partial_cleaning(&g1_is_alive, false, G1StringDedup::is_enabled());
1665 }
1666 }
1667
1668 class G1PrecleanYieldClosure : public YieldClosure {
1669 G1ConcurrentMark* _cm;
1670
1671 public:
1672 G1PrecleanYieldClosure(G1ConcurrentMark* cm) : _cm(cm) { }
1673
1674 virtual bool should_return() {
1675 return _cm->has_aborted();
1676 }
1677
1678 virtual bool should_return_fine_grain() {
|