RFR: 8257151: ZGC: Simplify ZVerify

Stefan Karlsson stefank at openjdk.java.net
Thu Nov 26 11:21:08 UTC 2020


ZVerify has a few oddities:

1) The comment and the parameter name don't match. 
void ZVerify::before_zoperation() {
  // Verify strong roots
  ZStatTimerDisable disable;
  roots(false /* verify_strong */, false /* verify_weaks */);
}
This is caused by a name clash between the layers:

roots_strong(bool verify_fixed
roots(bool verify_strong
roots_and_objects(bool verify_strong

2) Both usages of roots_and_objects pass true as the verify_strong argument:

void ZVerify::after_mark() {
  // Verify all strong roots and strong references
  ZStatTimerDisable disable;
  roots_and_objects(true /* verify_strong */, false /* verify_weaks */);
}

void ZVerify::after_weak_processing() {
  // Verify all roots and all references
  ZStatTimerDisable disable;
  roots_and_objects(true /* verify_strong */, true /* verify_weaks */);
}

The proposal is to remove the middle layers and be more explicit at the call sites.

-------------

Commit messages:
 - 8257151: ZGC: Simplify ZVerify

Changes: https://git.openjdk.java.net/jdk/pull/1449/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=1449&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8257151
  Stats: 47 lines in 2 files changed: 16 ins; 18 del; 13 mod
  Patch: https://git.openjdk.java.net/jdk/pull/1449.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/1449/head:pull/1449

PR: https://git.openjdk.java.net/jdk/pull/1449


More information about the hotspot-gc-dev mailing list