--- old/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp 2018-04-19 00:46:37.218820834 -0400 +++ new/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp 2018-04-19 00:46:36.990808900 -0400 @@ -1695,14 +1695,6 @@ assert(!rp->discovery_enabled(), "Post condition"); } - assert(has_overflown() || _global_mark_stack.is_empty(), - "Mark stack should be empty (unless it has overflown)"); - - { - GCTraceTime(Debug, gc, phases) debug("Weak Processing", _gc_timer_cm); - WeakProcessor::weak_oops_do(&g1_is_alive, &do_nothing_cl); - } - if (has_overflown()) { // We can not trust g1_is_alive if the marking stack overflowed return; @@ -1710,6 +1702,11 @@ assert(_global_mark_stack.is_empty(), "Marking should have completed"); + { + GCTraceTime(Debug, gc, phases) debug("Weak Processing", _gc_timer_cm); + WeakProcessor::weak_oops_do(&g1_is_alive, &do_nothing_cl); + } + // Unload Klasses, String, Symbols, Code Cache, etc. if (ClassUnloadingWithConcurrentMark) { GCTraceTime(Debug, gc, phases) debug("Class Unloading", _gc_timer_cm);