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

G1: remove unnecesary null check for G1ParScanThreadStateSet::_states slots

    XMLWordPrintable

    Details

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

      Description

      In `G1ParScanThreadStateSet::flush`:

      ```
        for (uint worker_id = 0; worker_id < _n_workers; ++worker_id) {
          G1ParScanThreadState* pss = _states[worker_id];

          if (pss == NULL) {
            continue;
          }
          ...
      ```

      A similar `if` check exists in `G1ParScanThreadStateSet::record_unused_optional_region`.

      However, `_states` array is lazy-initialized by each worker thread, so all array slots contain non-null value.

      Replace the if with a non-null assert.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              ayang Albert Yang
              Reporter:
              ayang Albert Yang
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: