RFR (M): JDK-8040722: G1: Clean up usages of heap_region_containing
Bengt Rutisson
bengt.rutisson at oracle.com
Wed Apr 16 13:46:40 UTC 2014
Hi everyone,
Could I please have a few reviews of this cleanup?
http://cr.openjdk.java.net/~brutisso/8040722/webrev.00/
Background:
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.
Thanks,
Bengt
More information about the hotspot-gc-dev
mailing list