@@ -16,6 +16,7 @@ import org.jetbrains.kotlin.backend.wasm.ir2wasm.toJsStringLiteral
16
16
import org.jetbrains.kotlin.backend.wasm.lower.JsInteropFunctionsLowering
17
17
import org.jetbrains.kotlin.backend.wasm.lower.markExportedDeclarations
18
18
import org.jetbrains.kotlin.backend.wasm.utils.SourceMapGenerator
19
+ import org.jetbrains.kotlin.cli.common.CLIConfigurationKeys
19
20
import org.jetbrains.kotlin.ir.backend.js.MainModule
20
21
import org.jetbrains.kotlin.ir.backend.js.ModulesStructure
21
22
import org.jetbrains.kotlin.ir.backend.js.export.ExportModelToTsDeclarations
@@ -65,6 +66,9 @@ fun compileToLoweredIr(
65
66
): LoweredIrWithExtraArtifacts {
66
67
val mainModule = depsDescriptors.mainModule
67
68
val configuration = depsDescriptors.compilerConfiguration
69
+ val performanceManager = depsDescriptors.compilerConfiguration[CLIConfigurationKeys .PERF_MANAGER ]
70
+ performanceManager?.notifyIRTranslationStarted()
71
+
68
72
val (moduleFragment, dependencyModules, irBuiltIns, symbolTable, irLinker) = loadIr(
69
73
depsDescriptors,
70
74
irFactory,
@@ -103,13 +107,17 @@ fun compileToLoweredIr(
103
107
val fragment = exportModelToDtsTranslator.generateTypeScriptFragment(ModuleKind .ES , exportModel.declarations)
104
108
TypeScriptFragment (exportModelToDtsTranslator.generateTypeScript(" " , ModuleKind .ES , listOf (fragment)))
105
109
}
110
+ performanceManager?.notifyIRTranslationFinished()
106
111
112
+ performanceManager?.notifyGenerationStarted()
113
+ performanceManager?.notifyIRLoweringStarted()
107
114
val phaserState = PhaserState <IrModuleFragment >()
108
115
loweringList.forEachIndexed { _, lowering ->
109
116
allModules.forEach { module ->
110
117
lowering.invoke(phaseConfig, phaserState, context, module)
111
118
}
112
119
}
120
+ performanceManager?.notifyIRLoweringFinished()
113
121
114
122
return LoweredIrWithExtraArtifacts (allModules, context, typeScriptFragment)
115
123
}
0 commit comments