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

G1: Refine naming of G1GCParPhaseTimesTracker::_must_record

    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

      Backports

        Description

        This is a trivial improvement to refine the naming of G1GCParPhaseTimesTracker::_must_record to _initial_record.


        diff --git a/src/hotspot/share/gc/g1/g1GCParPhaseTimesTracker.hpp b/src/hotspot/share/gc/g1/g1GCParPhaseTimesTracker.hpp
        index 11a62b03825..9843af786b7 100644
        --- a/src/hotspot/share/gc/g1/g1GCParPhaseTimesTracker.hpp
        +++ b/src/hotspot/share/gc/g1/g1GCParPhaseTimesTracker.hpp
        @@ -36,10 +36,10 @@ protected:
           G1GCPhaseTimes* _phase_times;
           uint _worker_id;
           EventGCPhaseParallel _event;
        - bool _must_record;
        + bool _initial_record;

         public:
        - G1GCParPhaseTimesTracker(G1GCPhaseTimes* phase_times, G1GCPhaseTimes::GCParPhases phase, uint worker_id, bool must_record = true);
        + G1GCParPhaseTimesTracker(G1GCPhaseTimes* phase_times, G1GCPhaseTimes::GCParPhases phase, uint worker_id, bool initial_record = true);
           virtual ~G1GCParPhaseTimesTracker();
         };

        diff --git a/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp b/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp
        index 7c3eba2be94..79ad75a784c 100644
        --- a/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp
        +++ b/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp
        @@ -578,8 +578,8 @@ void G1EvacPhaseWithTrimTimeTracker::stop() {
           _stopped = true;
         }

        -G1GCParPhaseTimesTracker::G1GCParPhaseTimesTracker(G1GCPhaseTimes* phase_times, G1GCPhaseTimes::GCParPhases phase, uint worker_id, bool must_record) :
        - _start_time(), _phase(phase), _phase_times(phase_times), _worker_id(worker_id), _event(), _must_record(must_record) {
        +G1GCParPhaseTimesTracker::G1GCParPhaseTimesTracker(G1GCPhaseTimes* phase_times, G1GCPhaseTimes::GCParPhases phase, uint worker_id, bool initial_record) :
        + _start_time(), _phase(phase), _phase_times(phase_times), _worker_id(worker_id), _event(), _initial_record(initial_record) {
           if (_phase_times != NULL) {
             _start_time = Ticks::now();
           }
        @@ -587,7 +587,7 @@ G1GCParPhaseTimesTracker::G1GCParPhaseTimesTracker(G1GCPhaseTimes* phase_times,

         G1GCParPhaseTimesTracker::~G1GCParPhaseTimesTracker() {
           if (_phase_times != NULL) {
        - if (_must_record) {
        + if (_initial_record) {
               _phase_times->record_time_secs(_phase, _worker_id, (Ticks::now() - _start_time).seconds());
             } else {
               _phase_times->record_or_add_time_secs(_phase, _worker_id, (Ticks::now() - _start_time).seconds());

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  Created:
                  Updated:
                  Resolved: