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

Remove duplicate RefProcPhaseTimeTracker

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 19
    • Component/s: hotspot
    • Subcomponent:
      gc
    • Resolved In Build:
      b04

      Description

      `RefProcPhaseTimeTracker` and `RefProcTotalPhaseTimesTracker` are identical. Both are stack-allocated to keep track the elapsed time and are used exclusively inside `ReferenceProcessor::process_discovered_references` with the same args.

      The structure is effectively:

      ```
      {
        RefProcTotalPhaseTimesTracker tt(SoftWeakFinalRefsPhase, &phase_times);
        {
          ...
          RefProcPhaseTimeTracker tt(SoftWeakFinalRefsPhase, &phase_times);
          ...
        }
      }
      ```

      As shown, the effect of `RefProcPhaseTimeTracker` is shadowed by `RefProcTotalPhaseTimesTracker` in the outer scope. Therefore, `class RefProcPhaseTimeTracker` can be removed with no externally visible effect.

        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: