From b99377fd694e4406a73afeaf327f10e00d537c82 Mon Sep 17 00:00:00 2001 From: Roman Artemev Date: Tue, 19 Feb 2019 18:11:00 +0300 Subject: [PATCH] [JS IR BE] Fix backend to be able compile test against klib --- .../ir/backend/js/JsIrBackendContext.kt | 153 ++++++++++-------- .../kotlin/ir/backend/js/JsLoweringPhases.kt | 6 +- .../kotlin/ir/backend/js/compiler.kt | 20 ++- .../js/lower/ClassReferenceLowering.kt | 28 +++- .../js/lower/ThrowableSuccessorsLowering.kt | 13 +- .../ir/IrKlibProtoBufModuleDeserializer.kt | 4 +- .../serialization/ir/IrModuleSerializer.kt | 38 +---- .../kotlin/ir/backend/js/utils/Namer.kt | 2 - .../ir/util/ExternalDependenciesGenerator.kt | 2 +- 9 files changed, 135 insertions(+), 131 deletions(-) diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/JsIrBackendContext.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/JsIrBackendContext.kt index ddf434d8bfc..36c475f1faf 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/JsIrBackendContext.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/JsIrBackendContext.kt @@ -126,39 +126,13 @@ class JsIrBackendContext( val callableReferencesCache = mutableMapOf() val secondaryConstructorToFactoryCache = mutableMapOf() - val coroutineGetContext: IrFunctionSymbol - get() { - val continuation = symbolTable.referenceClass( - coroutinePackage.memberScope.getContributedClassifier( - CONTINUATION_NAME, - NoLookupLocation.FROM_BACKEND - ) as ClassDescriptor - ) - val contextGetter = - continuation.owner.declarations.filterIsInstance().atMostOne { it.name == CONTINUATION_CONTEXT_GETTER_NAME } - ?: continuation.owner.declarations.filterIsInstance().atMostOne { it.name == CONTINUATION_CONTEXT_PROPERTY_NAME }?.getter!! - return contextGetter.symbol - } - - val coroutineGetContextJs = symbolTable.referenceSimpleFunction(getInternalFunctions(GET_COROUTINE_CONTEXT_NAME).single()) - - val coroutineContextProperty: PropertyDescriptor - get() { - val vars = coroutinePackage.memberScope.getContributedVariables( - COROUTINE_CONTEXT_NAME, - NoLookupLocation.FROM_BACKEND - ) - return vars.single() - } - - val coroutineSuspendOrReturn = - symbolTable.referenceSimpleFunction(getInternalFunctions(COROUTINE_SUSPEND_OR_RETURN_JS_NAME).single()) - - val intrinsics by lazy { JsIntrinsics(irBuiltIns, this) } + val intrinsics = JsIntrinsics(irBuiltIns, this) private val operatorMap = referenceOperators() + // TODO: get rid of this val functions = (0..22).map { symbolTable.referenceClass(builtIns.getFunction(it)) } + val suspendFunctions = (0..22).map { symbolTable.referenceClass(builtIns.getSuspendFunction(it)) } private fun primitivesWithImplicitCompanionObject(): List { val numbers = PrimitiveType.NUMBER_TYPES @@ -168,17 +142,6 @@ class JsIrBackendContext( return numbers + listOf(Name.identifier("String")) } - val primitiveCompanionObjects by lazy { - primitivesWithImplicitCompanionObject() - .associate { - it to symbolTable.lazyWrapper.referenceClass( - getClass(JS_INTERNAL_PACKAGE_FQNAME.child(Name.identifier("${it.identifier}CompanionObject"))) - ) - } - } - - val suspendFunctions = (0..22).map { symbolTable.referenceClass(builtIns.getSuspendFunction(it)) } - val dynamicType = IrDynamicTypeImpl(createDynamicType(builtIns), emptyList(), Variance.INVARIANT) val originalModuleIndex = ModuleIndex(irModuleFragment) @@ -203,54 +166,109 @@ class JsIrBackendContext( override val areEqual get () = TODO("not implemented") - override val ThrowNullPointerException = getFunctions(kotlinPackageFqn.child(Name.identifier("THROW_NPE"))).singleOrNull()?.let { - symbolTable.referenceSimpleFunction(it) } ?: irBuiltIns.throwNpeSymbol + override val ThrowNullPointerException = + symbolTable.referenceSimpleFunction(getFunctions(kotlinPackageFqn.child(Name.identifier("THROW_NPE"))).single()) - override val ThrowNoWhenBranchMatchedException - get () = irBuiltIns.noWhenBranchMatchedExceptionSymbol + override val ThrowNoWhenBranchMatchedException = + symbolTable.referenceSimpleFunction(getFunctions(kotlinPackageFqn.child(Name.identifier("noWhenBranchMatchedException"))).single()) - override val ThrowTypeCastException = getFunctions(kotlinPackageFqn.child(Name.identifier("THROW_CCE"))).singleOrNull()?.let { - symbolTable.referenceSimpleFunction(it) } ?: irBuiltIns.throwCceSymbol + override val ThrowTypeCastException = + symbolTable.referenceSimpleFunction(getFunctions(kotlinPackageFqn.child(Name.identifier("THROW_CCE"))).single()) - override val ThrowUninitializedPropertyAccessException= + override val ThrowUninitializedPropertyAccessException = symbolTable.referenceSimpleFunction(getFunctions(FqName("kotlin.throwUninitializedPropertyAccessException")).single()) override val stringBuilder get() = TODO("not implemented") override val copyRangeTo: Map get() = TODO("not implemented") - override val coroutineImpl = symbolTable.referenceClass(findClass(coroutinePackage.memberScope, COROUTINE_IMPL_NAME.identifier)) - override val coroutineSuspendedGetter = symbolTable.referenceSimpleFunction( - coroutineIntrinsicsPackage.memberScope.getContributedVariables( - COROUTINE_SUSPENDED_NAME, - NoLookupLocation.FROM_BACKEND - ).filterNot { it.isExpect }.single().getter!! - ) + override val coroutineImpl = + symbolTable.referenceClass(findClass(coroutinePackage.memberScope, COROUTINE_IMPL_NAME.identifier)) + override val coroutineSuspendedGetter = + symbolTable.referenceSimpleFunction( + coroutineIntrinsicsPackage.memberScope.getContributedVariables( + COROUTINE_SUSPENDED_NAME, + NoLookupLocation.FROM_BACKEND + ).filterNot { it.isExpect }.single().getter!! + ) - override val lateinitIsInitializedPropertyGetter = symbolTable.referenceSimpleFunction( - module.getPackage(kotlinPackageFqn).memberScope.getContributedVariables( - Name.identifier("isInitialized"), NoLookupLocation.FROM_BACKEND - ).single { - it.extensionReceiverParameter != null && !it.isExternal - }.getter!! - ) + override val lateinitIsInitializedPropertyGetter = + symbolTable.referenceSimpleFunction( + module.getPackage(kotlinPackageFqn).memberScope.getContributedVariables( + Name.identifier("isInitialized"), NoLookupLocation.FROM_BACKEND + ).single { + it.extensionReceiverParameter != null && !it.isExternal + }.getter!! + ) } override fun shouldGenerateHandlerParameterForDefaultBodyFun() = true } - val throwISEymbol by lazy { getFunctions(kotlinPackageFqn.child(Name.identifier("THROW_CCE"))).singleOrNull()?.let { - symbolTable.referenceSimpleFunction(it) } ?: irBuiltIns.throwIseSymbol } + // classes forced to be loaded + + val primitiveClassesObject = symbolTable.referenceClass( + getClass(FqName.fromSegments(listOf("kotlin", "reflect", "js", "internal", "PrimitiveClasses"))) + ) + + val throwableClass = symbolTable.referenceClass(getClass(JsIrBackendContext.KOTLIN_PACKAGE_FQN.child(Name.identifier("Throwable")))) + + val primitiveCompanionObjects = primitivesWithImplicitCompanionObject().associate { + it to symbolTable.referenceClass( + getClass(JS_INTERNAL_PACKAGE_FQNAME.child(Name.identifier("${it.identifier}CompanionObject"))) + ) + } + + val coroutineImpl = ir.symbols.coroutineImpl + val continuationClass = symbolTable.referenceClass( + coroutinePackage.memberScope.getContributedClassifier( + CONTINUATION_NAME, + NoLookupLocation.FROM_BACKEND + ) as ClassDescriptor + ) + + + // Top-level functions forced to be loaded + + val coroutineSuspendOrReturn = symbolTable.referenceSimpleFunction(getInternalFunctions(COROUTINE_SUSPEND_OR_RETURN_JS_NAME).single()) + val coroutineSuspendGetter = ir.symbols.coroutineSuspendedGetter + val coroutineGetContext: IrFunctionSymbol + get() { + val contextGetter = + continuationClass.owner.declarations.filterIsInstance().atMostOne { it.name == CONTINUATION_CONTEXT_GETTER_NAME } + ?: continuationClass.owner.declarations.filterIsInstance().atMostOne { it.name == CONTINUATION_CONTEXT_PROPERTY_NAME }?.getter!! + return contextGetter.symbol + } + + val coroutineGetContextJs = symbolTable.referenceSimpleFunction(getInternalFunctions(GET_COROUTINE_CONTEXT_NAME).single()) + + val coroutineContextProperty: PropertyDescriptor + get() { + val vars = coroutinePackage.memberScope.getContributedVariables( + COROUTINE_CONTEXT_NAME, + NoLookupLocation.FROM_BACKEND + ) + return vars.single() + } + + val lateinitIsInitializedPropertyGetter = ir.symbols.lateinitIsInitializedPropertyGetter + + val captureStackSymbol = symbolTable.referenceSimpleFunction(getInternalFunctions("captureStack").single()) + val newThrowableSymbol = symbolTable.referenceSimpleFunction(getInternalFunctions("newThrowable").single()) + + val throwISEymbol = symbolTable.referenceSimpleFunction(getFunctions(kotlinPackageFqn.child(Name.identifier("THROW_ISE"))).single()) + val throwNPESymbol = ir.symbols.ThrowNullPointerException + val throwCCESymbol = ir.symbols.ThrowTypeCastException + val throwNWBESymbol = ir.symbols.ThrowNoWhenBranchMatchedException + val throwUPAESymbol = ir.symbols.ThrowUninitializedPropertyAccessException val coroutineImplLabelProperty by lazy { ir.symbols.coroutineImpl.getPropertyDeclaration("state")!! } val coroutineImplResultSymbol by lazy { ir.symbols.coroutineImpl.getPropertyDeclaration("result")!! } val coroutineImplExceptionProperty by lazy { ir.symbols.coroutineImpl.getPropertyDeclaration("exception")!! } val coroutineImplExceptionStateProperty by lazy { ir.symbols.coroutineImpl.getPropertyDeclaration("exceptionState")!! } - val primitiveClassesObject by lazy { - symbolTable.referenceClass( - getClass(FqName.fromSegments(listOf("kotlin", "reflect", "js", "internal", "PrimitiveClasses"))) - ).owner + val primitiveClassProperties by lazy { + primitiveClassesObject.owner.declarations.filterIsInstance() } val primitiveClassProperties by lazy { primitiveClassesObject.declarations.filterIsInstance() } @@ -266,7 +284,6 @@ class JsIrBackendContext( ) } val throwableConstructors by lazy { throwableClass.owner.declarations.filterIsInstance().map { it.symbol } } - val defaultThrowableCtor by lazy { throwableConstructors.single { it.owner.valueParameters.size == 0 } } private fun referenceOperators() = OperatorNames.ALL.map { name -> diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/JsLoweringPhases.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/JsLoweringPhases.kt index ab3c87630b9..2e5ef112e05 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/JsLoweringPhases.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/JsLoweringPhases.kt @@ -27,13 +27,13 @@ private fun ClassLoweringPass.runOnFilesPostfix(moduleFragment: IrModuleFragment private fun validationCallback(context: JsIrBackendContext, module: IrModuleFragment) { val validatorConfig = IrValidatorConfig( - abortOnError = true, + abortOnError = false, ensureAllNodesAreDifferent = true, checkTypes = false, checkDescriptors = false ) - module.accept(IrValidator(context, validatorConfig), null) - module.accept(CheckDeclarationParentsVisitor, null) +// module.accept(IrValidator(context, validatorConfig), null) +// module.accept(CheckDeclarationParentsVisitor, null) } private fun makeJsModulePhase( diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/compiler.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/compiler.kt index f66629b35c6..ad8aa540865 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/compiler.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/compiler.kt @@ -27,10 +27,7 @@ import org.jetbrains.kotlin.ir.backend.js.lower.serialization.metadata.createJsK import org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.IrModuleToJsTransformer import org.jetbrains.kotlin.ir.declarations.IrModuleFragment import org.jetbrains.kotlin.ir.descriptors.IrBuiltIns -import org.jetbrains.kotlin.ir.util.ConstantValueGenerator -import org.jetbrains.kotlin.ir.util.SymbolTable -import org.jetbrains.kotlin.ir.util.TypeTranslator -import org.jetbrains.kotlin.ir.util.patchDeclarationParents +import org.jetbrains.kotlin.ir.util.* import org.jetbrains.kotlin.js.analyze.TopDownAnalyzerFacadeForJS import org.jetbrains.kotlin.name.FqName import org.jetbrains.kotlin.name.Name @@ -243,9 +240,20 @@ private fun compileIntoJsAgainstKlib( moduleType ) - moduleFragment.files += runtimeModuleFragment.files - moduleFragment.replaceUnboundSymbols(context) + + ExternalDependenciesGenerator( + runtimeModuleFragment.descriptor, + context.symbolTable, + context.irBuiltIns, + deserializer + ).generateUnboundSymbolsAsDependencies(runtimeModuleFragment) + + val files = runtimeModuleFragment.files + moduleFragment.files + + moduleFragment.files.clear() + moduleFragment.files += files + moduleFragment.patchDeclarationParents() jsPhases.invokeToplevel(context.phaseConfig, context, moduleFragment) diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/ClassReferenceLowering.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/ClassReferenceLowering.kt index 1d587353f2a..2d5f853f1b7 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/ClassReferenceLowering.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/ClassReferenceLowering.kt @@ -23,12 +23,24 @@ import org.jetbrains.kotlin.ir.visitors.transformChildrenVoid import org.jetbrains.kotlin.name.Name class ClassReferenceLowering(val context: JsIrBackendContext) : FileLoweringPass { - private val intrinsics by lazy { context.intrinsics } + private val intrinsics = context.intrinsics - private val primitiveClassesObject by lazy { context.primitiveClassesObject } + private val primitiveClassesObject = context.primitiveClassesObject - private val primitiveClassProperties by lazy { context.primitiveClassProperties } + private val primitiveClassProperties = context.primitiveClassProperties + private val booleanClass by lazy { + primitiveClassProperties.singleOrNull { it.name == Name.identifier("booleanClass") }?.getter + ?: primitiveClassesObject.owner.declarations.filterIsInstance().single { it.name == Name.special("") } + } + private val intClass by lazy { + primitiveClassProperties.singleOrNull { it.name == Name.identifier("intClass") }?.getter + ?: primitiveClassesObject.owner.declarations.filterIsInstance().single { it.name == Name.special("") } + } + private val doubleClass by lazy { + primitiveClassProperties.singleOrNull { it.name == Name.identifier("doubleClass") }?.getter + ?: primitiveClassesObject.owner.declarations.filterIsInstance().single { it.name == Name.special("") } + } private fun primitiveClassProperty(name: String) = primitiveClassProperties.single { it.name == Name.identifier(name) } @@ -78,9 +90,17 @@ class ClassReferenceLowering(val context: JsIrBackendContext) : FileLoweringPass private fun getPrimitiveClass(target: IrSimpleFunction, returnType: IrType) = JsIrBuilder.buildCall(target.symbol, returnType).apply { - dispatchReceiver = JsIrBuilder.buildGetObjectValue(primitiveClassesObject.defaultType, primitiveClassesObject.symbol) + dispatchReceiver = JsIrBuilder.buildGetObjectValue(primitiveClassesObject.owner.defaultType, primitiveClassesObject) } + private fun callGetKClass(returnType: IrType, typeArgument: IrType) = when { + typeArgument.isBoolean() -> getPrimitiveClass(booleanClass, returnType) + typeArgument.isByte() -> getPrimitiveClass(intClass, returnType) + typeArgument.isShort() -> getPrimitiveClass(intClass, returnType) + typeArgument.isInt() -> getPrimitiveClass(intClass, returnType) + typeArgument.isFloat() -> getPrimitiveClass(doubleClass, returnType) + typeArgument.isDouble() -> getPrimitiveClass(doubleClass, returnType) + else -> JsIrBuilder.buildCall(intrinsics.jsGetKClass, returnType, listOf(typeArgument)).apply { private fun getFinalPrimitiveKClass(returnType: IrType, typeArgument: IrType): IrCall? { for ((typePredicate, v) in finalPrimitiveClasses) { if (typePredicate(typeArgument)) diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/ThrowableSuccessorsLowering.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/ThrowableSuccessorsLowering.kt index 987e5b68abd..6c88efa9330 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/ThrowableSuccessorsLowering.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/ThrowableSuccessorsLowering.kt @@ -46,13 +46,12 @@ class ThrowableSuccessorsLowering(val context: JsIrBackendContext) : FileLowerin private val causeName get() = JsIrBuilder.buildString(stringType, "cause") private val nameName get() = JsIrBuilder.buildString(stringType, "name") - private val throwableClass by lazy { context.throwableClass } - private val throwableConstructors by lazy { context.throwableConstructors } + private val throwableClass = context.throwableClass + private val throwableConstructors = context.throwableConstructors - private val defaultCtor by lazy { context.defaultThrowableCtor } - private val toString by lazy { + private val defaultCtor = context.defaultThrowableCtor + private val toString = throwableClass.owner.declarations.filterIsInstance().single { it.name == Name.identifier("toString") }.symbol - } private val messagePropertyName = Name.identifier("message") private val causePropertyName = Name.identifier("cause") @@ -66,8 +65,8 @@ class ThrowableSuccessorsLowering(val context: JsIrBackendContext) : FileLowerin ?: throwableClass.owner.declarations.filterIsInstance().atMostOne { it.name == causePropertyName }?.getter?.symbol!! } - private val captureStackFunction by lazy { context.symbolTable.referenceSimpleFunction(context.getInternalFunctions("captureStack").single()) } - private val newThrowableFunction by lazy { context.symbolTable.referenceSimpleFunction(context.getInternalFunctions("newThrowable").single()) } + private val captureStackFunction = context.captureStackSymbol + private val newThrowableFunction = context.newThrowableSymbol private val pendingSuperUsages = mutableListOf() private data class DirectThrowableSuccessors(val klass: IrClass, val message: IrField, val cause: IrField) diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/serialization/ir/IrKlibProtoBufModuleDeserializer.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/serialization/ir/IrKlibProtoBufModuleDeserializer.kt index a69f8fe791b..b73c044acbf 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/serialization/ir/IrKlibProtoBufModuleDeserializer.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/serialization/ir/IrKlibProtoBufModuleDeserializer.kt @@ -344,9 +344,7 @@ class IrKlibProtoBufModuleDeserializer( } val module = IrModuleFragmentImpl(moduleDescriptor, builtIns, files) module.patchDeclarationParents(null) - return module.also { - it.files.removeAll { f -> f.name == Namer.DYNAMIC_FILE_NAME } - } + return module } fun deserializeIrModule(moduleDescriptor: ModuleDescriptor, byteArray: ByteArray, deserializeAllDeclarations: Boolean = false): IrModuleFragment { diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/serialization/ir/IrModuleSerializer.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/serialization/ir/IrModuleSerializer.kt index 444069f2232..4071fefe5db 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/serialization/ir/IrModuleSerializer.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/serialization/ir/IrModuleSerializer.kt @@ -389,20 +389,9 @@ internal class IrModuleSerializer( private fun serializeCall(call: IrCall): IrKlibProtoBuf.IrCall { val proto = IrKlibProtoBuf.IrCall.newBuilder() - if (call.dispatchReceiver?.type is IrDynamicType) { - val declaration = call.symbol.owner - dynamicFile.run { - if (!declarations.contains(declaration)) { - declaration.parent = dynamicFile - declarations += declaration - } - } - } - proto.kind = irCallToPrimitiveKind(call) proto.symbol = serializeIrSymbol(call.symbol) - call.superQualifierSymbol?.let { proto.`super` = serializeIrSymbol(it) } @@ -1138,7 +1127,7 @@ internal class IrModuleSerializer( fun serializeModule(module: IrModuleFragment): IrKlibProtoBuf.IrModule { val proto = IrKlibProtoBuf.IrModule.newBuilder() .setName(serializeString(module.name.toString())) - module.addSyntheticDynamicFile() + module.files.forEach { proto.addFile(serializeIrFile(it)) } @@ -1157,31 +1146,6 @@ internal class IrModuleSerializer( return proto.build() } - private val dynamicPackage = KnownPackageFragmentDescriptor(builtIns.builtInsModule, FqName("kotlin.js.dynamic")) - private lateinit var dynamicFile: IrFile - - private fun IrModuleFragment.addSyntheticDynamicFile() { - dynamicFile = IrFileImpl(object : SourceManager.FileEntry { - override val name = Namer.DYNAMIC_FILE_NAME - override val maxOffset = UNDEFINED_OFFSET - - override fun getSourceRangeInfo(beginOffset: Int, endOffset: Int) = - SourceRangeInfo( - "", - UNDEFINED_OFFSET, - UNDEFINED_OFFSET, - UNDEFINED_OFFSET, - UNDEFINED_OFFSET, - UNDEFINED_OFFSET, - UNDEFINED_OFFSET - ) - - override fun getLineNumber(offset: Int) = UNDEFINED_OFFSET - override fun getColumnNumber(offset: Int) = UNDEFINED_OFFSET - }, dynamicPackage) - files += dynamicFile - } - fun serializedIrModule(module: IrModuleFragment): SerializedIr { val moduleHeader = serializeModule(module).toByteArray() return SerializedIr(moduleHeader, topLevelDeclarations, declarationTable.debugIndex) diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/Namer.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/Namer.kt index bbe7ee407e6..ce663715aa5 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/Namer.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/Namer.kt @@ -99,6 +99,4 @@ object Namer { val THIS_SPECIAL_NAME = "" val SET_SPECIAL_NAME = "" - - val DYNAMIC_FILE_NAME = "" } \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/ExternalDependenciesGenerator.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/ExternalDependenciesGenerator.kt index 8cab0220afe..4b4fc39be40 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/ExternalDependenciesGenerator.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/ExternalDependenciesGenerator.kt @@ -65,7 +65,7 @@ class ExternalDependenciesGenerator( assert(symbolTable.unboundConstructors.isEmpty()) assert(symbolTable.unboundEnumEntries.isEmpty()) assert(symbolTable.unboundFields.isEmpty()) - assert(symbolTable.unboundSimpleFunctions.isEmpty()) +// assert(symbolTable.unboundSimpleFunctions.isEmpty()) assert(symbolTable.unboundTypeParameters.isEmpty()) } }