--- old/src/hotspot/share/gc/g1/g1OopClosures.inline.hpp 2018-10-30 10:46:05.515173228 +0100 +++ new/src/hotspot/share/gc/g1/g1OopClosures.inline.hpp 2018-10-30 10:46:05.092160224 +0100 @@ -82,10 +82,7 @@ const InCSetState state = _g1h->in_cset_state(obj); if (state.is_in_cset()) { prefetch_and_push(p, obj); - } else { - if (HeapRegion::is_in_same_region(p, obj)) { - return; - } + } else if (!HeapRegion::is_in_same_region(p, obj)) { handle_non_cset_obj_common(state, p, obj); if (_scanning_in_young) { return; @@ -175,10 +172,7 @@ // Since the source is always from outside the collection set, here we implicitly know // that this is a cross-region reference too. prefetch_and_push(p, obj); - } else { - if (HeapRegion::is_in_same_region(p, obj)) { - return; - } + } else if (!HeapRegion::is_in_same_region(p, obj)) { handle_non_cset_obj_common(state, p, obj); _par_scan_state->enqueue_card_if_tracked(p, obj); } @@ -195,10 +189,7 @@ const InCSetState state = _g1h->in_cset_state(obj); if (state.is_in_cset()) { prefetch_and_push(p, obj); - } else { - if (HeapRegion::is_in_same_region(p, obj)) { - return; - } + } else if (!HeapRegion::is_in_same_region(p, obj)) { handle_non_cset_obj_common(state, p, obj); } }