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

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

    XMLWordPrintable

Details

    • Enhancement
    • Status: Resolved
    • P4
    • Resolution: Fixed
    • 18
    • 18
    • hotspot
    • gc
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: