RFR: 8072809 - Clean up gen_process_roots() after generation array removal

Jesper Wilhelmsson jesper.wilhelmsson at oracle.com
Wed Sep 9 21:02:28 UTC 2015


Hi,

The generation cleanup inspired several other cleanups. Please review a few of 
them here.


1. gen_process_roots()
In the generation array world this method was used to process roots for any 
given generation and did different things based on which generation it 
processed. I split it into two methods, one for the young generation and one for 
the old. This made the code a lot cleaner and easier to read. Even though the 
method was "duplicated" the result is only five lines of code longer, and this 
patch all in all actually removes more lines than it adds. :)


2. Generation::spec()
Generation::spec() is only called in a few places and all of them are really 
looking for the initial size of the generation. I replaced Generation::spec() 
with Generation::initial_size().


3. GenCollectedHeap::gc_stats()
Not only was this method unused, is was also completely pointless. Removed.


4. Generation::full_collects_young_generation()
This method is only ever called in old generations, and all old generations 
override it and return !ScavengeBeforeFullGC. The method was removed and the 
flag is checked directly in the only place it was called.


Bug: https://bugs.openjdk.java.net/browse/JDK-8072809
Webrev: http://cr.openjdk.java.net/~jwilhelm/8072809/webrev.00/

Testing: RBT vm.gc on all platforms.

Thanks,
/Jesper



More information about the hotspot-gc-dev mailing list