JDK-8040722 : G1: Clean up usages of heap_region_containing
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 9
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • CPU: other,unknown
  • Submitted: 2014-04-16
  • Updated: 2015-01-21
  • Resolved: 2014-04-17
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 JDK 9
8u40Fixed 9 b12Fixed
Description
Before the perm gen was removed G1CollectedHeap::heap_region_containing() could return NULL for addresses in the perm gen. This means that a lot of code had to check the result since it could potentially be NULL.

Now the only reason to return NULL is if the address passed in NULL. In many places it is possible to know that the address is not NULL and in the other places it is just as simple to check the address for NULL before calling G1CollectedHeap::heap_region_containing() rather than checking for NULL after having called it.

So, to simplify the code a bit we can assert that G1CollectedHeap::heap_region_containing() never returns NULL and then only check before we call it in the places where we would otherwise have passed NULL to it.