Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8257151

ZGC: Simplify ZVerify

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 16
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
      gc
    • Resolved In Build:
      b27

      Description

      ZVerify has a few oddities:

      1)
      void ZVerify::before_zoperation() {
        // Verify strong roots
        ZStatTimerDisable disable;
        roots(false /* verify_strong */, false /* verify_weaks */);
      }

      The comment and the parameter names don't match. This is caued 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.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              stefank Stefan Karlsson
              Reporter:
              stefank Stefan Karlsson
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: