[JS IR] Cleanup pir IC code
This commit is contained in:
@@ -31,15 +31,15 @@ abstract class AbstractJsKLibABITestCase : AbstractKlibABITestCase() {
|
||||
configuration.put(JSConfigurationKeys.MODULE_KIND, ModuleKind.PLAIN)
|
||||
configuration.put(CommonConfigurationKeys.MODULE_NAME, MAIN_MODULE_NAME)
|
||||
val kLib = MainModule.Klib(mainModulePath)
|
||||
val moduleStructure = ModulesStructure(project, kLib, configuration, libraries, emptyList(), false, false, emptyMap())
|
||||
val moduleStructure = ModulesStructure(project, kLib, configuration, libraries, emptyList())
|
||||
|
||||
val ir = compile(
|
||||
moduleStructure,
|
||||
PhaseConfig(jsPhases),
|
||||
IrFactoryImplForJsIC(WholeWorldStageController()),
|
||||
exportedDeclarations = setOf(FqName("box")),
|
||||
propertyLazyInitialization = true,
|
||||
granularity = JsGenerationGranularity.PER_MODULE,
|
||||
exportedDeclarations = setOf(FqName("box")),
|
||||
icCompatibleIr2Js = true
|
||||
)
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ class JsIrBackendFacade(
|
||||
configuration: CompilerConfiguration,
|
||||
inputArtifact: BinaryArtifacts.KLib,
|
||||
): BinaryArtifacts.Js? {
|
||||
val (irModuleFragment, dependencyModules, _, symbolTable, deserializer, _) = moduleInfo
|
||||
val (irModuleFragment, dependencyModules, _, symbolTable, deserializer) = moduleInfo
|
||||
|
||||
val splitPerModule = JsEnvironmentConfigurationDirectives.SPLIT_PER_MODULE in module.directives
|
||||
val splitPerFile = JsEnvironmentConfigurationDirectives.SPLIT_PER_FILE in module.directives
|
||||
@@ -86,7 +86,6 @@ class JsIrBackendFacade(
|
||||
}
|
||||
|
||||
val testPackage = extractTestPackage(testServices)
|
||||
val lowerPerModule = JsEnvironmentConfigurationDirectives.LOWER_PER_MODULE in module.directives
|
||||
val skipRegularMode = JsEnvironmentConfigurationDirectives.SKIP_REGULAR_MODE in module.directives
|
||||
|
||||
if (skipRegularMode) return null
|
||||
@@ -132,12 +131,10 @@ class JsIrBackendFacade(
|
||||
deserializer,
|
||||
phaseConfig,
|
||||
exportedDeclarations = setOf(FqName.fromSegments(listOfNotNull(testPackage, TEST_FUNCTION))),
|
||||
dceDriven = false,
|
||||
dceRuntimeDiagnostic = null,
|
||||
es6mode = false,
|
||||
propertyLazyInitialization = JsEnvironmentConfigurationDirectives.PROPERTY_LAZY_INITIALIZATION in module.directives,
|
||||
baseClassIntoMetadata = false,
|
||||
lowerPerModule = lowerPerModule,
|
||||
safeExternalBoolean = JsEnvironmentConfigurationDirectives.SAFE_EXTERNAL_BOOLEAN in module.directives,
|
||||
safeExternalBooleanDiagnostic = module.directives[JsEnvironmentConfigurationDirectives.SAFE_EXTERNAL_BOOLEAN_DIAGNOSTIC].singleOrNull(),
|
||||
granularity = granularity,
|
||||
@@ -221,10 +218,7 @@ class JsIrBackendFacade(
|
||||
symbolTable,
|
||||
messageLogger,
|
||||
loadFunctionInterfacesIntoStdlib = true,
|
||||
emptyMap(),
|
||||
{ emptySet() },
|
||||
{ if (it == mainModuleLib) moduleDescriptor else testServices.jsLibraryProvider.getDescriptorByCompiledLibrary(it) },
|
||||
)
|
||||
) { if (it == mainModuleLib) moduleDescriptor else testServices.jsLibraryProvider.getDescriptorByCompiledLibrary(it) }
|
||||
}
|
||||
|
||||
private fun loadIrFromSources(
|
||||
@@ -254,14 +248,11 @@ class JsIrBackendFacade(
|
||||
inputArtifact.allKtFiles.values.toList(),
|
||||
sortDependencies(JsEnvironmentConfigurator.getAllRecursiveLibrariesFor(module, testServices)),
|
||||
emptyMap(),
|
||||
emptyMap(),
|
||||
symbolTable,
|
||||
messageLogger,
|
||||
loadFunctionInterfacesIntoStdlib = true,
|
||||
verifySignatures,
|
||||
{ emptySet() },
|
||||
{ testServices.jsLibraryProvider.getDescriptorByCompiledLibrary(it) },
|
||||
)
|
||||
) { testServices.jsLibraryProvider.getDescriptorByCompiledLibrary(it) }
|
||||
}
|
||||
|
||||
private fun jsOutputSink(perFileOutputDir: File): CompilerOutputSink {
|
||||
|
||||
@@ -53,7 +53,6 @@ abstract class AbstractJsIrTest(
|
||||
defaultDirectives {
|
||||
val runIc = getBoolean("kotlin.js.ir.icMode")
|
||||
if (runIc) +JsEnvironmentConfigurationDirectives.RUN_IC
|
||||
if (runIc || getBoolean("kotlin.js.ir.lowerPerModule")) +JsEnvironmentConfigurationDirectives.LOWER_PER_MODULE
|
||||
if (getBoolean("kotlin.js.ir.klibMainModule")) +JsEnvironmentConfigurationDirectives.KLIB_MAIN_MODULE
|
||||
if (getBoolean("kotlin.js.ir.perModule", true)) +JsEnvironmentConfigurationDirectives.PER_MODULE
|
||||
if (getBoolean("kotlin.js.ir.dce", true)) +JsEnvironmentConfigurationDirectives.RUN_IR_DCE
|
||||
|
||||
@@ -37,10 +37,6 @@ class TestModuleCache(val files: MutableMap<String, FileCache>) {
|
||||
return 0L
|
||||
}
|
||||
|
||||
override fun serializedParts(path: String): SerializedIcDataForFile {
|
||||
error("Is not supported")
|
||||
}
|
||||
|
||||
override fun inlineGraphForFile(path: String, sigResolver: (Int) -> IdSignature): Collection<Pair<IdSignature, TransHash>> {
|
||||
error("Is not supported")
|
||||
}
|
||||
@@ -97,10 +93,6 @@ class TestModuleCache(val files: MutableMap<String, FileCache>) {
|
||||
|
||||
}
|
||||
|
||||
override fun commitICCacheData(path: String, icData: SerializedIcDataForFile) {
|
||||
|
||||
}
|
||||
|
||||
override fun commitBinaryAst(path: String, astData: ByteArray) {
|
||||
val storage = files.getOrPut(path) { FileCache(path, null, null, null) }
|
||||
storage.ast = astData
|
||||
|
||||
@@ -77,10 +77,7 @@ class ApiTest : KotlinTestWithEnvironment() {
|
||||
MainModule.Klib(File(fullRuntimeKlib).canonicalPath),
|
||||
configuration,
|
||||
listOf(fullRuntimeKlib),
|
||||
emptyList(),
|
||||
false,
|
||||
false,
|
||||
emptyMap()
|
||||
emptyList()
|
||||
)
|
||||
|
||||
return loadIr(
|
||||
|
||||
Reference in New Issue
Block a user