[JS IR IC] Check the unbound symbols in the IC infrastructure

This commit is contained in:
Alexander Korepanov
2023-01-02 16:24:53 +01:00
committed by Space Team
parent a4192c38f2
commit 8492791bf3
2 changed files with 5 additions and 7 deletions
@@ -672,7 +672,7 @@ class CacheUpdater(
val compilerForIC = compilerInterfaceFactory.createCompilerForIC(mainModuleFragment, compilerConfiguration)
// Load declarations referenced during `context` initialization
loadedIr.linker.loadUnboundSymbols(true)
loadedIr.linker.loadUnboundSymbols()
val dirtyFiles = dirtyFileExports.entries.associateTo(HashMap(dirtyFileExports.size)) { it.key to HashSet(it.value.keys) }
@@ -756,7 +756,7 @@ fun rebuildCacheForDirtyFiles(
val compilerWithIC = JsIrCompilerWithIC(currentIrModule, configuration, JsGenerationGranularity.PER_MODULE, exportedDeclarations)
// Load declarations referenced during `context` initialization
jsIrLinker.loadUnboundSymbols(true)
jsIrLinker.loadUnboundSymbols()
val fragments = compilerWithIC.compile(irModules.values, dirtyIrFiles, mainArguments).map { it() }
@@ -30,12 +30,10 @@ import org.jetbrains.kotlin.psi2ir.descriptors.IrBuiltInsOverDescriptors
import org.jetbrains.kotlin.psi2ir.generators.TypeTranslatorImpl
import org.jetbrains.kotlin.storage.LockBasedStorageManager
internal fun JsIrLinker.loadUnboundSymbols(checkNoUnbound: Boolean) {
internal fun JsIrLinker.loadUnboundSymbols() {
ExternalDependenciesGenerator(symbolTable, listOf(this)).generateUnboundSymbolsAsDependencies()
postProcess()
if (checkNoUnbound) {
checkNoUnboundSymbols(symbolTable, "at the end of IR linkage process")
}
checkNoUnboundSymbols(symbolTable, "at the end of IR linkage process")
}
internal class JsIrLinkerLoader(
@@ -130,7 +128,7 @@ internal class JsIrLinkerLoader(
}
}
jsIrLinker.loadUnboundSymbols(false)
jsIrLinker.loadUnboundSymbols()
return LoadedJsIr(jsIrLinker, irModules)
}
}