RFR (M): 8066780, 8066781, 8066782: Cleanup of duplicated code in TenuredGeneration and ConcurrentMarkSweepGeneration

Bengt Rutisson bengt.rutisson at oracle.com
Fri Dec 5 15:18:31 UTC 2014


Hi everyone,

I was looking at the duplicated code in TenuredGeneration and 
ConcurrentMarkSweepGeneration and wanted to clean it up. I decided to 
split the cleanup into three parts (thanks Kim for suggesting that in a 
pre-review). The parts are closely related so I think it is a good idea 
to review them together. Thus, I'm asking for reviews for all three 
changes in this same email.

Here are the three changes:

Split CardGeneration out to its own file
https://bugs.openjdk.java.net/browse/JDK-8066780
http://cr.openjdk.java.net/~brutisso/8066780/webrev.00/

Just moving code from generations.cpp/hpp to cardGeneration.cpp/hpp.


Minor cleanups to TenuredGeneration
https://bugs.openjdk.java.net/browse/JDK-8066781
http://cr.openjdk.java.net/~brutisso/8066781/webrev.00/

Removing some dead code and making sure that the include guard in the 
inline file is correctly named. The _last_gc variable was exported to 
the SA agent but the SA agent never referenced it.

Move common code from CMSGeneration and TenuredGeneration to CardGeneration
https://bugs.openjdk.java.net/browse/JDK-8066782
http://cr.openjdk.java.net/~brutisso/8066782/webrev.00/

This is the actual move of common code from TenuredGeneration and 
ConcurrentMarkSweepGeneration to CardGeneration. Both subclasses use a 
single Space instance and by allowing CardGeneration to find that space 
instance it was possible to move many of the methods that work on the 
Space instance up to the CardGeneration too.

One of the changes is to rename the expand() method in 
ConcurrentMarkSweepGeneration that took three paramteres to 
expand_for_gc_reason(). I did this to avoid that anyone thinks that 
ConcurrentMarkSweepGeneration overrides the CardGeneration::expand() 
method. This change is included in the webrev above, but if it makes 
things easier I also split it out to a separate webrev:

http://cr.openjdk.java.net/~brutisso/8066782/expand_for_gc_cause.00/

Thanks,
Bengt


More information about the hotspot-gc-dev mailing list