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

Remove duplicate RefProcPhaseTimeTracker

XMLWordPrintable

    • gc
    • b04

      `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.

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

              Created:
              Updated:
              Resolved: