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

G1: Simplify implementation of G1GCPhaseTimes::record_or_add_time_secs

    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:
      b27

      Description

      This is a minor improvement of G1GCPhaseTimes::record_or_add_time_secs to reuse WorkerDataArray<T>::set_or_add rather than implement the logic in G1GCPhaseTimes itself.


      diff --git a/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp b/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp
      index 7c3eba2be94..cc4a90a36f1 100644
      --- a/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp
      +++ b/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp
      @@ -266,11 +266,7 @@ void G1GCPhaseTimes::add_time_secs(GCParPhases phase, uint worker_id, double sec
       }

       void G1GCPhaseTimes::record_or_add_time_secs(GCParPhases phase, uint worker_id, double secs) {
      - if (_gc_par_phases[phase]->get(worker_id) == _gc_par_phases[phase]->uninitialized()) {
      - record_time_secs(phase, worker_id, secs);
      - } else {
      - add_time_secs(phase, worker_id, secs);
      - }
      + _gc_par_phases[phase]->set_or_add(worker_id, secs);
       }

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              mli Hamlin Li
              Reporter:
              mli Hamlin Li
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: