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

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

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 18
    • 18
    • hotspot
    • gc
    • b12

      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.

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

              Created:
              Updated:
              Resolved: