RFR: 8217855: ZGC: Clean up ZReferenceProcessor

Per Liden per.liden at oracle.com
Tue Jan 29 07:51:26 UTC 2019


Thanks for reviewing Kim.

/Per

On 01/29/2019 03:03 AM, Kim Barrett wrote:
>> On Jan 28, 2019, at 3:59 AM, Per Liden <per.liden at oracle.com> wrote:
>>
>> Various structural and naming cleanups in ZReferenceProcessor.
>>
>> Bug: https://bugs.openjdk.java.net/browse/JDK-8217855
>> Webrev: http://cr.openjdk.java.net/~pliden/8217855/webrev.0
>>
>> /Per
> 
> Looks good.
> 
> A couple minor comments. I don't need a new webrev if you decide to
> make these changes.
> 
> ------------------------------------------------------------------------------
> src/hotspot/share/gc/z/zReferenceProcessor.cpp
>    74 static void reference_set_referent(oop reference, oop referent) {
> 
> This function is only ever called with a NULL referent.  And it would
> probably be a bad idea to change the referent in any other way.  So I
> think it would be better to have reference_clear_referent or something
> like that.
> 
> ------------------------------------------------------------------------------
> src/hotspot/share/gc/z/zReferenceProcessor.cpp
>   264   if (!should_discover(reference, type)) {
>   265     // Not discovered
>   266     return false;
>   267   }
>   268
>   269   discover(reference, type);
>   270
>   271   // Discovered
>   272   return true;
> 
> Perhaps clearer would be
> 
>    if (should_discover(reference, type)) {
>      discover(reference, type);
>      return true;
>    } else {
>      return false;
>    }
> 
> ------------------------------------------------------------------------------
> 


More information about the hotspot-gc-dev mailing list