File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -151,8 +151,10 @@ class Compiler {
151151 List (new GenBCode ) :: // Generate JVM bytecode
152152 Nil
153153
154- // Initially 0, so that the first nextRunId call would return InitialRunId == 1
155- private var runId : Int = 0
154+ // TODO: Initially 0, so that the first nextRunId call would return InitialRunId == 1
155+ // Changing the initial runId from 1 to 0 makes the scala2-library-bootstrap fail to compile,
156+ // when the underlying issue is fixed, please update dotc.profiler.RealProfiler.chromeTrace logic
157+ private var runId : Int = 1
156158 def nextRunId : Int = {
157159 runId += 1 ; runId
158160 }
Original file line number Diff line number Diff line change @@ -185,10 +185,12 @@ private [profile] class RealProfiler(reporter : ProfileReporter)(using Context)
185185 // Compilation units requiring multi-stage compilation (macros) would create a new profiler instances
186186 // We need to store the traces in the seperate file to prevent overriding its content.
187187 // Alternatives: sharing ChromeTrace instance between all runs / manual concatation after all runs are done
188- val suffix = if ctx.runId > InitialRunId then s " . ${ctx.runId}" else " "
188+ // FIXME: The first assigned runId is equal to 2 instead of 1 (InitialRunId).
189+ // Fix me when bug described in Compiler.runId is resolved by removing +/- 1 adjustments
190+ val suffix = if ctx.runId > InitialRunId + 1 then s " . ${ctx.runId - 1 }" else " "
189191 ChromeTrace (Paths .get(s " $filename$suffix" ))
190192
191- private val compilerRunEvent : TracedEventId = traceDurationStart(Category .Run , s " stage- ${ctx.runId} " )
193+ private val compilerRunEvent : TracedEventId = traceDurationStart(Category .Run , s " scalac- $id " )
192194
193195 def completeBackground (threadRange : ProfileRange ): Unit =
194196 reporter.reportBackground(this , threadRange)
You can’t perform that action at this time.
0 commit comments