RFR: JDK-8057632 - Remove auxiliary code used to handle the generations array

Jesper Wilhelmsson jesper.wilhelmsson at oracle.com
Tue Mar 3 22:47:48 UTC 2015


Kim Barrett skrev den 3/3/15 09:30:
> On Mar 2, 2015, at 1:22 PM, Jesper Wilhelmsson <jesper.wilhelmsson at oracle.com> wrote:
>>
>> Hi,
>>
>> The generation array removal enabled several other cleanups. I have several changes in queue to perform these cleanups one at a time.
>>
>> In this change the methods next_gen(), prev_gen() and get_gen() are removed and calls are replaced with explicit calls to young_gen() and old_gen().
>>
>> Please have a look.
>>
>> Bug: https://bugs.openjdk.java.net/browse/JDK-8057632
>> Webrev: http://cr.openjdk.java.net/~jwilhelm/8057632/webrev.02/
>>
>> Thanks!
>> /Jesper
>
> Looks good.
>
> A couple of questions:
>
> ------------------------------------------------------------------------------
> src/share/vm/memory/defNewGeneration.cpp
>
> Maybe this will be part of the planned future cleanups, but I'll
> mention it now, just in case.
>
> There are various places where _old_gen is assigned or tested for
> NULL.  This all seems rather odd; shouldn't there just be an
> associated old generation that is recorded in _old_gen at construction
> time or thereabouts, and be done with it?

Yes, there is room for more improvements here :)
I have added this to my list of future cleanups which is now up to nine separate 
cleanup changes after the generation array removal.

>
> ------------------------------------------------------------------------------
> src/share/vm/runtime/vmStructs.cpp
> Removed:
>   533   nonstatic_field(DefNewGeneration,            _next_gen,                                     Generation*)                           \
>
> Was it intentional to remove rather than rename to _old_gen here?
>

It was intentional. The field is not used in the SA code so it really doesn't 
matter if it is present in VM_STRUCTS or not. After consulting the SA expertise 
I was advised to rename the field instead to keep the VM_STRUCTS in sync with 
the code as much as possible.

A new webrev is available. The _old_gen field in vmStructs.cpp is the only 
change from the last webrev:

http://cr.openjdk.java.net/~jwilhelm/8057632/webrev.03/

For some reason though the webrev script thought that the files 
parNewGeneration.cpp/hpp are new in this webrev, so they don't have any old 
version here. I see nothing wrong in the hg diff or status of the repository...
Anyway, there are no new changes in those files.

Thanks,
/Jesper



More information about the hotspot-gc-dev mailing list