The classes {Register,Unregister}NMethodOopClosure implement both oop* and narrowOop* do_oop overloads, using a shared function template. However, these are called from nmethod::oops_do, which only ever calls the do_oop(oop*) overload. As a result, generating code for the narrowOop* overload is just a waste of time and space. The body of the narrowOop* overload could just be ShouldNotReachHere(), and move the function template code directly into the oop* overload.
In addition, the do_oop implementations for these closures get the associated region for the oop using heap_region_containing. They then assert the region is not a continues_humongous region. But that isn't possible here, since heap_region_containing implicitly resolves continues_humongous to the associated start_humongous region. And besides, an oop that refers to a continues_humongous region has other problems, which would be better handled in heap_region_containing. So the assert in this case is just a big blob of uninteresting and unneeded code.
In addition, the do_oop implementations for these closures get the associated region for the oop using heap_region_containing. They then assert the region is not a continues_humongous region. But that isn't possible here, since heap_region_containing implicitly resolves continues_humongous to the associated start_humongous region. And besides, an oop that refers to a continues_humongous region has other problems, which would be better handled in heap_region_containing. So the assert in this case is just a big blob of uninteresting and unneeded code.
- relates to
-
JDK-8139867 Change how startsHumongous and continuesHumongous regions work in G1.
-
- Resolved
-