RFR: 8217855: ZGC: Clean up ZReferenceProcessor

Kim Barrett kim.barrett at oracle.com
Tue Jan 29 02:03:49 UTC 2019


> 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