There is the following code in G1CopyingKeepAliveClosure::do_oop_work:
if (_g1h->is_in_cset_or_humongous(obj)) {
[...]
if (_g1h->is_in_g1_reserved(p)) {
_par_scan_state->push_on_queue(p);
} else {
assert(!Metaspace::contains((const void*)p),
"Unexpectedly found a pointer from metadata: " PTR_FORMAT, p2i(p));
_copy_non_heap_obj_cl->do_oop(p);
}
}
is_in_cset_or_humongous() implies is_in_g1_reserved(), so the condition and the else-part can be removed.
if (_g1h->is_in_cset_or_humongous(obj)) {
[...]
if (_g1h->is_in_g1_reserved(p)) {
_par_scan_state->push_on_queue(p);
} else {
assert(!Metaspace::contains((const void*)p),
"Unexpectedly found a pointer from metadata: " PTR_FORMAT, p2i(p));
_copy_non_heap_obj_cl->do_oop(p);
}
}
is_in_cset_or_humongous() implies is_in_g1_reserved(), so the condition and the else-part can be removed.