@@ -14,6 +14,7 @@ import org.jetbrains.kotlin.backend.wasm.ir2wasm.WasmModuleFragmentGenerator
14
14
import org.jetbrains.kotlin.backend.wasm.ir2wasm.toJsStringLiteral
15
15
import org.jetbrains.kotlin.backend.wasm.lower.markExportedDeclarations
16
16
import org.jetbrains.kotlin.config.CompilerConfiguration
17
+ import org.jetbrains.kotlin.cli.common.CLIConfigurationKeys
17
18
import org.jetbrains.kotlin.ir.backend.js.MainModule
18
19
import org.jetbrains.kotlin.ir.backend.js.ModulesStructure
19
20
import org.jetbrains.kotlin.ir.backend.js.SourceMapsInfo
@@ -51,6 +52,9 @@ fun compileToLoweredIr(
51
52
): Pair <List <IrModuleFragment >, WasmBackendContext> {
52
53
val mainModule = depsDescriptors.mainModule
53
54
val configuration = depsDescriptors.compilerConfiguration
55
+ val performanceManager = depsDescriptors.compilerConfiguration[CLIConfigurationKeys .PERF_MANAGER ]
56
+ performanceManager?.notifyIRTranslationStarted()
57
+
54
58
val (moduleFragment, dependencyModules, irBuiltIns, symbolTable, irLinker) = loadIr(
55
59
depsDescriptors,
56
60
irFactory,
@@ -83,7 +87,11 @@ fun compileToLoweredIr(
83
87
for (file in module.files)
84
88
markExportedDeclarations(context, file, exportedDeclarations)
85
89
90
+ performanceManager?.notifyIRTranslationFinished()
91
+ performanceManager?.notifyGenerationStarted()
92
+ performanceManager?.notifyIRLoweringStarted()
86
93
wasmPhases.invokeToplevel(phaseConfig, context, allModules)
94
+ performanceManager?.notifyIRLoweringFinished()
87
95
88
96
return Pair (allModules, context)
89
97
}
@@ -179,7 +187,7 @@ private fun generateSourceMap(
179
187
prev = location
180
188
181
189
location.apply {
182
- // TODO resulting path goes too deep since temporary directory we compiled first is deeper than final destination.
190
+ // TODO resulting path goes too deep since temporary directory we compiled first is deeper than final destination.
183
191
val relativePath = pathResolver.getPathRelativeToSourceRoots(File (file)).substring(3 )
184
192
sourceMapBuilder.addMapping(relativePath, null , { null }, line, column, null , mapping.offset)
185
193
}
0 commit comments