[JS IR IC] Check the unbound symbols in the IC infrastructure
This commit is contained in:
committed by
Space Team
parent
a4192c38f2
commit
8492791bf3
@@ -672,7 +672,7 @@ class CacheUpdater(
|
|||||||
val compilerForIC = compilerInterfaceFactory.createCompilerForIC(mainModuleFragment, compilerConfiguration)
|
val compilerForIC = compilerInterfaceFactory.createCompilerForIC(mainModuleFragment, compilerConfiguration)
|
||||||
|
|
||||||
// Load declarations referenced during `context` initialization
|
// 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) }
|
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)
|
val compilerWithIC = JsIrCompilerWithIC(currentIrModule, configuration, JsGenerationGranularity.PER_MODULE, exportedDeclarations)
|
||||||
|
|
||||||
// Load declarations referenced during `context` initialization
|
// Load declarations referenced during `context` initialization
|
||||||
jsIrLinker.loadUnboundSymbols(true)
|
jsIrLinker.loadUnboundSymbols()
|
||||||
|
|
||||||
val fragments = compilerWithIC.compile(irModules.values, dirtyIrFiles, mainArguments).map { it() }
|
val fragments = compilerWithIC.compile(irModules.values, dirtyIrFiles, mainArguments).map { it() }
|
||||||
|
|
||||||
|
|||||||
+3
-5
@@ -30,12 +30,10 @@ import org.jetbrains.kotlin.psi2ir.descriptors.IrBuiltInsOverDescriptors
|
|||||||
import org.jetbrains.kotlin.psi2ir.generators.TypeTranslatorImpl
|
import org.jetbrains.kotlin.psi2ir.generators.TypeTranslatorImpl
|
||||||
import org.jetbrains.kotlin.storage.LockBasedStorageManager
|
import org.jetbrains.kotlin.storage.LockBasedStorageManager
|
||||||
|
|
||||||
internal fun JsIrLinker.loadUnboundSymbols(checkNoUnbound: Boolean) {
|
internal fun JsIrLinker.loadUnboundSymbols() {
|
||||||
ExternalDependenciesGenerator(symbolTable, listOf(this)).generateUnboundSymbolsAsDependencies()
|
ExternalDependenciesGenerator(symbolTable, listOf(this)).generateUnboundSymbolsAsDependencies()
|
||||||
postProcess()
|
postProcess()
|
||||||
if (checkNoUnbound) {
|
checkNoUnboundSymbols(symbolTable, "at the end of IR linkage process")
|
||||||
checkNoUnboundSymbols(symbolTable, "at the end of IR linkage process")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
internal class JsIrLinkerLoader(
|
internal class JsIrLinkerLoader(
|
||||||
@@ -130,7 +128,7 @@ internal class JsIrLinkerLoader(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
jsIrLinker.loadUnboundSymbols(false)
|
jsIrLinker.loadUnboundSymbols()
|
||||||
return LoadedJsIr(jsIrLinker, irModules)
|
return LoadedJsIr(jsIrLinker, irModules)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user