RFR (S): 8066566: Refactor ParNewGeneration to contain ParNewTracer

Kim Barrett kim.barrett at oracle.com
Tue Feb 10 05:24:56 UTC 2015


On Feb 5, 2015, at 3:20 AM, Marcus Larsson <marcus.larsson at oracle.com> wrote:
> 
> Hi Kim,
> 
> Thanks for looking at this.
> 
> On 04/02/15 21:48, Kim Barrett wrote:
>> Sorry for the delay; I lost track of this.
>> 
>> On Dec 10, 2014, at 9:51 AM, Marcus Larsson <marcus.larsson at oracle.com> wrote:
>>> Hi again,
>>> 
>>> Updated the patch with some cleanups to use 'const ParNewTracer*' rather than 'ParNewTracer&' where appropriate.
>>> 
>>> Webrev:
>>> http://cr.openjdk.java.net/~mlarsson/8066566/webrev.02/
>>> 
>>> Incremental:
>>> http://cr.openjdk.java.net/~mlarsson/8066566/webrev.01-02/
>> src/share/vm/gc_implementation/parNew/parNewGeneration.cpp
>>  417   const ParNewTracer* gc_tracer() const {
>>  418     return &_gc_tracer;
>>  419   }
>> 
>> All present calls are in the providing class's implementation, and
>> could just as easily be replaced with "&_gc_tracer". Returning a
>> pointer into the implementation of an object is generally best
>> avoided, and in this case it's unnecessary.  Promoting it to a public
>> API just adds to the burden.
> 
> As I mentioned in the original email, this getter for the field is added although it is currently unnecessary.
> However, it is added in preparation for https://bugs.openjdk.java.net/browse/JDK-8066444 and will soon be required.
> Arguably the addition of this getter belongs to that CR, but I thought I might as well add it here while doing the refactoring.

Sorry, forgot that.  In a different code base I would expect return of const reference.  But as Erik noted, Hotspot is very “pointy”.

Looks good.



More information about the hotspot-gc-dev mailing list