@@ -8,6 +8,7 @@ package org.jetbrains.kotlin.ir.backend.js
8
8
import org.jetbrains.kotlin.backend.common.linkage.issues.checkNoUnboundSymbols
9
9
import org.jetbrains.kotlin.backend.common.phaser.PhaseConfig
10
10
import org.jetbrains.kotlin.backend.common.phaser.PhaserState
11
+ import org.jetbrains.kotlin.cli.common.CLIConfigurationKeys
11
12
import org.jetbrains.kotlin.config.CompilerConfiguration
12
13
import org.jetbrains.kotlin.ir.IrBuiltIns
13
14
import org.jetbrains.kotlin.ir.backend.js.lower.*
@@ -48,6 +49,8 @@ fun compile(
48
49
filesToLower : Set <String >? = null,
49
50
granularity : JsGenerationGranularity = JsGenerationGranularity .WHOLE_PROGRAM ,
50
51
): LoweredIr {
52
+ val performanceManager = depsDescriptors.compilerConfiguration[CLIConfigurationKeys .PERF_MANAGER ]
53
+ performanceManager?.notifyIRTranslationStarted()
51
54
52
55
val (moduleFragment: IrModuleFragment , dependencyModules, irBuiltIns, symbolTable, deserializer, moduleToName) =
53
56
loadIr(depsDescriptors, irFactory, verifySignatures, filesToLower, loadFunctionInterfacesIntoStdlib = true )
@@ -93,6 +96,7 @@ fun compileIr(
93
96
val moduleDescriptor = moduleFragment.descriptor
94
97
val irFactory = symbolTable.irFactory
95
98
val shouldGeneratePolyfills = configuration.getBoolean(JSConfigurationKeys .GENERATE_POLYFILLS )
99
+ val performanceManager = configuration[CLIConfigurationKeys .PERF_MANAGER ]
96
100
97
101
val allModules = when (mainModule) {
98
102
is MainModule .SourceFiles -> dependencyModules + listOf (moduleFragment)
@@ -132,7 +136,10 @@ fun compileIr(
132
136
133
137
// TODO should be done incrementally
134
138
generateJsTests(context, allModules.last(), groupByPackage = false )
139
+ performanceManager?.notifyIRTranslationFinished()
135
140
141
+ performanceManager?.notifyGenerationStarted()
142
+ performanceManager?.notifyIRLoweringStarted()
136
143
(irFactory.stageController as ? WholeWorldStageController )?.let {
137
144
lowerPreservingTags(allModules, context, phaseConfig, it)
138
145
} ? : run {
@@ -143,6 +150,7 @@ fun compileIr(
143
150
}
144
151
}
145
152
}
153
+ performanceManager?.notifyIRLoweringFinished()
146
154
147
155
return LoweredIr (context, moduleFragment, allModules, moduleToName)
148
156
}
0 commit comments