8201826: G1: Don't invoke WeakProcessor if mark stack has overflowed
Move WeakProcessor invocation after overflow check Reviewed-by: stefank, tschatzl
This commit is contained in:
parent
816e2e5fe0
commit
a99eca12cc
@ -1695,14 +1695,6 @@ void G1ConcurrentMark::weak_refs_work(bool clear_all_soft_refs) {
|
|||||||
assert(!rp->discovery_enabled(), "Post condition");
|
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()) {
|
if (has_overflown()) {
|
||||||
// We can not trust g1_is_alive if the marking stack overflowed
|
// We can not trust g1_is_alive if the marking stack overflowed
|
||||||
return;
|
return;
|
||||||
@ -1710,6 +1702,11 @@ void G1ConcurrentMark::weak_refs_work(bool clear_all_soft_refs) {
|
|||||||
|
|
||||||
assert(_global_mark_stack.is_empty(), "Marking should have completed");
|
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.
|
// Unload Klasses, String, Symbols, Code Cache, etc.
|
||||||
if (ClassUnloadingWithConcurrentMark) {
|
if (ClassUnloadingWithConcurrentMark) {
|
||||||
GCTraceTime(Debug, gc, phases) debug("Class Unloading", _gc_timer_cm);
|
GCTraceTime(Debug, gc, phases) debug("Class Unloading", _gc_timer_cm);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user