diff --git a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/ir/Ir.kt b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/ir/Ir.kt index a0f2c94f61a..9ae49b53fcb 100644 --- a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/ir/Ir.kt +++ b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/ir/Ir.kt @@ -34,7 +34,14 @@ abstract class Symbols(val context: T, private val protected fun builtInsPackage(vararg packageNameSegments: String) = context.builtIns.builtInsModule.getPackage(FqName.fromSegments(listOf(*packageNameSegments))).memberScope - val refClass = symbolTable.referenceClass(context.getInternalClass("Ref")) + + // This hack allows to disable related symbol instantiation in descendants + // TODO move relevant symbols to non-common code + open fun calc(initializer: () -> IrClassSymbol): IrClassSymbol { + return initializer() + } + + val refClass = calc { symbolTable.referenceClass(context.getInternalClass("Ref")) } //abstract val areEqualByValue: List @@ -44,7 +51,7 @@ abstract class Symbols(val context: T, private val abstract val ThrowNoWhenBranchMatchedException: IrFunctionSymbol abstract val ThrowTypeCastException: IrFunctionSymbol - abstract val ThrowUninitializedPropertyAccessException: IrFunctionSymbol + abstract val ThrowUninitializedPropertyAccessException: IrSimpleFunctionSymbol abstract val stringBuilder: IrClassSymbol @@ -74,7 +81,7 @@ abstract class Symbols(val context: T, private val // val getProgressionLast = context.getInternalFunctions("getProgressionLast") // .map { Pair(it.returnType, symbolTable.referenceSimpleFunction(it)) }.toMap() - val defaultConstructorMarker = symbolTable.referenceClass(context.getInternalClass("DefaultConstructorMarker")) + val defaultConstructorMarker = calc { symbolTable.referenceClass(context.getInternalClass("DefaultConstructorMarker")) } val any = symbolTable.referenceClass(builtIns.any) val unit = symbolTable.referenceClass(builtIns.unit) @@ -137,13 +144,13 @@ abstract class Symbols(val context: T, private val abstract val copyRangeTo: Map - val intAnd = symbolTable.referenceFunction( + val intAnd = symbolTable.referenceSimpleFunction( builtIns.intType.memberScope .getContributedFunctions(OperatorNameConventions.AND, NoLookupLocation.FROM_BACKEND) .single() ) - val intPlusInt = symbolTable.referenceFunction( + val intPlusInt = symbolTable.referenceSimpleFunction( builtIns.intType.memberScope .getContributedFunctions(OperatorNameConventions.PLUS, NoLookupLocation.FROM_BACKEND) .single { @@ -164,14 +171,14 @@ abstract class Symbols(val context: T, private val abstract val coroutineSuspendedGetter: IrSimpleFunctionSymbol - val kFunctionImpl = symbolTable.referenceClass(context.reflectionTypes.kFunctionImpl) + val kFunctionImpl = calc { symbolTable.referenceClass(context.reflectionTypes.kFunctionImpl) } - val kProperty0Impl = symbolTable.referenceClass(context.reflectionTypes.kProperty0Impl) - val kProperty1Impl = symbolTable.referenceClass(context.reflectionTypes.kProperty1Impl) - val kProperty2Impl = symbolTable.referenceClass(context.reflectionTypes.kProperty2Impl) - val kMutableProperty0Impl = symbolTable.referenceClass(context.reflectionTypes.kMutableProperty0Impl) - val kMutableProperty1Impl = symbolTable.referenceClass(context.reflectionTypes.kMutableProperty1Impl) - val kMutableProperty2Impl = symbolTable.referenceClass(context.reflectionTypes.kMutableProperty2Impl) + val kProperty0Impl = calc { symbolTable.referenceClass(context.reflectionTypes.kProperty0Impl) } + val kProperty1Impl = calc { symbolTable.referenceClass(context.reflectionTypes.kProperty1Impl) } + val kProperty2Impl = calc { symbolTable.referenceClass(context.reflectionTypes.kProperty2Impl) } + val kMutableProperty0Impl = calc { symbolTable.referenceClass(context.reflectionTypes.kMutableProperty0Impl) } + val kMutableProperty1Impl = calc { symbolTable.referenceClass(context.reflectionTypes.kMutableProperty1Impl) } + val kMutableProperty2Impl = calc { symbolTable.referenceClass(context.reflectionTypes.kMutableProperty2Impl) } // val kLocalDelegatedPropertyImpl = symbolTable.referenceClass(context.reflectionTypes.kLocalDelegatedPropertyImpl) // val kLocalDelegatedMutablePropertyImpl = symbolTable.referenceClass(context.reflectionTypes.kLocalDelegatedMutablePropertyImpl) diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/InitializersLowering.kt b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/InitializersLowering.kt similarity index 82% rename from compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/InitializersLowering.kt rename to compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/InitializersLowering.kt index b3b69fdc08b..167a2cdfaac 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/InitializersLowering.kt +++ b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/InitializersLowering.kt @@ -1,24 +1,12 @@ /* - * Copyright 2010-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.backend.jvm.lower +package org.jetbrains.kotlin.backend.common.lower import org.jetbrains.kotlin.backend.common.ClassLoweringPass -import org.jetbrains.kotlin.backend.jvm.JvmBackendContext -import org.jetbrains.kotlin.backend.jvm.JvmLoweredDeclarationOrigin +import org.jetbrains.kotlin.backend.common.CommonBackendContext import org.jetbrains.kotlin.descriptors.CallableMemberDescriptor import org.jetbrains.kotlin.descriptors.Modality import org.jetbrains.kotlin.descriptors.SourceElement @@ -29,6 +17,7 @@ import org.jetbrains.kotlin.ir.IrElement import org.jetbrains.kotlin.ir.IrStatement import org.jetbrains.kotlin.ir.declarations.IrAnonymousInitializer import org.jetbrains.kotlin.ir.declarations.IrClass +import org.jetbrains.kotlin.ir.declarations.IrDeclarationOrigin import org.jetbrains.kotlin.ir.declarations.IrField import org.jetbrains.kotlin.ir.declarations.impl.IrFunctionImpl import org.jetbrains.kotlin.ir.expressions.IrExpression @@ -48,7 +37,7 @@ import org.jetbrains.kotlin.resolve.descriptorUtil.builtIns import java.util.* -class InitializersLowering(val context: JvmBackendContext) : ClassLoweringPass { +class InitializersLowering(val context: CommonBackendContext, val declarationOrigin: IrDeclarationOrigin) : ClassLoweringPass { override fun lower(irClass: IrClass) { val classInitializersBuilder = ClassInitializersBuilder(irClass) irClass.acceptChildrenVoid(classInitializersBuilder) @@ -106,9 +95,9 @@ class InitializersLowering(val context: JvmBackendContext) : ClassLoweringPass { fun createStaticInitializationMethod(irClass: IrClass) { val staticInitializerDescriptor = SimpleFunctionDescriptorImpl.create( - irClass.descriptor, Annotations.EMPTY, clinitName, - CallableMemberDescriptor.Kind.SYNTHESIZED, - SourceElement.NO_SOURCE + irClass.descriptor, Annotations.EMPTY, clinitName, + CallableMemberDescriptor.Kind.SYNTHESIZED, + SourceElement.NO_SOURCE ) staticInitializerDescriptor.initialize( null, null, emptyList(), emptyList(), @@ -116,7 +105,7 @@ class InitializersLowering(val context: JvmBackendContext) : ClassLoweringPass { Modality.FINAL, Visibilities.PUBLIC ) irClass.declarations.add( - IrFunctionImpl(irClass.startOffset, irClass.endOffset, JvmLoweredDeclarationOrigin.CLASS_STATIC_INITIALIZER, + IrFunctionImpl(irClass.startOffset, irClass.endOffset, declarationOrigin, staticInitializerDescriptor, IrBlockBodyImpl(irClass.startOffset, irClass.endOffset, staticInitializerStatements.map { it.copy() })) diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/PropertiesLowering.kt b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/PropertiesLowering.kt similarity index 71% rename from compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/PropertiesLowering.kt rename to compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/PropertiesLowering.kt index bd302a09bce..5853196254c 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/PropertiesLowering.kt +++ b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/PropertiesLowering.kt @@ -1,20 +1,9 @@ /* - * Copyright 2010-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.backend.jvm.lower +package org.jetbrains.kotlin.backend.common.lower import org.jetbrains.kotlin.backend.common.FileLoweringPass import org.jetbrains.kotlin.ir.IrStatement @@ -31,7 +20,7 @@ import java.util.* class PropertiesLowering : IrElementTransformerVoid(), FileLoweringPass { override fun lower(irFile: IrFile) { - irFile.transformChildrenVoid(this) + irFile.accept(this, null) } override fun visitFile(declaration: IrFile): IrFile { diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/DeclarationOrigins.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/DeclarationOrigins.kt new file mode 100644 index 00000000000..a406c8291e6 --- /dev/null +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/DeclarationOrigins.kt @@ -0,0 +1,13 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.ir.backend.js + +import org.jetbrains.kotlin.ir.declarations.IrDeclarationOrigin +import org.jetbrains.kotlin.ir.declarations.IrDeclarationOriginImpl + +object JsLoweredDeclarationOrigin : IrDeclarationOrigin { + object CLASS_STATIC_INITIALIZER : IrDeclarationOriginImpl("CLASS_STATIC_INITIALIZER") +} \ No newline at end of file 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 new file mode 100644 index 00000000000..30e5d05c0dc --- /dev/null +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/JsIrBackendContext.kt @@ -0,0 +1,113 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.ir.backend.js + +import org.jetbrains.kotlin.backend.common.CommonBackendContext +import org.jetbrains.kotlin.backend.common.ReflectionTypes +import org.jetbrains.kotlin.backend.common.ir.Ir +import org.jetbrains.kotlin.backend.common.ir.Symbols +import org.jetbrains.kotlin.descriptors.* +import org.jetbrains.kotlin.incremental.components.NoLookupLocation +import org.jetbrains.kotlin.ir.IrElement +import org.jetbrains.kotlin.ir.declarations.* +import org.jetbrains.kotlin.ir.descriptors.IrBuiltIns +import org.jetbrains.kotlin.ir.symbols.IrClassSymbol +import org.jetbrains.kotlin.ir.symbols.IrSimpleFunctionSymbol +import org.jetbrains.kotlin.ir.util.SymbolTable +import org.jetbrains.kotlin.name.FqName +import org.jetbrains.kotlin.name.Name +import org.jetbrains.kotlin.resolve.scopes.MemberScope + +class JsIrBackendContext( + val module: ModuleDescriptor, + override val irBuiltIns: IrBuiltIns, + irModuleFragment: IrModuleFragment, + symbolTable: SymbolTable +) : CommonBackendContext { + override val builtIns = module.builtIns + override val sharedVariablesManager = JsSharedVariablesManager(builtIns) + + override val reflectionTypes: ReflectionTypes by lazy(LazyThreadSafetyMode.PUBLICATION) { + // TODO + ReflectionTypes(module, FqName("kotlin.reflect")) + } + + override val ir: Ir = object : Ir(this, irModuleFragment) { + override val symbols: Symbols = object : Symbols(this@JsIrBackendContext, symbolTable) { + + override fun calc(initializer: () -> IrClassSymbol): IrClassSymbol { + return object : IrClassSymbol { + override val owner: IrClass get() = TODO("not implemented") + override val isBound: Boolean get() = TODO("not implemented") + override fun bind(owner: IrClass) = TODO("not implemented") + override val descriptor: ClassDescriptor get() = TODO("not implemented") + } + } + + override val areEqual + get () = TODO("not implemented") + + override val ThrowNullPointerException + get () = TODO("not implemented") + + override val ThrowNoWhenBranchMatchedException + get () = TODO("not implemented") + + override val ThrowTypeCastException + get () = TODO("not implemented") + + override val ThrowUninitializedPropertyAccessException = symbolTable.referenceSimpleFunction( + irBuiltIns.defineOperator( + "throwUninitializedPropertyAccessException", + builtIns.nothingType, + listOf(builtIns.stringType) + ).descriptor + ) + + override val stringBuilder + get() = TODO("not implemented") + override val copyRangeTo: Map + get() = TODO("not implemented") //To change initializer of created properties use File | Settings | File Templates. + override val coroutineImpl: IrClassSymbol + get() = TODO("not implemented") //To change initializer of created properties use File | Settings | File Templates. + override val coroutineSuspendedGetter: IrSimpleFunctionSymbol + get() = TODO("not implemented") //To change initializer of created properties use File | Settings | File Templates. + } + + override fun shouldGenerateHandlerParameterForDefaultBodyFun() = true + } + + private fun find(memberScope: MemberScope, className: String): ClassDescriptor { + return find(memberScope, Name.identifier(className)) + } + + private fun find(memberScope: MemberScope, name: Name): ClassDescriptor { + return memberScope.getContributedClassifier(name, NoLookupLocation.FROM_BACKEND) as ClassDescriptor + } + + override fun getInternalClass(name: String): ClassDescriptor { + return find(module.getPackage(FqName("kotlin.js")).memberScope, name) + } + + override fun getClass(fqName: FqName): ClassDescriptor { + return find(module.getPackage(fqName.parent()).memberScope, fqName.shortName()) + } + + override fun getInternalFunctions(name: String): List { + TODO("not implemented") //To change body of created functions use File | Settings | File Templates. + } + + override fun log(message: () -> String) { + /*TODO*/ + print(message()) + } + + override fun report(element: IrElement?, irFile: IrFile?, message: String, isError: Boolean) { + /*TODO*/ + print(message) + } + +} \ No newline at end of file diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/JsSharedVariablesManager.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/JsSharedVariablesManager.kt new file mode 100644 index 00000000000..ae25ff20488 --- /dev/null +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/JsSharedVariablesManager.kt @@ -0,0 +1,33 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.ir.backend.js + +import org.jetbrains.kotlin.backend.common.descriptors.SharedVariablesManager +import org.jetbrains.kotlin.builtins.KotlinBuiltIns +import org.jetbrains.kotlin.descriptors.VariableDescriptor +import org.jetbrains.kotlin.ir.IrStatement +import org.jetbrains.kotlin.ir.declarations.IrVariable +import org.jetbrains.kotlin.ir.expressions.IrExpression +import org.jetbrains.kotlin.ir.expressions.IrGetValue +import org.jetbrains.kotlin.ir.expressions.IrSetVariable + +class JsSharedVariablesManager(builtIns: KotlinBuiltIns): SharedVariablesManager { + override fun createSharedVariableDescriptor(variableDescriptor: VariableDescriptor): VariableDescriptor { + TODO("not implemented") + } + + override fun defineSharedValue(sharedVariableDescriptor: VariableDescriptor, originalDeclaration: IrVariable): IrStatement { + TODO("not implemented") + } + + override fun getSharedValue(sharedVariableDescriptor: VariableDescriptor, originalGet: IrGetValue): IrExpression { + TODO("not implemented") + } + + override fun setSharedValue(sharedVariableDescriptor: VariableDescriptor, originalSet: IrSetVariable): IrExpression { + TODO("not implemented") + } +} 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 878d9b50a6e..4cb7a73b0c3 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 @@ -6,8 +6,15 @@ package org.jetbrains.kotlin.ir.backend.js import com.intellij.openapi.project.Project +import org.jetbrains.kotlin.backend.common.lower.* +import org.jetbrains.kotlin.backend.common.runOnFilePostfix import org.jetbrains.kotlin.config.CompilerConfiguration import org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.IrModuleToJsTransformer +import org.jetbrains.kotlin.ir.declarations.IrDeclarationOrigin +import org.jetbrains.kotlin.ir.declarations.IrDeclarationOriginImpl +import org.jetbrains.kotlin.ir.declarations.IrFile +import org.jetbrains.kotlin.ir.util.ExternalDependenciesGenerator +import org.jetbrains.kotlin.ir.util.dump import org.jetbrains.kotlin.js.analyze.TopDownAnalyzerFacadeForJS import org.jetbrains.kotlin.name.FqName import org.jetbrains.kotlin.progress.ProgressIndicatorAndCompilationCanceledStatus @@ -25,9 +32,26 @@ fun compile( TopDownAnalyzerFacadeForJS.checkForErrors(files, analysisResult.bindingContext) - val moduleFragment = Psi2IrTranslator().generateModule(analysisResult.moduleDescriptor, files, analysisResult.bindingContext) + val psi2IrTranslator = Psi2IrTranslator() + val psi2IrContext = psi2IrTranslator.createGeneratorContext(analysisResult.moduleDescriptor, analysisResult.bindingContext) + + val moduleFragment = psi2IrTranslator.generateModuleFragment(psi2IrContext, files) + + val context = JsIrBackendContext(analysisResult.moduleDescriptor, psi2IrContext.irBuiltIns, moduleFragment, psi2IrContext.symbolTable) + + ExternalDependenciesGenerator(psi2IrContext.symbolTable, psi2IrContext.irBuiltIns).generateUnboundSymbolsAsDependencies(moduleFragment) + + moduleFragment.files.forEach { context.lower(it) } val program = moduleFragment.accept(IrModuleToJsTransformer(), null) return program.toString() } + +fun JsIrBackendContext.lower(file: IrFile) { + LateinitLowering(this, true).lower(file) + PropertiesLowering().lower(file) + LocalFunctionsLowering(this).lower(file) + DefaultArgumentStubGenerator(this).runOnFilePostfix(file) + InitializersLowering(this, JsLoweredDeclarationOrigin.CLASS_STATIC_INITIALIZER).runOnFilePostfix(file) +} \ No newline at end of file diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/JvmLower.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/JvmLower.kt index 450c013cb6b..7bd8585e434 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/JvmLower.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/JvmLower.kt @@ -51,7 +51,7 @@ class JvmLower(val context: JvmBackendContext) { EnumClassLowering(context).runOnFilePostfix(irFile) //Should be before SyntheticAccessorLowering cause of synthetic accessor for companion constructor ObjectClassLowering(context).lower(irFile) - InitializersLowering(context).runOnFilePostfix(irFile) + InitializersLowering(context, JvmLoweredDeclarationOrigin.CLASS_STATIC_INITIALIZER).runOnFilePostfix(irFile) SingletonReferencesLowering(context).runOnFilePostfix(irFile) SyntheticAccessorLowering(context).lower(irFile) BridgeLowering(context).runOnFilePostfix(irFile) diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/FunctionCodegen.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/FunctionCodegen.kt index 2ed32826f0b..400cc7c57f0 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/FunctionCodegen.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/FunctionCodegen.kt @@ -18,7 +18,7 @@ package org.jetbrains.kotlin.backend.jvm.codegen import org.jetbrains.kotlin.backend.common.lower.DECLARATION_ORIGIN_FUNCTION_FOR_DEFAULT_PARAMETER import org.jetbrains.kotlin.backend.jvm.descriptors.JvmDescriptorWithExtraFlags -import org.jetbrains.kotlin.backend.jvm.lower.InitializersLowering +import org.jetbrains.kotlin.backend.common.lower.InitializersLowering import org.jetbrains.kotlin.codegen.* import org.jetbrains.kotlin.codegen.FunctionCodegen import org.jetbrains.kotlin.codegen.state.GenerationState diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/InterfaceLowering.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/InterfaceLowering.kt index 1797c38b09b..3a4119b19f5 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/InterfaceLowering.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/InterfaceLowering.kt @@ -20,7 +20,7 @@ import org.jetbrains.kotlin.backend.common.ClassLoweringPass import org.jetbrains.kotlin.backend.common.lower.DECLARATION_ORIGIN_FUNCTION_FOR_DEFAULT_PARAMETER import org.jetbrains.kotlin.backend.jvm.JvmLoweredDeclarationOrigin import org.jetbrains.kotlin.backend.jvm.descriptors.DefaultImplsClassDescriptorImpl -import org.jetbrains.kotlin.backend.jvm.lower.InitializersLowering.Companion.clinitName +import org.jetbrains.kotlin.backend.common.lower.InitializersLowering.Companion.clinitName import org.jetbrains.kotlin.codegen.AsmUtil import org.jetbrains.kotlin.codegen.state.GenerationState import org.jetbrains.kotlin.codegen.state.KotlinTypeMapper diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/descriptorUtils.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/descriptorUtils.kt index 22c673625fa..a39513c68e2 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/descriptorUtils.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/descriptorUtils.kt @@ -16,6 +16,7 @@ package org.jetbrains.kotlin.backend.jvm.lower +import org.jetbrains.kotlin.backend.common.lower.InitializersLowering import org.jetbrains.kotlin.descriptors.* import org.jetbrains.kotlin.descriptors.annotations.AnnotationsImpl import org.jetbrains.kotlin.descriptors.impl.SimpleFunctionDescriptorImpl diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/descriptors/IrBuiltIns.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/descriptors/IrBuiltIns.kt index 79640e2b751..557a458b292 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/descriptors/IrBuiltIns.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/descriptors/IrBuiltIns.kt @@ -42,7 +42,7 @@ class IrBuiltIns(val builtIns: KotlinBuiltIns) { private val stubBuilder = DeclarationStubGenerator(SymbolTable(), IrDeclarationOrigin.IR_BUILTINS_STUB) - private fun defineOperator(name: String, returnType: KotlinType, valueParameterTypes: List): IrSimpleFunction { + fun defineOperator(name: String, returnType: KotlinType, valueParameterTypes: List): IrSimpleFunction { val operatorDescriptor = IrSimpleBuiltinOperatorDescriptorImpl(packageFragment, Name.identifier(name), returnType) for ((i, valueParameterType) in valueParameterTypes.withIndex()) { operatorDescriptor.addValueParameter(