From c6c848f92914aaf3aec819ddb4dd532f4311bf77 Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Wed, 15 Apr 2020 12:48:19 +0300 Subject: [PATCH] Introduce & use FirJvmSerializerExtension & FirBasedClassCodegen #KT-38156 In Process --- .../fir/fir-serialization/build.gradle.kts | 2 + .../fir/serialization/FirElementSerializer.kt | 17 +- .../serialization/FirSerializerExtension.kt | 3 +- compiler/fir/fir2ir/build.gradle.kts | 1 - .../fir/fir2ir/jvm-backend/build.gradle.kts | 1 + .../jvm/FirJvmElementAwareStringTable.kt | 38 ++ .../backend/jvm/FirJvmSerializerExtension.kt | 404 ++++++++++++++++++ .../kotlin/fir/backend/FirMetadataSource.kt | 19 +- compiler/ir/backend.jvm/build.gradle.kts | 3 + .../backend/jvm/codegen/ClassCodegen.kt | 35 +- .../codegen/DescriptorBasedClassCodegen.kt | 37 +- .../jvm/codegen/FirBasedClassCodegen.kt | 142 ++++++ .../bound/equals/propertyAccessors.kt | 1 - .../bound/equals/reflectionReference.kt | 1 - .../callableReference/fromJava.kt | 1 - .../tailCallOptimizations/unit/reflection.kt | 1 - .../box/jvmField/classFieldReflection.kt | 1 - .../codegen/box/reflection/call/bigArity.kt | 1 - .../call/bound/extensionFunction.kt | 1 - .../call/bound/innerClassConstructor.kt | 1 - .../call/bound/jvmStaticObjectFunction.kt | 1 - .../reflection/call/bound/memberFunction.kt | 1 - .../reflection/call/bound/objectFunction.kt | 1 - .../box/reflection/call/exceptionHappened.kt | 1 - .../box/reflection/call/fakeOverride.kt | 1 - .../call/fakeOverrideSubstituted.kt | 1 - .../nonOverridingFunOfInlineClass.kt | 1 - .../overridingFunOfInlineClass.kt | 1 - .../reflection/call/innerClassConstructor.kt | 1 - .../codegen/box/reflection/call/jvmStatic.kt | 1 - .../box/reflection/call/localClassMember.kt | 1 - .../reflection/call/memberOfGenericClass.kt | 1 - .../codegen/box/reflection/call/returnUnit.kt | 1 - .../reflection/call/simpleMemberFunction.kt | 1 - .../call/simpleTopLevelFunctions.kt | 1 - .../callBy/boundExtensionFunction.kt | 1 - .../callBy/boundJvmStaticInObject.kt | 1 - .../box/reflection/callBy/companionObject.kt | 1 - .../callBy/defaultAndNonDefaultIntertwined.kt | 1 - .../reflection/callBy/defaultInSuperClass.kt | 1 - .../callBy/defaultInSuperInterface.kt | 1 - .../box/reflection/callBy/emptyVarArg.kt | 1 - .../reflection/callBy/extensionFunction.kt | 1 - .../callBy/jvmStaticInCompanionObject.kt | 1 - .../reflection/callBy/jvmStaticInObject.kt | 1 - .../manyArgumentsNoneDefaultFunction.kt | 1 - .../callBy/manyArgumentsOnlyOneDefault.kt | 1 - .../reflection/callBy/manyMaskArguments.kt | 1 - .../callBy/nonDefaultParameterOmitted.kt | 1 - .../box/reflection/callBy/nullValue.kt | 1 - ...thodIsInvokedWhenNoDefaultValuesAreUsed.kt | 1 - .../callBy/primitiveDefaultValues.kt | 1 - .../callBy/privateMemberFunction.kt | 1 - .../reflection/callBy/simpleMemberFunciton.kt | 1 - .../callBy/simpleTopLevelFunction.kt | 1 - .../box/reflection/classes/companionObject.kt | 1 - .../box/reflection/classes/createInstance.kt | 1 - .../box/reflection/classes/declaredMembers.kt | 1 - .../box/reflection/classes/objectInstance.kt | 1 - .../reflection/classes/sealedSubclasses.kt | 1 - .../constructors/annotationClass.kt | 1 - .../classesWithoutConstructors.kt | 1 - .../constructors/simpleGetConstructors.kt | 1 - .../createAnnotation/annotationType.kt | 1 - .../createAnnotation/parameterNamedEquals.kt | 1 - .../functions/declaredVsInheritedFunctions.kt | 1 - .../functions/genericOverriddenFunction.kt | 1 - .../functions/instanceOfFunction.kt | 1 - .../functions/isAccessibleOnAllMembers.kt | 1 - .../functions/privateMemberFunction.kt | 1 - .../functions/simpleGetFunctions.kt | 1 - .../box/reflection/mapping/constructor.kt | 1 - .../constructorWithInlineClassParameters.kt | 1 - .../mapping/fakeOverrides/javaMethod.kt | 1 - .../box/reflection/mapping/functions.kt | 1 - .../reflection/mapping/methodsFromObject.kt | 1 - .../mapping/methodsFromSuperInterface.kt | 1 - .../box/reflection/mapping/openSuspendFun.kt | 1 - .../mapping/topLevelFunctionOtherFile.kt | 1 - .../reflection/mapping/types/constructors.kt | 1 - .../mapping/types/genericArrayElementType.kt | 1 - .../mapping/types/inlineClassInSignature.kt | 1 - .../mapping/types/innerGenericTypeArgument.kt | 1 - .../mapping/types/memberFunctions.kt | 1 - .../mapping/types/overrideAnyWithPrimitive.kt | 1 - .../types/parameterizedTypeArgument.kt | 1 - .../reflection/mapping/types/suspendFun.kt | 1 - .../mapping/types/topLevelFunctions.kt | 1 - .../mapping/types/typeParameters.kt | 1 - .../mapping/types/withNullability.kt | 1 - ...llableReferencesEqualToCallablesFromAPI.kt | 1 - .../fakeOverrideEqualsHashCode.kt | 1 - .../methodsFromAny/fakeOverrideToString.kt | 1 - .../methodsFromAny/memberExtensionToString.kt | 1 - .../parametersEqualsHashCode.kt | 1 - .../methodsFromAny/parametersToString.kt | 1 - .../methodsFromAny/typeEqualsHashCode.kt | 1 - .../reflection/methodsFromAny/typeToString.kt | 1 - .../typeToStringInnerGeneric.kt | 1 - .../reflection/modifiers/callableModality.kt | 1 - .../modifiers/callableVisibility.kt | 1 - .../box/reflection/modifiers/classModality.kt | 1 - .../reflection/modifiers/classVisibility.kt | 1 - .../reflection/modifiers/typeParameters.kt | 1 - .../callFunctionsInMultifileClass.kt | 1 - .../box/reflection/parameters/bigArity.kt | 1 - .../parameters/findParameterByName.kt | 1 - .../functionParameterNameAndIndex.kt | 1 - .../reflection/parameters/isMarkedNullable.kt | 1 - .../box/reflection/parameters/isOptional.kt | 1 - .../properties/accessors/accessorNames.kt | 1 - .../reflection/properties/allVsDeclared.kt | 1 - .../declaredVsInheritedProperties.kt | 1 - .../properties/fakeOverridesInSubclass.kt | 1 - ...nericClassLiteralPropertyReceiverIsStar.kt | 1 - .../properties/genericOverriddenProperty.kt | 1 - .../properties/getDelegate/fakeOverride.kt | 1 - ...getExtensionPropertiesMutableVsReadonly.kt | 1 - .../getPropertiesMutableVsReadonly.kt | 1 - .../reflection/properties/invokeKProperty.kt | 1 - .../annotationCompanionWithAnnotation.kt | 1 - .../properties/jvmField/interfaceCompanion.kt | 1 - .../interfaceCompanionWithAnnotation.kt | 1 - .../memberAndMemberExtensionWithSameName.kt | 1 - .../properties/privateToThisAccessors.kt | 1 - .../propertyOfNestedClassAndArrayType.kt | 1 - .../properties/protectedClassVar.kt | 1 - .../properties/publicClassValAccessible.kt | 1 - .../properties/simpleGetProperties.kt | 1 - .../supertypes/builtInClassSupertypes.kt | 1 - .../reflection/supertypes/simpleSupertypes.kt | 1 - .../typeParameters/declarationSiteVariance.kt | 1 - .../typeParameters/typeParametersAndNames.kt | 1 - .../reflection/typeParameters/upperBounds.kt | 1 - .../types/classifierIsTypeParameter.kt | 1 - .../types/createType/innerGeneric.kt | 1 - .../types/createType/typeParameter.kt | 1 - .../createType/wrongNumberOfArguments.kt | 1 - .../reflection/types/innerGenericArguments.kt | 1 - .../types/platformTypeNotEqualToKotlinType.kt | 1 - .../types/subtyping/platformType.kt | 1 - .../types/subtyping/simpleGenericTypes.kt | 1 - .../types/subtyping/simpleSubtypeSupertype.kt | 1 - .../types/subtyping/typeProjection.kt | 1 - .../box/reflection/types/typeArguments.kt | 1 - .../box/reflection/types/useSiteVariance.kt | 1 - .../box/reflection/types/withNullability.kt | 1 - 147 files changed, 663 insertions(+), 174 deletions(-) create mode 100644 compiler/fir/fir2ir/jvm-backend/src/org/jetbrains/kotlin/fir/backend/jvm/FirJvmElementAwareStringTable.kt create mode 100644 compiler/fir/fir2ir/jvm-backend/src/org/jetbrains/kotlin/fir/backend/jvm/FirJvmSerializerExtension.kt create mode 100644 compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/FirBasedClassCodegen.kt diff --git a/compiler/fir/fir-serialization/build.gradle.kts b/compiler/fir/fir-serialization/build.gradle.kts index 1c49e07f037..1bc22156e23 100644 --- a/compiler/fir/fir-serialization/build.gradle.kts +++ b/compiler/fir/fir-serialization/build.gradle.kts @@ -8,6 +8,8 @@ dependencies { compile(project(":compiler:fir:cones")) compile(project(":compiler:fir:tree")) compile(project(":compiler:fir:resolve")) + compileOnly(project(":compiler:ir.tree")) + compileOnly(project(":compiler:fir:fir2ir")) compileOnly(intellijCoreDep()) { includeJars("intellij-core", rootProject = rootProject) } } diff --git a/compiler/fir/fir-serialization/src/org/jetbrains/kotlin/fir/serialization/FirElementSerializer.kt b/compiler/fir/fir-serialization/src/org/jetbrains/kotlin/fir/serialization/FirElementSerializer.kt index 28dbac1a4ed..b949ab24573 100644 --- a/compiler/fir/fir-serialization/src/org/jetbrains/kotlin/fir/serialization/FirElementSerializer.kt +++ b/compiler/fir/fir-serialization/src/org/jetbrains/kotlin/fir/serialization/FirElementSerializer.kt @@ -9,6 +9,7 @@ import org.jetbrains.kotlin.config.LanguageFeature import org.jetbrains.kotlin.descriptors.* import org.jetbrains.kotlin.fir.FirAnnotationContainer import org.jetbrains.kotlin.fir.FirSession +import org.jetbrains.kotlin.fir.backend.FirMetadataSource import org.jetbrains.kotlin.fir.declarations.* import org.jetbrains.kotlin.fir.declarations.impl.FirDefaultPropertyAccessor import org.jetbrains.kotlin.fir.expressions.FirAnnotationCall @@ -24,6 +25,7 @@ import org.jetbrains.kotlin.fir.resolve.toSymbol import org.jetbrains.kotlin.fir.symbols.StandardClassIds import org.jetbrains.kotlin.fir.types.* import org.jetbrains.kotlin.fir.types.impl.FirImplicitNullableAnyTypeRef +import org.jetbrains.kotlin.ir.declarations.IrClass import org.jetbrains.kotlin.metadata.ProtoBuf import org.jetbrains.kotlin.metadata.deserialization.Flags import org.jetbrains.kotlin.metadata.deserialization.VersionRequirement @@ -51,7 +53,8 @@ class FirElementSerializer private constructor( ) { private val contractSerializer = FirContractSerializer() - fun classProto(klass: FirClass<*>): ProtoBuf.Class.Builder { + fun classProto(irClass: IrClass): ProtoBuf.Class.Builder { + val klass = (irClass.metadata as FirMetadataSource.Class).klass val builder = ProtoBuf.Class.newBuilder() val regularClass = klass as? FirRegularClass @@ -143,7 +146,7 @@ class FirElementSerializer private constructor( builder.addAllVersionRequirement(versionRequirementTable.serializeVersionRequirements(klass)) - extension.serializeClass(klass, builder, versionRequirementTable, this) + extension.serializeClass(irClass, builder, versionRequirementTable, this) writeVersionRequirementForInlineClasses(klass, builder, versionRequirementTable) @@ -545,11 +548,11 @@ class FirElementSerializer private constructor( fillFromPossiblyInnerType(builder, type) } is ConeTypeParameterType -> { - // TODO: type parameter containing declaration? - if (false /*descriptor.containingDeclaration === containingDeclaration*/) { - //builder.typeParameterName = getSimpleNameIndex(descriptor.name) + val typeParameter = type.lookupTag.typeParameterSymbol.fir + if (typeParameter in (containingDeclaration as? FirMemberDeclaration)?.typeParameters ?: emptyList()) { + builder.typeParameterName = getSimpleNameIndex(typeParameter.name) } else { - builder.typeParameter = getTypeParameterId(type.lookupTag.typeParameterSymbol.fir) + builder.typeParameter = getTypeParameterId(typeParameter) } } } @@ -636,7 +639,7 @@ class FirElementSerializer private constructor( typeTable, versionRequirementTable, serializeTypeTableToFunction = false ) - private val stringTable: FirElementAwareStringTable + val stringTable: FirElementAwareStringTable get() = extension.stringTable private fun useTypeTable(): Boolean = extension.shouldUseTypeTable() diff --git a/compiler/fir/fir-serialization/src/org/jetbrains/kotlin/fir/serialization/FirSerializerExtension.kt b/compiler/fir/fir-serialization/src/org/jetbrains/kotlin/fir/serialization/FirSerializerExtension.kt index 90b88bacb90..7b20dd36bb9 100644 --- a/compiler/fir/fir-serialization/src/org/jetbrains/kotlin/fir/serialization/FirSerializerExtension.kt +++ b/compiler/fir/fir-serialization/src/org/jetbrains/kotlin/fir/serialization/FirSerializerExtension.kt @@ -10,6 +10,7 @@ import org.jetbrains.kotlin.fir.declarations.* import org.jetbrains.kotlin.fir.types.ConeFlexibleType import org.jetbrains.kotlin.fir.types.ConeKotlinErrorType import org.jetbrains.kotlin.fir.types.ConeKotlinType +import org.jetbrains.kotlin.ir.declarations.IrClass import org.jetbrains.kotlin.metadata.ProtoBuf import org.jetbrains.kotlin.metadata.deserialization.BinaryVersion import org.jetbrains.kotlin.metadata.serialization.MutableVersionRequirementTable @@ -35,7 +36,7 @@ abstract class FirSerializerExtension { } open fun serializeClass( - klass: FirClass<*>, + klass: IrClass, proto: ProtoBuf.Class.Builder, versionRequirementTable: MutableVersionRequirementTable, childSerializer: FirElementSerializer diff --git a/compiler/fir/fir2ir/build.gradle.kts b/compiler/fir/fir2ir/build.gradle.kts index aaaaa86c4fc..4605fa6403c 100644 --- a/compiler/fir/fir2ir/build.gradle.kts +++ b/compiler/fir/fir2ir/build.gradle.kts @@ -7,7 +7,6 @@ dependencies { compileOnly(project(":core:descriptors")) compileOnly(project(":compiler:fir:cones")) compileOnly(project(":compiler:fir:resolve")) - compileOnly(project(":compiler:fir:fir-serialization")) compileOnly(project(":compiler:fir:tree")) compileOnly(project(":compiler:ir.tree")) compileOnly(project(":compiler:ir.psi2ir")) diff --git a/compiler/fir/fir2ir/jvm-backend/build.gradle.kts b/compiler/fir/fir2ir/jvm-backend/build.gradle.kts index 3d53fb60f18..7498d0e1ffc 100644 --- a/compiler/fir/fir2ir/jvm-backend/build.gradle.kts +++ b/compiler/fir/fir2ir/jvm-backend/build.gradle.kts @@ -9,6 +9,7 @@ dependencies { compileOnly(project(":compiler:fir:resolve")) compileOnly(project(":compiler:fir:tree")) compileOnly(project(":compiler:fir:fir2ir")) + compileOnly(project(":compiler:fir:fir-serialization")) compileOnly(project(":compiler:ir.tree")) compileOnly(project(":compiler:backend")) diff --git a/compiler/fir/fir2ir/jvm-backend/src/org/jetbrains/kotlin/fir/backend/jvm/FirJvmElementAwareStringTable.kt b/compiler/fir/fir2ir/jvm-backend/src/org/jetbrains/kotlin/fir/backend/jvm/FirJvmElementAwareStringTable.kt new file mode 100644 index 00000000000..52de45690ad --- /dev/null +++ b/compiler/fir/fir2ir/jvm-backend/src/org/jetbrains/kotlin/fir/backend/jvm/FirJvmElementAwareStringTable.kt @@ -0,0 +1,38 @@ +/* + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * 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.fir.backend.jvm + +import org.jetbrains.kotlin.codegen.state.KotlinTypeMapperBase +import org.jetbrains.kotlin.fir.declarations.FirClassLikeDeclaration +import org.jetbrains.kotlin.fir.render +import org.jetbrains.kotlin.fir.serialization.FirElementAwareStringTable +import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmNameResolver +import org.jetbrains.kotlin.metadata.jvm.serialization.JvmStringTable +import org.jetbrains.kotlin.name.ClassId +import org.jetbrains.kotlin.name.FqName + +class FirJvmElementAwareStringTable( + private val typeMapper: KotlinTypeMapperBase, + nameResolver: JvmNameResolver? = null +) : JvmStringTable(nameResolver), FirElementAwareStringTable { + override fun getLocalClassIdReplacement(classLikeDeclaration: FirClassLikeDeclaration<*>): ClassId { + return when (classLikeDeclaration.symbol.classId.outerClassId) { + // TODO: how to determine parent declaration for FIR local class properly? + //is ClassifierDescriptorWithTypeParameters -> getLocalClassIdReplacement(container).createNestedClassId(descriptor.name) +// null -> { +// throw IllegalStateException( +// "getLocalClassIdReplacement should only be called for local classes: ${classLikeDeclaration.render()}" +// ) +// } + else -> { + classLikeDeclaration.symbol.classId + // TODO: typeMapper.mapClass + //val fqName = FqName(typeMapper.mapClass(descriptor).internalName.replace('/', '.')) + //ClassId(fqName.parent(), FqName.topLevel(fqName.shortName()), true) + } + } + } +} \ No newline at end of file diff --git a/compiler/fir/fir2ir/jvm-backend/src/org/jetbrains/kotlin/fir/backend/jvm/FirJvmSerializerExtension.kt b/compiler/fir/fir2ir/jvm-backend/src/org/jetbrains/kotlin/fir/backend/jvm/FirJvmSerializerExtension.kt new file mode 100644 index 00000000000..daa127cdf0d --- /dev/null +++ b/compiler/fir/fir2ir/jvm-backend/src/org/jetbrains/kotlin/fir/backend/jvm/FirJvmSerializerExtension.kt @@ -0,0 +1,404 @@ +/* + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * 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.fir.backend.jvm + +import org.jetbrains.kotlin.codegen.ClassBuilderMode +import org.jetbrains.kotlin.codegen.serialization.JvmSerializationBindings +import org.jetbrains.kotlin.codegen.state.GenerationState +import org.jetbrains.kotlin.codegen.state.KotlinTypeMapperBase +import org.jetbrains.kotlin.config.JvmDefaultMode +import org.jetbrains.kotlin.descriptors.ClassDescriptor +import org.jetbrains.kotlin.descriptors.ClassKind +import org.jetbrains.kotlin.descriptors.PropertyDescriptor +import org.jetbrains.kotlin.descriptors.Visibilities +import org.jetbrains.kotlin.fir.FirEffectiveVisibility +import org.jetbrains.kotlin.fir.FirSession +import org.jetbrains.kotlin.fir.backend.FirMetadataSource +import org.jetbrains.kotlin.fir.declarations.* +import org.jetbrains.kotlin.fir.resolve.inference.isBuiltinFunctionalType +import org.jetbrains.kotlin.fir.serialization.FirElementSerializer +import org.jetbrains.kotlin.fir.serialization.FirSerializerExtension +import org.jetbrains.kotlin.fir.types.* +import org.jetbrains.kotlin.ir.declarations.IrClass +import org.jetbrains.kotlin.load.java.JvmAbi +import org.jetbrains.kotlin.load.kotlin.NON_EXISTENT_CLASS_NAME +import org.jetbrains.kotlin.metadata.ProtoBuf +import org.jetbrains.kotlin.metadata.jvm.JvmProtoBuf +import org.jetbrains.kotlin.metadata.jvm.deserialization.ClassMapperLite +import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmFlags +import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmProtoBufUtil +import org.jetbrains.kotlin.metadata.serialization.MutableVersionRequirementTable +import org.jetbrains.kotlin.name.FqName +import org.jetbrains.kotlin.protobuf.GeneratedMessageLite +import org.jetbrains.kotlin.resolve.DescriptorUtils +import org.jetbrains.kotlin.resolve.jvm.annotations.JVM_DEFAULT_FQ_NAME +import org.jetbrains.kotlin.serialization.DescriptorSerializer +import org.jetbrains.org.objectweb.asm.Type +import org.jetbrains.org.objectweb.asm.commons.Method + +class FirJvmSerializerExtension @JvmOverloads constructor( + override val session: FirSession, + private val bindings: JvmSerializationBindings, + state: GenerationState, + private val typeMapper: KotlinTypeMapperBase = state.typeMapper +) : FirSerializerExtension() { + private val globalBindings = state.globalSerializationBindings + override val stringTable = FirJvmElementAwareStringTable(typeMapper) + private val useTypeTable = state.useTypeTableInSerializer + private val moduleName = state.moduleName + private val classBuilderMode = state.classBuilderMode + private val isParamAssertionsDisabled = state.isParamAssertionsDisabled + private val unifiedNullChecks = state.unifiedNullChecks + override val metadataVersion = state.metadataVersion + private val jvmDefaultMode = state.jvmDefaultMode + + override fun shouldUseTypeTable(): Boolean = useTypeTable + override fun shouldSerializeFunction(function: FirFunction<*>): Boolean { + return classBuilderMode != ClassBuilderMode.ABI || + function !is FirSimpleFunction || function.visibility != Visibilities.PRIVATE + } + + override fun shouldSerializeProperty(property: FirProperty): Boolean { + return classBuilderMode != ClassBuilderMode.ABI || property.visibility != Visibilities.PRIVATE + } + + override fun shouldSerializeTypeAlias(typeAlias: FirTypeAlias): Boolean { + return classBuilderMode != ClassBuilderMode.ABI || typeAlias.visibility != Visibilities.PRIVATE + } + + override fun shouldSerializeNestedClass(nestedClass: FirRegularClass): Boolean { + return classBuilderMode != ClassBuilderMode.ABI || nestedClass.effectiveVisibility != FirEffectiveVisibility.Private + } + + override fun serializeClass( + klass: IrClass, + proto: ProtoBuf.Class.Builder, + versionRequirementTable: MutableVersionRequirementTable, + childSerializer: FirElementSerializer + ) { + if (moduleName != JvmProtoBufUtil.DEFAULT_MODULE_NAME) { + proto.setExtension(JvmProtoBuf.classModuleName, stringTable.getStringIndex(moduleName)) + } + //TODO: support local delegated properties in new defaults scheme + val containerAsmType = + if (klass is FirRegularClass && klass.classKind == ClassKind.INTERFACE) typeMapper.mapDefaultImpls(klass.descriptor) + else typeMapper.mapClass(klass.descriptor) + writeLocalProperties(proto, containerAsmType, JvmProtoBuf.classLocalVariable) + val firClass = (klass.metadata as FirMetadataSource.Class).klass + writeVersionRequirementForJvmDefaultIfNeeded(firClass, proto, versionRequirementTable) + + if (jvmDefaultMode.forAllMethodsWithBody && klass is FirRegularClass && klass.classKind == ClassKind.INTERFACE) { + proto.setExtension(JvmProtoBuf.jvmClassFlags, JvmFlags.getClassFlags(true)) + } + } + + // Interfaces which have @JvmDefault members somewhere in the hierarchy need the compiler 1.2.40+ + // so that the generated bridges in subclasses would call the super members correctly + private fun writeVersionRequirementForJvmDefaultIfNeeded( + klass: FirClass<*>, + builder: ProtoBuf.Class.Builder, + versionRequirementTable: MutableVersionRequirementTable + ) { + if (klass is FirRegularClass && klass.classKind == ClassKind.INTERFACE) { + if (jvmDefaultMode == JvmDefaultMode.ENABLE && klass.declarations.any { + it is FirCallableMemberDeclaration<*> && it.annotations.any { annotationCall -> + val classId = annotationCall.annotationTypeRef.coneTypeSafe()?.classId + classId?.asSingleFqName() == JVM_DEFAULT_FQ_NAME + } + }) { + builder.addVersionRequirement( + DescriptorSerializer.writeVersionRequirement( + 1, + 2, + 40, + ProtoBuf.VersionRequirement.VersionKind.COMPILER_VERSION, + versionRequirementTable + ) + ) + } + if (jvmDefaultMode == JvmDefaultMode.ALL_INCOMPATIBLE) { + builder.addVersionRequirement( + DescriptorSerializer.writeVersionRequirement( + 1, + 4, + 0, + ProtoBuf.VersionRequirement.VersionKind.COMPILER_VERSION, + versionRequirementTable + ) + ) + } + } + } + + override fun serializePackage(packageFqName: FqName, proto: ProtoBuf.Package.Builder) { + if (moduleName != JvmProtoBufUtil.DEFAULT_MODULE_NAME) { + proto.setExtension(JvmProtoBuf.packageModuleName, stringTable.getStringIndex(moduleName)) + } + } + + fun serializeJvmPackage(proto: ProtoBuf.Package.Builder, partAsmType: Type) { + writeLocalProperties(proto, partAsmType, JvmProtoBuf.packageLocalVariable) + } + + private fun , BuilderType : GeneratedMessageLite.ExtendableBuilder> writeLocalProperties( + proto: BuilderType, + classAsmType: Type, + extension: GeneratedMessageLite.GeneratedExtension> + ) { + // TODO +// val localVariables = CodegenBinding.getLocalDelegatedProperties(codegenBinding, classAsmType) ?: return +// +// for (localVariable in localVariables) { +// val propertyDescriptor = createFreeFakeLocalPropertyDescriptor(localVariable) +// val serializer = FirElementSerializer.createForLambda(this) +// proto.addExtension(extension, serializer.propertyProto(propertyDescriptor)?.build() ?: continue) +// } + } + + override fun serializeFlexibleType( + type: ConeFlexibleType, + lowerProto: ProtoBuf.Type.Builder, + upperProto: ProtoBuf.Type.Builder + ) { + lowerProto.flexibleTypeCapabilitiesId = stringTable.getStringIndex(JvmProtoBufUtil.PLATFORM_TYPE_ID) + + if (type is ConeRawType) { + lowerProto.setExtension(JvmProtoBuf.isRaw, true) + + // we write this Extension for compatibility with old compiler + upperProto.setExtension(JvmProtoBuf.isRaw, true) + } + } + + override fun serializeType(type: ConeKotlinType, proto: ProtoBuf.Type.Builder) { + // TODO: don't store type annotations in our binary metadata on Java 8, use *TypeAnnotations attributes instead + // TODO: (FIR) ConeKotlinType does not store annotations, see KT-30066 +// for (annotation in type.annotations) { +// proto.addExtension(JvmProtoBuf.typeAnnotation, annotationSerializer.serializeAnnotation(annotation)) +// } + } + + override fun serializeTypeParameter(typeParameter: FirTypeParameter, proto: ProtoBuf.TypeParameter.Builder) { + for (annotation in typeParameter.annotations) { + proto.addExtension(JvmProtoBuf.typeParameterAnnotation, annotationSerializer.serializeAnnotation(annotation)) + } + } + + override fun serializeConstructor( + constructor: FirConstructor, proto: ProtoBuf.Constructor.Builder, childSerializer: FirElementSerializer + ) { + val method = getBinding(METHOD_FOR_FIR_FUNCTION, constructor) + if (method != null) { + val signature = SignatureSerializer().methodSignature(constructor, method) + if (signature != null) { + proto.setExtension(JvmProtoBuf.constructorSignature, signature) + } + } + } + + override fun serializeFunction( + function: FirFunction<*>, + proto: ProtoBuf.Function.Builder, + versionRequirementTable: MutableVersionRequirementTable?, + childSerializer: FirElementSerializer + ) { + val method = getBinding(METHOD_FOR_FIR_FUNCTION, function) + if (method != null) { + val signature = SignatureSerializer().methodSignature(function, method) + if (signature != null) { + proto.setExtension(JvmProtoBuf.methodSignature, signature) + } + } + + if (function.needsInlineParameterNullCheckRequirement()) { + versionRequirementTable?.writeInlineParameterNullCheckRequirement(proto::addVersionRequirement) + } + } + + private fun MutableVersionRequirementTable.writeInlineParameterNullCheckRequirement(add: (Int) -> Unit) { + if (unifiedNullChecks) { + // Since Kotlin 1.4, we generate a call to Intrinsics.checkNotNullParameter in inline functions which causes older compilers + // (earlier than 1.3.50) to crash because a functional parameter in this position can't be inlined + add(DescriptorSerializer.writeVersionRequirement(1, 3, 50, ProtoBuf.VersionRequirement.VersionKind.COMPILER_VERSION, this)) + } + } + + private fun FirFunction<*>.needsInlineParameterNullCheckRequirement(): Boolean = + this is FirSimpleFunction && isInline && !isSuspend && !isParamAssertionsDisabled && + !Visibilities.isPrivate(visibility) && + (valueParameters.any { it.returnTypeRef.coneTypeSafe()?.isBuiltinFunctionalType(session) == true } || + receiverTypeRef?.coneTypeSafe()?.isBuiltinFunctionalType(session) == true) + + override fun serializeProperty( + property: FirProperty, + proto: ProtoBuf.Property.Builder, + versionRequirementTable: MutableVersionRequirementTable?, + childSerializer: FirElementSerializer + ) { + val signatureSerializer = SignatureSerializer() + + val getter = property.getter + val setter = property.setter + val getterMethod = if (getter == null) null else getBinding(METHOD_FOR_FIR_FUNCTION, getter) + val setterMethod = if (setter == null) null else getBinding(METHOD_FOR_FIR_FUNCTION, setter) + + // TODO: FIR field metadata + //val field = getBinding(JvmSerializationBindings.FIELD_FOR_PROPERTY, property) + val syntheticMethod = getBinding(SYNTHETIC_METHOD_FOR_FIR_VARIABLE, property) + + val signature = signatureSerializer.propertySignature( + property, + null, //field?.second, + null, //field?.first?.descriptor, + if (syntheticMethod != null) signatureSerializer.methodSignature(null, syntheticMethod) else null, + if (getterMethod != null) signatureSerializer.methodSignature(null, getterMethod) else null, + if (setterMethod != null) signatureSerializer.methodSignature(null, setterMethod) else null + ) + + if (signature != null) { + proto.setExtension(JvmProtoBuf.propertySignature, signature) + } + + // TODO +// if (property.isJvmFieldPropertyInInterfaceCompanion() && versionRequirementTable != null) { +// proto.setExtension(JvmProtoBuf.flags, JvmFlags.getPropertyFlags(true)) +// +// proto.addVersionRequirement( +// DescriptorSerializer.writeVersionRequirement( +// 1, +// 2, +// 70, +// ProtoBuf.VersionRequirement.VersionKind.COMPILER_VERSION, +// versionRequirementTable +// ) +// ) +// } + + if (getter?.needsInlineParameterNullCheckRequirement() == true || setter?.needsInlineParameterNullCheckRequirement() == true) { + versionRequirementTable?.writeInlineParameterNullCheckRequirement(proto::addVersionRequirement) + } + } + + private fun PropertyDescriptor.isJvmFieldPropertyInInterfaceCompanion(): Boolean { + if (!JvmAbi.hasJvmFieldAnnotation(this)) return false + + val container = containingDeclaration + if (!DescriptorUtils.isCompanionObject(container)) return false + + val grandParent = (container as ClassDescriptor).containingDeclaration + return DescriptorUtils.isInterface(grandParent) || DescriptorUtils.isAnnotationClass(grandParent) + } + + override fun serializeErrorType(type: ConeKotlinErrorType, builder: ProtoBuf.Type.Builder) { + if (classBuilderMode === ClassBuilderMode.KAPT3) { + builder.className = stringTable.getStringIndex(NON_EXISTENT_CLASS_NAME) + return + } + + super.serializeErrorType(type, builder) + } + + private fun getBinding(slice: JvmSerializationBindings.SerializationMappingSlice, key: K): V? = + bindings.get(slice, key) ?: globalBindings.get(slice, key) + + private inner class SignatureSerializer { + fun methodSignature(function: FirFunction<*>?, method: Method): JvmProtoBuf.JvmMethodSignature? { + val builder = JvmProtoBuf.JvmMethodSignature.newBuilder() + if (function == null || (function as? FirSimpleFunction)?.name?.asString() != method.name) { + builder.name = stringTable.getStringIndex(method.name) + } + if (function == null || requiresSignature(function, method.descriptor)) { + builder.desc = stringTable.getStringIndex(method.descriptor) + } + return if (builder.hasName() || builder.hasDesc()) builder.build() else null + } + + // We don't write those signatures which can be trivially reconstructed from already serialized data + // TODO: make JvmStringTable implement NameResolver and use JvmProtoBufUtil#getJvmMethodSignature instead + private fun requiresSignature(function: FirFunction<*>, desc: String): Boolean { + val sb = StringBuilder() + sb.append("(") + val receiverTypeRef = function.receiverTypeRef + if (receiverTypeRef != null) { + val receiverDesc = mapTypeDefault(receiverTypeRef) ?: return true + sb.append(receiverDesc) + } + + for (valueParameter in function.valueParameters) { + val paramDesc = mapTypeDefault(valueParameter.returnTypeRef) ?: return true + sb.append(paramDesc) + } + + sb.append(")") + + val returnTypeRef = function.returnTypeRef + val returnTypeDesc = (mapTypeDefault(returnTypeRef)) ?: return true + sb.append(returnTypeDesc) + + return sb.toString() != desc + } + + private fun requiresSignature(property: FirProperty, desc: String): Boolean { + return desc != mapTypeDefault(property.returnTypeRef) + } + + private fun mapTypeDefault(typeRef: FirTypeRef): String? { + val classId = typeRef.coneTypeSafe()?.classId + return if (classId == null) null else ClassMapperLite.mapClass(classId.asString()) + } + + fun propertySignature( + property: FirProperty, + fieldName: String?, + fieldDesc: String?, + syntheticMethod: JvmProtoBuf.JvmMethodSignature?, + getter: JvmProtoBuf.JvmMethodSignature?, + setter: JvmProtoBuf.JvmMethodSignature? + ): JvmProtoBuf.JvmPropertySignature? { + val signature = JvmProtoBuf.JvmPropertySignature.newBuilder() + + if (fieldDesc != null) { + assert(fieldName != null) { "Field name shouldn't be null when there's a field type: $fieldDesc" } + signature.field = fieldSignature(property, fieldName!!, fieldDesc) + } + + if (syntheticMethod != null) { + signature.syntheticMethod = syntheticMethod + } + + if (getter != null) { + signature.getter = getter + } + if (setter != null) { + signature.setter = setter + } + + return signature.build().takeIf { it.serializedSize > 0 } + } + + fun fieldSignature( + property: FirProperty, + name: String, + desc: String + ): JvmProtoBuf.JvmFieldSignature { + val builder = JvmProtoBuf.JvmFieldSignature.newBuilder() + if (property.name.asString() != name) { + builder.name = stringTable.getStringIndex(name) + } + if (requiresSignature(property, desc)) { + builder.desc = stringTable.getStringIndex(desc) + } + return builder.build() + } + } + + companion object { + val METHOD_FOR_FIR_FUNCTION = JvmSerializationBindings.SerializationMappingSlice.create, Method>() + + val SYNTHETIC_METHOD_FOR_FIR_VARIABLE = JvmSerializationBindings.SerializationMappingSlice.create, Method>() + } + +} diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/FirMetadataSource.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/FirMetadataSource.kt index 55d8d312c1a..a5305c3a378 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/FirMetadataSource.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/FirMetadataSource.kt @@ -7,21 +7,34 @@ package org.jetbrains.kotlin.fir.backend import org.jetbrains.kotlin.descriptors.FunctionDescriptor import org.jetbrains.kotlin.descriptors.PropertyDescriptor +import org.jetbrains.kotlin.fir.FirSession import org.jetbrains.kotlin.fir.declarations.* import org.jetbrains.kotlin.ir.declarations.MetadataSource import org.jetbrains.kotlin.ir.descriptors.WrappedClassDescriptor interface FirMetadataSource : MetadataSource { + + val session: FirSession + class Class( val klass: FirClass<*>, descriptor: WrappedClassDescriptor - ) : MetadataSource.Class(descriptor), FirMetadataSource + ) : MetadataSource.Class(descriptor), FirMetadataSource { + override val session: FirSession + get() = klass.session + } class Function( val function: FirFunction<*>, descriptor: FunctionDescriptor - ) : MetadataSource.Function(descriptor), FirMetadataSource + ) : MetadataSource.Function(descriptor), FirMetadataSource { + override val session: FirSession + get() = function.session + } class Variable( val variable: FirVariable<*>, descriptor: PropertyDescriptor - ) : MetadataSource.Property(descriptor), FirMetadataSource + ) : MetadataSource.Property(descriptor), FirMetadataSource { + override val session: FirSession + get() = variable.session + } } \ No newline at end of file diff --git a/compiler/ir/backend.jvm/build.gradle.kts b/compiler/ir/backend.jvm/build.gradle.kts index db95227e83e..d19156f18bb 100644 --- a/compiler/ir/backend.jvm/build.gradle.kts +++ b/compiler/ir/backend.jvm/build.gradle.kts @@ -5,6 +5,9 @@ plugins { dependencies { compile(project(":kotlin-annotations-jvm")) + compile(project(":compiler:fir:fir-serialization")) + compile(project(":compiler:fir:fir2ir")) + compile(project(":compiler:fir:fir2ir:jvm-backend")) compile(project(":compiler:backend")) compile(project(":compiler:ir.tree")) compile(project(":compiler:ir.psi2ir")) diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/ClassCodegen.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/ClassCodegen.kt index cb9700073b3..90e1f29b70e 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/ClassCodegen.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/ClassCodegen.kt @@ -16,6 +16,7 @@ import org.jetbrains.kotlin.codegen.serialization.JvmSerializationBindings import org.jetbrains.kotlin.config.LanguageFeature import org.jetbrains.kotlin.descriptors.Modality import org.jetbrains.kotlin.descriptors.Visibility +import org.jetbrains.kotlin.fir.backend.FirMetadataSource import org.jetbrains.kotlin.ir.builders.declarations.buildFun import org.jetbrains.kotlin.ir.declarations.* import org.jetbrains.kotlin.ir.descriptors.WrappedClassDescriptor @@ -204,7 +205,11 @@ abstract class ClassCodegen protected constructor( companion object { fun getOrCreate(irClass: IrClass, context: JvmBackendContext, parentFunction: IrFunction? = null): ClassCodegen = context.classCodegens.getOrPut(irClass) { - DescriptorBasedClassCodegen(irClass, context, parentFunction) + if (irClass.metadata is FirMetadataSource) { + FirBasedClassCodegen(irClass, context, parentFunction) + } else { + DescriptorBasedClassCodegen(irClass, context, parentFunction) + } }.also { assert(parentFunction == null || it.parentFunction == parentFunction) { "inconsistent parent function for ${irClass.render()}:\n" + @@ -217,6 +222,8 @@ abstract class ClassCodegen protected constructor( name.splitToSequence('/').any { identifier -> identifier.any { it in JvmSimpleNameBacktickChecker.INVALID_CHARS } } } + protected abstract fun bindFieldMetadata(field: IrField, fieldType: Type, fieldName: String) + private fun generateField(field: IrField) { if (field.isFakeOverride) return @@ -244,10 +251,7 @@ abstract class ClassCodegen protected constructor( }.genAnnotations(field, fieldType, field.type) } - val descriptor = field.metadata?.descriptor - if (descriptor != null) { - state.globalSerializationBindings.put(JvmSerializationBindings.FIELD_FOR_PROPERTY, descriptor, fieldType to fieldName) - } + bindFieldMetadata(field, fieldType, fieldName) } private val generatedInlineMethods = mutableMapOf() @@ -266,6 +270,8 @@ abstract class ClassCodegen protected constructor( return SMAPAndMethodNode(copy, smap) } + protected abstract fun bindMethodMetadata(method: IrFunction, signature: Method) + private fun generateMethod(method: IrFunction, classSMAP: DefaultSourceMapper) { if (method.isFakeOverride) { jvmSignatureClashDetector.trackFakeOverrideMethod(method) @@ -299,24 +305,7 @@ abstract class ClassCodegen protected constructor( jvmSignatureClashDetector.trackMethod(method, RawSignature(node.name, node.desc, MemberKind.METHOD)) val signature = Method(node.name, node.desc) - when (val metadata = method.metadata) { - is MetadataSource.Property -> { - // We can't check for JvmLoweredDeclarationOrigin.SYNTHETIC_METHOD_FOR_PROPERTY_ANNOTATIONS because for interface methods - // moved to DefaultImpls, origin is changed to DEFAULT_IMPLS - // TODO: fix origin somehow, because otherwise $annotations methods in interfaces also don't have ACC_SYNTHETIC - assert(method.name.asString().endsWith(JvmAbi.ANNOTATED_PROPERTY_METHOD_NAME_SUFFIX)) { method.dump() } - - state.globalSerializationBindings.put( - JvmSerializationBindings.SYNTHETIC_METHOD_FOR_PROPERTY, metadata.descriptor, signature - ) - } - is MetadataSource.Function -> { - visitor.serializationBindings.put(JvmSerializationBindings.METHOD_FOR_FUNCTION, metadata.descriptor, signature) - } - null -> { - } - else -> error("Incorrect metadata source $metadata for:\n${method.dump()}") - } + bindMethodMetadata(method, signature) } private fun generateInnerAndOuterClasses() { diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/DescriptorBasedClassCodegen.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/DescriptorBasedClassCodegen.kt index 77747e91a22..613229eff46 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/DescriptorBasedClassCodegen.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/DescriptorBasedClassCodegen.kt @@ -9,17 +9,19 @@ import org.jetbrains.kotlin.backend.jvm.JvmBackendContext import org.jetbrains.kotlin.backend.jvm.lower.MultifileFacadeFileEntry import org.jetbrains.kotlin.codegen.* import org.jetbrains.kotlin.codegen.binding.CodegenBinding +import org.jetbrains.kotlin.codegen.serialization.JvmSerializationBindings import org.jetbrains.kotlin.codegen.serialization.JvmSerializerExtension import org.jetbrains.kotlin.ir.declarations.IrClass +import org.jetbrains.kotlin.ir.declarations.IrField import org.jetbrains.kotlin.ir.declarations.IrFunction import org.jetbrains.kotlin.ir.declarations.MetadataSource -import org.jetbrains.kotlin.ir.util.fqNameWhenAvailable -import org.jetbrains.kotlin.ir.util.getPackageFragment -import org.jetbrains.kotlin.ir.util.isFileClass -import org.jetbrains.kotlin.ir.util.render +import org.jetbrains.kotlin.ir.util.* +import org.jetbrains.kotlin.load.java.JvmAbi import org.jetbrains.kotlin.load.java.JvmAnnotationNames import org.jetbrains.kotlin.load.kotlin.header.KotlinClassHeader import org.jetbrains.kotlin.serialization.DescriptorSerializer +import org.jetbrains.org.objectweb.asm.Type +import org.jetbrains.org.objectweb.asm.commons.Method class DescriptorBasedClassCodegen internal constructor( irClass: IrClass, @@ -110,4 +112,31 @@ class DescriptorBasedClassCodegen internal constructor( } } + override fun bindMethodMetadata(method: IrFunction, signature: Method) { + when (val metadata = method.metadata) { + is MetadataSource.Property -> { + // We can't check for JvmLoweredDeclarationOrigin.SYNTHETIC_METHOD_FOR_PROPERTY_ANNOTATIONS because for interface methods + // moved to DefaultImpls, origin is changed to DEFAULT_IMPLS + // TODO: fix origin somehow, because otherwise $annotations methods in interfaces also don't have ACC_SYNTHETIC + assert(method.name.asString().endsWith(JvmAbi.ANNOTATED_PROPERTY_METHOD_NAME_SUFFIX)) { method.dump() } + + state.globalSerializationBindings.put( + JvmSerializationBindings.SYNTHETIC_METHOD_FOR_PROPERTY, metadata.descriptor, signature + ) + } + is MetadataSource.Function -> { + visitor.serializationBindings.put(JvmSerializationBindings.METHOD_FOR_FUNCTION, metadata.descriptor, signature) + } + null -> { + } + else -> error("Incorrect metadata source $metadata for:\n${method.dump()}") + } + } + + override fun bindFieldMetadata(field: IrField, fieldType: Type, fieldName: String) { + val descriptor = field.metadata?.descriptor + if (descriptor != null) { + state.globalSerializationBindings.put(JvmSerializationBindings.FIELD_FOR_PROPERTY, descriptor, fieldType to fieldName) + } + } } \ No newline at end of file diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/FirBasedClassCodegen.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/FirBasedClassCodegen.kt new file mode 100644 index 00000000000..fcf713b508d --- /dev/null +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/FirBasedClassCodegen.kt @@ -0,0 +1,142 @@ +/* + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * 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.codegen + +import org.jetbrains.kotlin.backend.jvm.JvmBackendContext +import org.jetbrains.kotlin.backend.jvm.lower.MultifileFacadeFileEntry +import org.jetbrains.kotlin.codegen.* +import org.jetbrains.kotlin.codegen.binding.CodegenBinding +import org.jetbrains.kotlin.codegen.serialization.JvmSerializationBindings +import org.jetbrains.kotlin.fir.backend.FirMetadataSource +import org.jetbrains.kotlin.fir.backend.jvm.FirJvmSerializerExtension +import org.jetbrains.kotlin.fir.declarations.FirAnonymousFunction +import org.jetbrains.kotlin.fir.declarations.FirFunction +import org.jetbrains.kotlin.fir.declarations.FirTypeParameter +import org.jetbrains.kotlin.fir.declarations.builder.buildAnonymousFunction +import org.jetbrains.kotlin.fir.serialization.FirElementSerializer +import org.jetbrains.kotlin.fir.symbols.impl.FirAnonymousFunctionSymbol +import org.jetbrains.kotlin.ir.declarations.IrClass +import org.jetbrains.kotlin.ir.declarations.IrField +import org.jetbrains.kotlin.ir.declarations.IrFunction +import org.jetbrains.kotlin.ir.util.dump +import org.jetbrains.kotlin.ir.util.fqNameWhenAvailable +import org.jetbrains.kotlin.ir.util.isFileClass +import org.jetbrains.kotlin.ir.util.render +import org.jetbrains.kotlin.load.java.JvmAbi +import org.jetbrains.kotlin.load.java.JvmAnnotationNames +import org.jetbrains.kotlin.load.kotlin.header.KotlinClassHeader +import org.jetbrains.kotlin.metadata.jvm.serialization.JvmStringTable +import org.jetbrains.org.objectweb.asm.Type +import org.jetbrains.org.objectweb.asm.commons.Method + +class FirBasedClassCodegen internal constructor( + irClass: IrClass, + context: JvmBackendContext, + parentFunction: IrFunction? = null +) : ClassCodegen(irClass, context, parentFunction) { + + private val session = (irClass.metadata as FirMetadataSource).session + + private val serializerExtension = FirJvmSerializerExtension(session, visitor.serializationBindings, state, typeMapper) + private val serializer: FirElementSerializer? = + when (val metadata = irClass.metadata) { + is FirMetadataSource.Class -> FirElementSerializer.create( + metadata.klass, serializerExtension, (parentClassCodegen as? FirBasedClassCodegen)?.serializer + ) + is FirMetadataSource.Function -> FirElementSerializer.createForLambda(session, serializerExtension) + else -> null + } + + private fun FirFunction<*>.copyToFreeAnonymousFunction(): FirAnonymousFunction { + val function = this + return buildAnonymousFunction { + session = function.session + symbol = FirAnonymousFunctionSymbol() + returnTypeRef = function.returnTypeRef + receiverTypeRef = function.receiverTypeRef + isLambda = false + valueParameters.addAll(function.valueParameters) + typeParameters.addAll(function.typeParameters.filterIsInstance()) + } + } + + override fun generateKotlinMetadataAnnotation() { + + val localDelegatedProperties = (irClass.attributeOwnerId as? IrClass)?.let(context.localDelegatedProperties::get) + if (localDelegatedProperties != null && localDelegatedProperties.isNotEmpty()) { + state.bindingTrace.record( + CodegenBinding.DELEGATED_PROPERTIES_WITH_METADATA, type, localDelegatedProperties.map { it.descriptor } + ) + } + + // TODO: if `-Xmultifile-parts-inherit` is enabled, write the corresponding flag for parts and facades to [Metadata.extraInt]. + var extraFlags = JvmAnnotationNames.METADATA_JVM_IR_FLAG + if (state.isIrWithStableAbi) { + extraFlags += JvmAnnotationNames.METADATA_JVM_IR_STABLE_ABI_FLAG + } + + when (val metadata = irClass.metadata) { + is FirMetadataSource.Class -> { + val classProto = serializer!!.classProto(irClass).build() + writeKotlinMetadata(visitor, state, KotlinClassHeader.Kind.CLASS, extraFlags) { + AsmUtil.writeAnnotationData(it, classProto, serializer.stringTable as JvmStringTable) + } + + assert(irClass !in context.classNameOverride) { + "JvmPackageName is not supported for classes: ${irClass.render()}" + } + } + is FirMetadataSource.Function -> { + val fakeAnonymousFunction = metadata.function.copyToFreeAnonymousFunction() + val functionProto = serializer!!.functionProto(fakeAnonymousFunction)?.build() + writeKotlinMetadata(visitor, state, KotlinClassHeader.Kind.SYNTHETIC_CLASS, extraFlags) { + if (functionProto != null) { + AsmUtil.writeAnnotationData(it, functionProto, serializer.stringTable as JvmStringTable) + } + } + } + else -> { + val entry = irClass.fileParent.fileEntry + if (entry is MultifileFacadeFileEntry) { + val partInternalNames = entry.partFiles.mapNotNull { partFile -> + val fileClass = partFile.declarations.singleOrNull { it.isFileClass } as IrClass? + if (fileClass != null) typeMapper.mapClass(fileClass).internalName else null + } + MultifileClassCodegenImpl.writeMetadata( + visitor, state, extraFlags, partInternalNames, type, irClass.fqNameWhenAvailable!!.parent() + ) + } else { + writeSyntheticClassMetadata(visitor, state) + } + } + } + } + + override fun bindMethodMetadata(method: IrFunction, signature: Method) { + when (val metadata = method.metadata) { + is FirMetadataSource.Variable -> { + // We can't check for JvmLoweredDeclarationOrigin.SYNTHETIC_METHOD_FOR_PROPERTY_ANNOTATIONS because for interface methods + // moved to DefaultImpls, origin is changed to DEFAULT_IMPLS + // TODO: fix origin somehow, because otherwise $annotations methods in interfaces also don't have ACC_SYNTHETIC + assert(method.name.asString().endsWith(JvmAbi.ANNOTATED_PROPERTY_METHOD_NAME_SUFFIX)) { method.dump() } + + state.globalSerializationBindings.put( + FirJvmSerializerExtension.SYNTHETIC_METHOD_FOR_FIR_VARIABLE, metadata.variable, signature + ) + } + is FirMetadataSource.Function -> { + visitor.serializationBindings.put(FirJvmSerializerExtension.METHOD_FOR_FIR_FUNCTION, metadata.function, signature) + } + null -> { + } + else -> error("Incorrect metadata source $metadata for:\n${method.dump()}") + } + } + + override fun bindFieldMetadata(field: IrField, fieldType: Type, fieldName: String) { + // TODO + } +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/callableReference/bound/equals/propertyAccessors.kt b/compiler/testData/codegen/box/callableReference/bound/equals/propertyAccessors.kt index 4fe622c36b9..487119ac7e3 100644 --- a/compiler/testData/codegen/box/callableReference/bound/equals/propertyAccessors.kt +++ b/compiler/testData/codegen/box/callableReference/bound/equals/propertyAccessors.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/callableReference/bound/equals/reflectionReference.kt b/compiler/testData/codegen/box/callableReference/bound/equals/reflectionReference.kt index ccab0ea95b9..920b7169462 100644 --- a/compiler/testData/codegen/box/callableReference/bound/equals/reflectionReference.kt +++ b/compiler/testData/codegen/box/callableReference/bound/equals/reflectionReference.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/fromJava.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/fromJava.kt index 83b8a7d7baf..57964093362 100644 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/fromJava.kt +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/fromJava.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_COROUTINES // WITH_REFLECT diff --git a/compiler/testData/codegen/box/coroutines/tailCallOptimizations/unit/reflection.kt b/compiler/testData/codegen/box/coroutines/tailCallOptimizations/unit/reflection.kt index 435dd54c3eb..22afeeb204b 100644 --- a/compiler/testData/codegen/box/coroutines/tailCallOptimizations/unit/reflection.kt +++ b/compiler/testData/codegen/box/coroutines/tailCallOptimizations/unit/reflection.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // FULL_JDK // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/jvmField/classFieldReflection.kt b/compiler/testData/codegen/box/jvmField/classFieldReflection.kt index c4b776ba76d..3f27028405f 100644 --- a/compiler/testData/codegen/box/jvmField/classFieldReflection.kt +++ b/compiler/testData/codegen/box/jvmField/classFieldReflection.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/reflection/call/bigArity.kt b/compiler/testData/codegen/box/reflection/call/bigArity.kt index 7d324d5291a..43d32de4734 100644 --- a/compiler/testData/codegen/box/reflection/call/bigArity.kt +++ b/compiler/testData/codegen/box/reflection/call/bigArity.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +FunctionTypesWithBigArity -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR, JS, NATIVE // WITH_REFLECT diff --git a/compiler/testData/codegen/box/reflection/call/bound/extensionFunction.kt b/compiler/testData/codegen/box/reflection/call/bound/extensionFunction.kt index 0ca190b3857..993e4820d8d 100644 --- a/compiler/testData/codegen/box/reflection/call/bound/extensionFunction.kt +++ b/compiler/testData/codegen/box/reflection/call/bound/extensionFunction.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/call/bound/innerClassConstructor.kt b/compiler/testData/codegen/box/reflection/call/bound/innerClassConstructor.kt index 899230a80d5..4cc6189a7a1 100644 --- a/compiler/testData/codegen/box/reflection/call/bound/innerClassConstructor.kt +++ b/compiler/testData/codegen/box/reflection/call/bound/innerClassConstructor.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/call/bound/jvmStaticObjectFunction.kt b/compiler/testData/codegen/box/reflection/call/bound/jvmStaticObjectFunction.kt index 65477e8deda..f13eb5e21d0 100644 --- a/compiler/testData/codegen/box/reflection/call/bound/jvmStaticObjectFunction.kt +++ b/compiler/testData/codegen/box/reflection/call/bound/jvmStaticObjectFunction.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/reflection/call/bound/memberFunction.kt b/compiler/testData/codegen/box/reflection/call/bound/memberFunction.kt index df032b843ff..13640defe21 100644 --- a/compiler/testData/codegen/box/reflection/call/bound/memberFunction.kt +++ b/compiler/testData/codegen/box/reflection/call/bound/memberFunction.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/call/bound/objectFunction.kt b/compiler/testData/codegen/box/reflection/call/bound/objectFunction.kt index 43c730fc9c8..643a75801c5 100644 --- a/compiler/testData/codegen/box/reflection/call/bound/objectFunction.kt +++ b/compiler/testData/codegen/box/reflection/call/bound/objectFunction.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/call/exceptionHappened.kt b/compiler/testData/codegen/box/reflection/call/exceptionHappened.kt index 8f9e51506a1..067d8dc1983 100644 --- a/compiler/testData/codegen/box/reflection/call/exceptionHappened.kt +++ b/compiler/testData/codegen/box/reflection/call/exceptionHappened.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/reflection/call/fakeOverride.kt b/compiler/testData/codegen/box/reflection/call/fakeOverride.kt index 732c8aedc3b..2fd25a1894f 100644 --- a/compiler/testData/codegen/box/reflection/call/fakeOverride.kt +++ b/compiler/testData/codegen/box/reflection/call/fakeOverride.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/call/fakeOverrideSubstituted.kt b/compiler/testData/codegen/box/reflection/call/fakeOverrideSubstituted.kt index 9820dc8e166..8751cba2ce9 100644 --- a/compiler/testData/codegen/box/reflection/call/fakeOverrideSubstituted.kt +++ b/compiler/testData/codegen/box/reflection/call/fakeOverrideSubstituted.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/call/inlineClasses/nonOverridingFunOfInlineClass.kt b/compiler/testData/codegen/box/reflection/call/inlineClasses/nonOverridingFunOfInlineClass.kt index 1e02b1767da..6ae6d6551b1 100644 --- a/compiler/testData/codegen/box/reflection/call/inlineClasses/nonOverridingFunOfInlineClass.kt +++ b/compiler/testData/codegen/box/reflection/call/inlineClasses/nonOverridingFunOfInlineClass.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR, JS, NATIVE // WITH_REFLECT import kotlin.test.assertEquals diff --git a/compiler/testData/codegen/box/reflection/call/inlineClasses/overridingFunOfInlineClass.kt b/compiler/testData/codegen/box/reflection/call/inlineClasses/overridingFunOfInlineClass.kt index 6f6e84bf4f8..23e052b337f 100644 --- a/compiler/testData/codegen/box/reflection/call/inlineClasses/overridingFunOfInlineClass.kt +++ b/compiler/testData/codegen/box/reflection/call/inlineClasses/overridingFunOfInlineClass.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR, JS, NATIVE // WITH_REFLECT import kotlin.test.assertEquals diff --git a/compiler/testData/codegen/box/reflection/call/innerClassConstructor.kt b/compiler/testData/codegen/box/reflection/call/innerClassConstructor.kt index f7ae14ee386..287fcec73c1 100644 --- a/compiler/testData/codegen/box/reflection/call/innerClassConstructor.kt +++ b/compiler/testData/codegen/box/reflection/call/innerClassConstructor.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/call/jvmStatic.kt b/compiler/testData/codegen/box/reflection/call/jvmStatic.kt index b79b715c95c..7a8d2f62e0c 100644 --- a/compiler/testData/codegen/box/reflection/call/jvmStatic.kt +++ b/compiler/testData/codegen/box/reflection/call/jvmStatic.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/reflection/call/localClassMember.kt b/compiler/testData/codegen/box/reflection/call/localClassMember.kt index c02b3301972..d5fa63e4962 100644 --- a/compiler/testData/codegen/box/reflection/call/localClassMember.kt +++ b/compiler/testData/codegen/box/reflection/call/localClassMember.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/call/memberOfGenericClass.kt b/compiler/testData/codegen/box/reflection/call/memberOfGenericClass.kt index 0ce1d31486f..58f6e2f310c 100644 --- a/compiler/testData/codegen/box/reflection/call/memberOfGenericClass.kt +++ b/compiler/testData/codegen/box/reflection/call/memberOfGenericClass.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/call/returnUnit.kt b/compiler/testData/codegen/box/reflection/call/returnUnit.kt index f1ff2038b9f..21276a25a25 100644 --- a/compiler/testData/codegen/box/reflection/call/returnUnit.kt +++ b/compiler/testData/codegen/box/reflection/call/returnUnit.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/reflection/call/simpleMemberFunction.kt b/compiler/testData/codegen/box/reflection/call/simpleMemberFunction.kt index b4fe1aa7fbb..9d5af677b80 100644 --- a/compiler/testData/codegen/box/reflection/call/simpleMemberFunction.kt +++ b/compiler/testData/codegen/box/reflection/call/simpleMemberFunction.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/call/simpleTopLevelFunctions.kt b/compiler/testData/codegen/box/reflection/call/simpleTopLevelFunctions.kt index dafec8b6170..6ca90853588 100644 --- a/compiler/testData/codegen/box/reflection/call/simpleTopLevelFunctions.kt +++ b/compiler/testData/codegen/box/reflection/call/simpleTopLevelFunctions.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/callBy/boundExtensionFunction.kt b/compiler/testData/codegen/box/reflection/callBy/boundExtensionFunction.kt index 684043ab797..1f00cd8d0c0 100644 --- a/compiler/testData/codegen/box/reflection/callBy/boundExtensionFunction.kt +++ b/compiler/testData/codegen/box/reflection/callBy/boundExtensionFunction.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/callBy/boundJvmStaticInObject.kt b/compiler/testData/codegen/box/reflection/callBy/boundJvmStaticInObject.kt index 42b762bda69..6309c443e5e 100644 --- a/compiler/testData/codegen/box/reflection/callBy/boundJvmStaticInObject.kt +++ b/compiler/testData/codegen/box/reflection/callBy/boundJvmStaticInObject.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/reflection/callBy/companionObject.kt b/compiler/testData/codegen/box/reflection/callBy/companionObject.kt index 4b2ea61f34a..746709a800f 100644 --- a/compiler/testData/codegen/box/reflection/callBy/companionObject.kt +++ b/compiler/testData/codegen/box/reflection/callBy/companionObject.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/callBy/defaultAndNonDefaultIntertwined.kt b/compiler/testData/codegen/box/reflection/callBy/defaultAndNonDefaultIntertwined.kt index e991d832dd9..96f00614caf 100644 --- a/compiler/testData/codegen/box/reflection/callBy/defaultAndNonDefaultIntertwined.kt +++ b/compiler/testData/codegen/box/reflection/callBy/defaultAndNonDefaultIntertwined.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/callBy/defaultInSuperClass.kt b/compiler/testData/codegen/box/reflection/callBy/defaultInSuperClass.kt index 404637f4706..00921823d45 100644 --- a/compiler/testData/codegen/box/reflection/callBy/defaultInSuperClass.kt +++ b/compiler/testData/codegen/box/reflection/callBy/defaultInSuperClass.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR, JS, NATIVE // WITH_REFLECT diff --git a/compiler/testData/codegen/box/reflection/callBy/defaultInSuperInterface.kt b/compiler/testData/codegen/box/reflection/callBy/defaultInSuperInterface.kt index cbca2d9400b..70bad880ed3 100644 --- a/compiler/testData/codegen/box/reflection/callBy/defaultInSuperInterface.kt +++ b/compiler/testData/codegen/box/reflection/callBy/defaultInSuperInterface.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR, JS, NATIVE // WITH_REFLECT diff --git a/compiler/testData/codegen/box/reflection/callBy/emptyVarArg.kt b/compiler/testData/codegen/box/reflection/callBy/emptyVarArg.kt index 5132b3783d4..4a2417d8018 100644 --- a/compiler/testData/codegen/box/reflection/callBy/emptyVarArg.kt +++ b/compiler/testData/codegen/box/reflection/callBy/emptyVarArg.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/callBy/extensionFunction.kt b/compiler/testData/codegen/box/reflection/callBy/extensionFunction.kt index 7c5e7a837a9..cd6f8ad8c86 100644 --- a/compiler/testData/codegen/box/reflection/callBy/extensionFunction.kt +++ b/compiler/testData/codegen/box/reflection/callBy/extensionFunction.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/callBy/jvmStaticInCompanionObject.kt b/compiler/testData/codegen/box/reflection/callBy/jvmStaticInCompanionObject.kt index af6295a5815..9aade3091ee 100644 --- a/compiler/testData/codegen/box/reflection/callBy/jvmStaticInCompanionObject.kt +++ b/compiler/testData/codegen/box/reflection/callBy/jvmStaticInCompanionObject.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/reflection/callBy/jvmStaticInObject.kt b/compiler/testData/codegen/box/reflection/callBy/jvmStaticInObject.kt index c857a84da23..603a1f086c2 100644 --- a/compiler/testData/codegen/box/reflection/callBy/jvmStaticInObject.kt +++ b/compiler/testData/codegen/box/reflection/callBy/jvmStaticInObject.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/reflection/callBy/manyArgumentsNoneDefaultFunction.kt b/compiler/testData/codegen/box/reflection/callBy/manyArgumentsNoneDefaultFunction.kt index d5a0f08118d..c53a68ff5ac 100644 --- a/compiler/testData/codegen/box/reflection/callBy/manyArgumentsNoneDefaultFunction.kt +++ b/compiler/testData/codegen/box/reflection/callBy/manyArgumentsNoneDefaultFunction.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JS, NATIVE // WITH_REFLECT diff --git a/compiler/testData/codegen/box/reflection/callBy/manyArgumentsOnlyOneDefault.kt b/compiler/testData/codegen/box/reflection/callBy/manyArgumentsOnlyOneDefault.kt index 7af6d7ad381..f60b4650998 100644 --- a/compiler/testData/codegen/box/reflection/callBy/manyArgumentsOnlyOneDefault.kt +++ b/compiler/testData/codegen/box/reflection/callBy/manyArgumentsOnlyOneDefault.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/callBy/manyMaskArguments.kt b/compiler/testData/codegen/box/reflection/callBy/manyMaskArguments.kt index 3662ea13bab..7c2ff687523 100644 --- a/compiler/testData/codegen/box/reflection/callBy/manyMaskArguments.kt +++ b/compiler/testData/codegen/box/reflection/callBy/manyMaskArguments.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/callBy/nonDefaultParameterOmitted.kt b/compiler/testData/codegen/box/reflection/callBy/nonDefaultParameterOmitted.kt index df5405f9b0d..51a03692991 100644 --- a/compiler/testData/codegen/box/reflection/callBy/nonDefaultParameterOmitted.kt +++ b/compiler/testData/codegen/box/reflection/callBy/nonDefaultParameterOmitted.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/callBy/nullValue.kt b/compiler/testData/codegen/box/reflection/callBy/nullValue.kt index e92b131275d..1761f04fe12 100644 --- a/compiler/testData/codegen/box/reflection/callBy/nullValue.kt +++ b/compiler/testData/codegen/box/reflection/callBy/nullValue.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/callBy/ordinaryMethodIsInvokedWhenNoDefaultValuesAreUsed.kt b/compiler/testData/codegen/box/reflection/callBy/ordinaryMethodIsInvokedWhenNoDefaultValuesAreUsed.kt index 4b7cff0a506..dcbeb81c04f 100644 --- a/compiler/testData/codegen/box/reflection/callBy/ordinaryMethodIsInvokedWhenNoDefaultValuesAreUsed.kt +++ b/compiler/testData/codegen/box/reflection/callBy/ordinaryMethodIsInvokedWhenNoDefaultValuesAreUsed.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/callBy/primitiveDefaultValues.kt b/compiler/testData/codegen/box/reflection/callBy/primitiveDefaultValues.kt index dee11c375d5..5f74dfabb01 100644 --- a/compiler/testData/codegen/box/reflection/callBy/primitiveDefaultValues.kt +++ b/compiler/testData/codegen/box/reflection/callBy/primitiveDefaultValues.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/callBy/privateMemberFunction.kt b/compiler/testData/codegen/box/reflection/callBy/privateMemberFunction.kt index ff7ee83ea00..e9c469c00ed 100644 --- a/compiler/testData/codegen/box/reflection/callBy/privateMemberFunction.kt +++ b/compiler/testData/codegen/box/reflection/callBy/privateMemberFunction.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/reflection/callBy/simpleMemberFunciton.kt b/compiler/testData/codegen/box/reflection/callBy/simpleMemberFunciton.kt index 3fc58129f24..c85c0fdaaf7 100644 --- a/compiler/testData/codegen/box/reflection/callBy/simpleMemberFunciton.kt +++ b/compiler/testData/codegen/box/reflection/callBy/simpleMemberFunciton.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/callBy/simpleTopLevelFunction.kt b/compiler/testData/codegen/box/reflection/callBy/simpleTopLevelFunction.kt index 1a6f130feb4..8a997ef7ade 100644 --- a/compiler/testData/codegen/box/reflection/callBy/simpleTopLevelFunction.kt +++ b/compiler/testData/codegen/box/reflection/callBy/simpleTopLevelFunction.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/classes/companionObject.kt b/compiler/testData/codegen/box/reflection/classes/companionObject.kt index 9d27882e34b..d35ca4b9ac3 100644 --- a/compiler/testData/codegen/box/reflection/classes/companionObject.kt +++ b/compiler/testData/codegen/box/reflection/classes/companionObject.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/classes/createInstance.kt b/compiler/testData/codegen/box/reflection/classes/createInstance.kt index 01719fe5040..1948fd22331 100644 --- a/compiler/testData/codegen/box/reflection/classes/createInstance.kt +++ b/compiler/testData/codegen/box/reflection/classes/createInstance.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/classes/declaredMembers.kt b/compiler/testData/codegen/box/reflection/classes/declaredMembers.kt index 086c7fb9f9a..70a22cfb28c 100644 --- a/compiler/testData/codegen/box/reflection/classes/declaredMembers.kt +++ b/compiler/testData/codegen/box/reflection/classes/declaredMembers.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/reflection/classes/objectInstance.kt b/compiler/testData/codegen/box/reflection/classes/objectInstance.kt index d431602d50e..5571440a8fd 100644 --- a/compiler/testData/codegen/box/reflection/classes/objectInstance.kt +++ b/compiler/testData/codegen/box/reflection/classes/objectInstance.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/classes/sealedSubclasses.kt b/compiler/testData/codegen/box/reflection/classes/sealedSubclasses.kt index db9bb29b737..79950206131 100644 --- a/compiler/testData/codegen/box/reflection/classes/sealedSubclasses.kt +++ b/compiler/testData/codegen/box/reflection/classes/sealedSubclasses.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/reflection/constructors/annotationClass.kt b/compiler/testData/codegen/box/reflection/constructors/annotationClass.kt index 7bae13f31c3..5d41c0ce77b 100644 --- a/compiler/testData/codegen/box/reflection/constructors/annotationClass.kt +++ b/compiler/testData/codegen/box/reflection/constructors/annotationClass.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/constructors/classesWithoutConstructors.kt b/compiler/testData/codegen/box/reflection/constructors/classesWithoutConstructors.kt index df72cbeaaec..6e700336a5d 100644 --- a/compiler/testData/codegen/box/reflection/constructors/classesWithoutConstructors.kt +++ b/compiler/testData/codegen/box/reflection/constructors/classesWithoutConstructors.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/constructors/simpleGetConstructors.kt b/compiler/testData/codegen/box/reflection/constructors/simpleGetConstructors.kt index 40aabe9fae2..b18d25f6251 100644 --- a/compiler/testData/codegen/box/reflection/constructors/simpleGetConstructors.kt +++ b/compiler/testData/codegen/box/reflection/constructors/simpleGetConstructors.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/reflection/createAnnotation/annotationType.kt b/compiler/testData/codegen/box/reflection/createAnnotation/annotationType.kt index 6898da58ff2..0b41d62bf80 100644 --- a/compiler/testData/codegen/box/reflection/createAnnotation/annotationType.kt +++ b/compiler/testData/codegen/box/reflection/createAnnotation/annotationType.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/createAnnotation/parameterNamedEquals.kt b/compiler/testData/codegen/box/reflection/createAnnotation/parameterNamedEquals.kt index 8539812183d..c4408c94458 100644 --- a/compiler/testData/codegen/box/reflection/createAnnotation/parameterNamedEquals.kt +++ b/compiler/testData/codegen/box/reflection/createAnnotation/parameterNamedEquals.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/functions/declaredVsInheritedFunctions.kt b/compiler/testData/codegen/box/reflection/functions/declaredVsInheritedFunctions.kt index 29e2f4e8df6..1c5cd723b1f 100644 --- a/compiler/testData/codegen/box/reflection/functions/declaredVsInheritedFunctions.kt +++ b/compiler/testData/codegen/box/reflection/functions/declaredVsInheritedFunctions.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/reflection/functions/genericOverriddenFunction.kt b/compiler/testData/codegen/box/reflection/functions/genericOverriddenFunction.kt index 20fa9318851..ad23d520c8b 100644 --- a/compiler/testData/codegen/box/reflection/functions/genericOverriddenFunction.kt +++ b/compiler/testData/codegen/box/reflection/functions/genericOverriddenFunction.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/functions/instanceOfFunction.kt b/compiler/testData/codegen/box/reflection/functions/instanceOfFunction.kt index f1a9f6146c4..42592cba9c9 100644 --- a/compiler/testData/codegen/box/reflection/functions/instanceOfFunction.kt +++ b/compiler/testData/codegen/box/reflection/functions/instanceOfFunction.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/reflection/functions/isAccessibleOnAllMembers.kt b/compiler/testData/codegen/box/reflection/functions/isAccessibleOnAllMembers.kt index e386acb5c87..335966a4b5c 100644 --- a/compiler/testData/codegen/box/reflection/functions/isAccessibleOnAllMembers.kt +++ b/compiler/testData/codegen/box/reflection/functions/isAccessibleOnAllMembers.kt @@ -1,5 +1,4 @@ // TARGET_BACKEND: JVM -// IGNORE_BACKEND_FIR: JVM_IR // WITH_REFLECT // SKIP_JDK6 diff --git a/compiler/testData/codegen/box/reflection/functions/privateMemberFunction.kt b/compiler/testData/codegen/box/reflection/functions/privateMemberFunction.kt index 6a4f5be9dbd..3bafea54946 100644 --- a/compiler/testData/codegen/box/reflection/functions/privateMemberFunction.kt +++ b/compiler/testData/codegen/box/reflection/functions/privateMemberFunction.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/reflection/functions/simpleGetFunctions.kt b/compiler/testData/codegen/box/reflection/functions/simpleGetFunctions.kt index 48bfe6f1f2c..9d902d9e63e 100644 --- a/compiler/testData/codegen/box/reflection/functions/simpleGetFunctions.kt +++ b/compiler/testData/codegen/box/reflection/functions/simpleGetFunctions.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/mapping/constructor.kt b/compiler/testData/codegen/box/reflection/mapping/constructor.kt index 2781f3c95a1..ab53ef509ab 100644 --- a/compiler/testData/codegen/box/reflection/mapping/constructor.kt +++ b/compiler/testData/codegen/box/reflection/mapping/constructor.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/reflection/mapping/constructorWithInlineClassParameters.kt b/compiler/testData/codegen/box/reflection/mapping/constructorWithInlineClassParameters.kt index 139a0001955..2b38cc4e70e 100644 --- a/compiler/testData/codegen/box/reflection/mapping/constructorWithInlineClassParameters.kt +++ b/compiler/testData/codegen/box/reflection/mapping/constructorWithInlineClassParameters.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT import kotlin.reflect.full.primaryConstructor diff --git a/compiler/testData/codegen/box/reflection/mapping/fakeOverrides/javaMethod.kt b/compiler/testData/codegen/box/reflection/mapping/fakeOverrides/javaMethod.kt index 4aa2feaf9a5..fc7e3eadbc4 100644 --- a/compiler/testData/codegen/box/reflection/mapping/fakeOverrides/javaMethod.kt +++ b/compiler/testData/codegen/box/reflection/mapping/fakeOverrides/javaMethod.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/reflection/mapping/functions.kt b/compiler/testData/codegen/box/reflection/mapping/functions.kt index 557eba90f2b..ee73ea49037 100644 --- a/compiler/testData/codegen/box/reflection/mapping/functions.kt +++ b/compiler/testData/codegen/box/reflection/mapping/functions.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/reflection/mapping/methodsFromObject.kt b/compiler/testData/codegen/box/reflection/mapping/methodsFromObject.kt index 40fe435d5e0..b3198acc7c3 100644 --- a/compiler/testData/codegen/box/reflection/mapping/methodsFromObject.kt +++ b/compiler/testData/codegen/box/reflection/mapping/methodsFromObject.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/reflection/mapping/methodsFromSuperInterface.kt b/compiler/testData/codegen/box/reflection/mapping/methodsFromSuperInterface.kt index ea0eebbc5c1..cf2876fc45c 100644 --- a/compiler/testData/codegen/box/reflection/mapping/methodsFromSuperInterface.kt +++ b/compiler/testData/codegen/box/reflection/mapping/methodsFromSuperInterface.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT package test diff --git a/compiler/testData/codegen/box/reflection/mapping/openSuspendFun.kt b/compiler/testData/codegen/box/reflection/mapping/openSuspendFun.kt index 9f81e0d342b..cda061f8eff 100644 --- a/compiler/testData/codegen/box/reflection/mapping/openSuspendFun.kt +++ b/compiler/testData/codegen/box/reflection/mapping/openSuspendFun.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // WITH_REFLECT // TARGET_BACKEND: JVM diff --git a/compiler/testData/codegen/box/reflection/mapping/topLevelFunctionOtherFile.kt b/compiler/testData/codegen/box/reflection/mapping/topLevelFunctionOtherFile.kt index c9aaaddcadd..d9c37acb38e 100644 --- a/compiler/testData/codegen/box/reflection/mapping/topLevelFunctionOtherFile.kt +++ b/compiler/testData/codegen/box/reflection/mapping/topLevelFunctionOtherFile.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/reflection/mapping/types/constructors.kt b/compiler/testData/codegen/box/reflection/mapping/types/constructors.kt index 2c5837b08de..628e1b38c81 100644 --- a/compiler/testData/codegen/box/reflection/mapping/types/constructors.kt +++ b/compiler/testData/codegen/box/reflection/mapping/types/constructors.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/reflection/mapping/types/genericArrayElementType.kt b/compiler/testData/codegen/box/reflection/mapping/types/genericArrayElementType.kt index 21e670e903c..d8c06d8cfcd 100644 --- a/compiler/testData/codegen/box/reflection/mapping/types/genericArrayElementType.kt +++ b/compiler/testData/codegen/box/reflection/mapping/types/genericArrayElementType.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/reflection/mapping/types/inlineClassInSignature.kt b/compiler/testData/codegen/box/reflection/mapping/types/inlineClassInSignature.kt index cb90829f883..d9f90b9d4d7 100644 --- a/compiler/testData/codegen/box/reflection/mapping/types/inlineClassInSignature.kt +++ b/compiler/testData/codegen/box/reflection/mapping/types/inlineClassInSignature.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/reflection/mapping/types/innerGenericTypeArgument.kt b/compiler/testData/codegen/box/reflection/mapping/types/innerGenericTypeArgument.kt index e90a186ca37..785ec345c92 100644 --- a/compiler/testData/codegen/box/reflection/mapping/types/innerGenericTypeArgument.kt +++ b/compiler/testData/codegen/box/reflection/mapping/types/innerGenericTypeArgument.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // "IOOBE: Invalid index 4, size is 4" for java.lang.reflect.ParameterizedType on Android diff --git a/compiler/testData/codegen/box/reflection/mapping/types/memberFunctions.kt b/compiler/testData/codegen/box/reflection/mapping/types/memberFunctions.kt index b09d001001f..9d6996b5591 100644 --- a/compiler/testData/codegen/box/reflection/mapping/types/memberFunctions.kt +++ b/compiler/testData/codegen/box/reflection/mapping/types/memberFunctions.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/reflection/mapping/types/overrideAnyWithPrimitive.kt b/compiler/testData/codegen/box/reflection/mapping/types/overrideAnyWithPrimitive.kt index cfeadc1dfc8..23617427cdc 100644 --- a/compiler/testData/codegen/box/reflection/mapping/types/overrideAnyWithPrimitive.kt +++ b/compiler/testData/codegen/box/reflection/mapping/types/overrideAnyWithPrimitive.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/reflection/mapping/types/parameterizedTypeArgument.kt b/compiler/testData/codegen/box/reflection/mapping/types/parameterizedTypeArgument.kt index cabb49bcede..e4d47a93bbf 100644 --- a/compiler/testData/codegen/box/reflection/mapping/types/parameterizedTypeArgument.kt +++ b/compiler/testData/codegen/box/reflection/mapping/types/parameterizedTypeArgument.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/reflection/mapping/types/suspendFun.kt b/compiler/testData/codegen/box/reflection/mapping/types/suspendFun.kt index 01e81caabdd..e44dc8942a1 100644 --- a/compiler/testData/codegen/box/reflection/mapping/types/suspendFun.kt +++ b/compiler/testData/codegen/box/reflection/mapping/types/suspendFun.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/reflection/mapping/types/topLevelFunctions.kt b/compiler/testData/codegen/box/reflection/mapping/types/topLevelFunctions.kt index 48da60c7e8d..5333883f794 100644 --- a/compiler/testData/codegen/box/reflection/mapping/types/topLevelFunctions.kt +++ b/compiler/testData/codegen/box/reflection/mapping/types/topLevelFunctions.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/reflection/mapping/types/typeParameters.kt b/compiler/testData/codegen/box/reflection/mapping/types/typeParameters.kt index a25e8d87c76..6bae2b0804f 100644 --- a/compiler/testData/codegen/box/reflection/mapping/types/typeParameters.kt +++ b/compiler/testData/codegen/box/reflection/mapping/types/typeParameters.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/reflection/mapping/types/withNullability.kt b/compiler/testData/codegen/box/reflection/mapping/types/withNullability.kt index 28658a2c990..f55c3bf041b 100644 --- a/compiler/testData/codegen/box/reflection/mapping/types/withNullability.kt +++ b/compiler/testData/codegen/box/reflection/mapping/types/withNullability.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/reflection/methodsFromAny/callableReferencesEqualToCallablesFromAPI.kt b/compiler/testData/codegen/box/reflection/methodsFromAny/callableReferencesEqualToCallablesFromAPI.kt index 57ec3b19749..f62e4b1cfa1 100644 --- a/compiler/testData/codegen/box/reflection/methodsFromAny/callableReferencesEqualToCallablesFromAPI.kt +++ b/compiler/testData/codegen/box/reflection/methodsFromAny/callableReferencesEqualToCallablesFromAPI.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/methodsFromAny/fakeOverrideEqualsHashCode.kt b/compiler/testData/codegen/box/reflection/methodsFromAny/fakeOverrideEqualsHashCode.kt index 6a3ab257587..d6b78b8c0ce 100644 --- a/compiler/testData/codegen/box/reflection/methodsFromAny/fakeOverrideEqualsHashCode.kt +++ b/compiler/testData/codegen/box/reflection/methodsFromAny/fakeOverrideEqualsHashCode.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR, JS, NATIVE // WITH_REFLECT diff --git a/compiler/testData/codegen/box/reflection/methodsFromAny/fakeOverrideToString.kt b/compiler/testData/codegen/box/reflection/methodsFromAny/fakeOverrideToString.kt index a91dd266c75..200837cf811 100644 --- a/compiler/testData/codegen/box/reflection/methodsFromAny/fakeOverrideToString.kt +++ b/compiler/testData/codegen/box/reflection/methodsFromAny/fakeOverrideToString.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR, JS, NATIVE // WITH_REFLECT package test diff --git a/compiler/testData/codegen/box/reflection/methodsFromAny/memberExtensionToString.kt b/compiler/testData/codegen/box/reflection/methodsFromAny/memberExtensionToString.kt index ad7a6d97ab2..5ba0a75207e 100644 --- a/compiler/testData/codegen/box/reflection/methodsFromAny/memberExtensionToString.kt +++ b/compiler/testData/codegen/box/reflection/methodsFromAny/memberExtensionToString.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/methodsFromAny/parametersEqualsHashCode.kt b/compiler/testData/codegen/box/reflection/methodsFromAny/parametersEqualsHashCode.kt index 7bb88c990b5..2301b5c12c1 100644 --- a/compiler/testData/codegen/box/reflection/methodsFromAny/parametersEqualsHashCode.kt +++ b/compiler/testData/codegen/box/reflection/methodsFromAny/parametersEqualsHashCode.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/methodsFromAny/parametersToString.kt b/compiler/testData/codegen/box/reflection/methodsFromAny/parametersToString.kt index 7c30d7e9386..f6ce7aa383c 100644 --- a/compiler/testData/codegen/box/reflection/methodsFromAny/parametersToString.kt +++ b/compiler/testData/codegen/box/reflection/methodsFromAny/parametersToString.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/methodsFromAny/typeEqualsHashCode.kt b/compiler/testData/codegen/box/reflection/methodsFromAny/typeEqualsHashCode.kt index 76cf6ad4978..8ee3fc10e14 100644 --- a/compiler/testData/codegen/box/reflection/methodsFromAny/typeEqualsHashCode.kt +++ b/compiler/testData/codegen/box/reflection/methodsFromAny/typeEqualsHashCode.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/methodsFromAny/typeToString.kt b/compiler/testData/codegen/box/reflection/methodsFromAny/typeToString.kt index 53e0b8d43cb..b4ac526386a 100644 --- a/compiler/testData/codegen/box/reflection/methodsFromAny/typeToString.kt +++ b/compiler/testData/codegen/box/reflection/methodsFromAny/typeToString.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/methodsFromAny/typeToStringInnerGeneric.kt b/compiler/testData/codegen/box/reflection/methodsFromAny/typeToStringInnerGeneric.kt index a37f07a6369..04dcb2a4eb2 100644 --- a/compiler/testData/codegen/box/reflection/methodsFromAny/typeToStringInnerGeneric.kt +++ b/compiler/testData/codegen/box/reflection/methodsFromAny/typeToStringInnerGeneric.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/modifiers/callableModality.kt b/compiler/testData/codegen/box/reflection/modifiers/callableModality.kt index b277b0db300..0f1a74fde87 100644 --- a/compiler/testData/codegen/box/reflection/modifiers/callableModality.kt +++ b/compiler/testData/codegen/box/reflection/modifiers/callableModality.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/modifiers/callableVisibility.kt b/compiler/testData/codegen/box/reflection/modifiers/callableVisibility.kt index 1c14f1324ae..1dc5d2062e6 100644 --- a/compiler/testData/codegen/box/reflection/modifiers/callableVisibility.kt +++ b/compiler/testData/codegen/box/reflection/modifiers/callableVisibility.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/modifiers/classModality.kt b/compiler/testData/codegen/box/reflection/modifiers/classModality.kt index eed7074f306..1a0296ded28 100644 --- a/compiler/testData/codegen/box/reflection/modifiers/classModality.kt +++ b/compiler/testData/codegen/box/reflection/modifiers/classModality.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/modifiers/classVisibility.kt b/compiler/testData/codegen/box/reflection/modifiers/classVisibility.kt index 597c662f67f..ecfaee7b75d 100644 --- a/compiler/testData/codegen/box/reflection/modifiers/classVisibility.kt +++ b/compiler/testData/codegen/box/reflection/modifiers/classVisibility.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/modifiers/typeParameters.kt b/compiler/testData/codegen/box/reflection/modifiers/typeParameters.kt index 0aad2649163..cb8b6a17210 100644 --- a/compiler/testData/codegen/box/reflection/modifiers/typeParameters.kt +++ b/compiler/testData/codegen/box/reflection/modifiers/typeParameters.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/multifileClasses/callFunctionsInMultifileClass.kt b/compiler/testData/codegen/box/reflection/multifileClasses/callFunctionsInMultifileClass.kt index ecd42338f93..2bcd9c82c3a 100644 --- a/compiler/testData/codegen/box/reflection/multifileClasses/callFunctionsInMultifileClass.kt +++ b/compiler/testData/codegen/box/reflection/multifileClasses/callFunctionsInMultifileClass.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT // FILE: Test1.kt diff --git a/compiler/testData/codegen/box/reflection/parameters/bigArity.kt b/compiler/testData/codegen/box/reflection/parameters/bigArity.kt index fff965cbe0e..c22d4cb175b 100644 --- a/compiler/testData/codegen/box/reflection/parameters/bigArity.kt +++ b/compiler/testData/codegen/box/reflection/parameters/bigArity.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +FunctionTypesWithBigArity -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR, JS, NATIVE // WITH_REFLECT diff --git a/compiler/testData/codegen/box/reflection/parameters/findParameterByName.kt b/compiler/testData/codegen/box/reflection/parameters/findParameterByName.kt index 02ef4c58b26..855595efa7a 100644 --- a/compiler/testData/codegen/box/reflection/parameters/findParameterByName.kt +++ b/compiler/testData/codegen/box/reflection/parameters/findParameterByName.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/reflection/parameters/functionParameterNameAndIndex.kt b/compiler/testData/codegen/box/reflection/parameters/functionParameterNameAndIndex.kt index d6959bd5321..a8f97776332 100644 --- a/compiler/testData/codegen/box/reflection/parameters/functionParameterNameAndIndex.kt +++ b/compiler/testData/codegen/box/reflection/parameters/functionParameterNameAndIndex.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/parameters/isMarkedNullable.kt b/compiler/testData/codegen/box/reflection/parameters/isMarkedNullable.kt index 81f279a0d83..24c640b8311 100644 --- a/compiler/testData/codegen/box/reflection/parameters/isMarkedNullable.kt +++ b/compiler/testData/codegen/box/reflection/parameters/isMarkedNullable.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/parameters/isOptional.kt b/compiler/testData/codegen/box/reflection/parameters/isOptional.kt index 74d14e5f508..3acabc622c4 100644 --- a/compiler/testData/codegen/box/reflection/parameters/isOptional.kt +++ b/compiler/testData/codegen/box/reflection/parameters/isOptional.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/properties/accessors/accessorNames.kt b/compiler/testData/codegen/box/reflection/properties/accessors/accessorNames.kt index b251623dfde..aa56037c981 100644 --- a/compiler/testData/codegen/box/reflection/properties/accessors/accessorNames.kt +++ b/compiler/testData/codegen/box/reflection/properties/accessors/accessorNames.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/properties/allVsDeclared.kt b/compiler/testData/codegen/box/reflection/properties/allVsDeclared.kt index d6cd4e94b93..fdf521eab76 100644 --- a/compiler/testData/codegen/box/reflection/properties/allVsDeclared.kt +++ b/compiler/testData/codegen/box/reflection/properties/allVsDeclared.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/properties/declaredVsInheritedProperties.kt b/compiler/testData/codegen/box/reflection/properties/declaredVsInheritedProperties.kt index ebcb333fe89..6409aaee666 100644 --- a/compiler/testData/codegen/box/reflection/properties/declaredVsInheritedProperties.kt +++ b/compiler/testData/codegen/box/reflection/properties/declaredVsInheritedProperties.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/reflection/properties/fakeOverridesInSubclass.kt b/compiler/testData/codegen/box/reflection/properties/fakeOverridesInSubclass.kt index 7c412adb8e9..ef694cf5c36 100644 --- a/compiler/testData/codegen/box/reflection/properties/fakeOverridesInSubclass.kt +++ b/compiler/testData/codegen/box/reflection/properties/fakeOverridesInSubclass.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/properties/genericClassLiteralPropertyReceiverIsStar.kt b/compiler/testData/codegen/box/reflection/properties/genericClassLiteralPropertyReceiverIsStar.kt index d9b2b2acda8..fba6100a0cd 100644 --- a/compiler/testData/codegen/box/reflection/properties/genericClassLiteralPropertyReceiverIsStar.kt +++ b/compiler/testData/codegen/box/reflection/properties/genericClassLiteralPropertyReceiverIsStar.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/properties/genericOverriddenProperty.kt b/compiler/testData/codegen/box/reflection/properties/genericOverriddenProperty.kt index c05d8ee482d..f2bfcf46290 100644 --- a/compiler/testData/codegen/box/reflection/properties/genericOverriddenProperty.kt +++ b/compiler/testData/codegen/box/reflection/properties/genericOverriddenProperty.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/properties/getDelegate/fakeOverride.kt b/compiler/testData/codegen/box/reflection/properties/getDelegate/fakeOverride.kt index 32fa910156e..015613b9e57 100644 --- a/compiler/testData/codegen/box/reflection/properties/getDelegate/fakeOverride.kt +++ b/compiler/testData/codegen/box/reflection/properties/getDelegate/fakeOverride.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/reflection/properties/getExtensionPropertiesMutableVsReadonly.kt b/compiler/testData/codegen/box/reflection/properties/getExtensionPropertiesMutableVsReadonly.kt index c54e4b69042..24344043b3e 100644 --- a/compiler/testData/codegen/box/reflection/properties/getExtensionPropertiesMutableVsReadonly.kt +++ b/compiler/testData/codegen/box/reflection/properties/getExtensionPropertiesMutableVsReadonly.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/properties/getPropertiesMutableVsReadonly.kt b/compiler/testData/codegen/box/reflection/properties/getPropertiesMutableVsReadonly.kt index 0677af4ce9b..a972e386396 100644 --- a/compiler/testData/codegen/box/reflection/properties/getPropertiesMutableVsReadonly.kt +++ b/compiler/testData/codegen/box/reflection/properties/getPropertiesMutableVsReadonly.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/properties/invokeKProperty.kt b/compiler/testData/codegen/box/reflection/properties/invokeKProperty.kt index ffbd67dce95..64d5c20d1b0 100644 --- a/compiler/testData/codegen/box/reflection/properties/invokeKProperty.kt +++ b/compiler/testData/codegen/box/reflection/properties/invokeKProperty.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/properties/jvmField/annotationCompanionWithAnnotation.kt b/compiler/testData/codegen/box/reflection/properties/jvmField/annotationCompanionWithAnnotation.kt index 5a3c00d8602..ef01949a38f 100644 --- a/compiler/testData/codegen/box/reflection/properties/jvmField/annotationCompanionWithAnnotation.kt +++ b/compiler/testData/codegen/box/reflection/properties/jvmField/annotationCompanionWithAnnotation.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/reflection/properties/jvmField/interfaceCompanion.kt b/compiler/testData/codegen/box/reflection/properties/jvmField/interfaceCompanion.kt index 375f8e1b22a..1e99f213aab 100644 --- a/compiler/testData/codegen/box/reflection/properties/jvmField/interfaceCompanion.kt +++ b/compiler/testData/codegen/box/reflection/properties/jvmField/interfaceCompanion.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +JvmFieldInInterface -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/reflection/properties/jvmField/interfaceCompanionWithAnnotation.kt b/compiler/testData/codegen/box/reflection/properties/jvmField/interfaceCompanionWithAnnotation.kt index 999808471b9..84131091c23 100644 --- a/compiler/testData/codegen/box/reflection/properties/jvmField/interfaceCompanionWithAnnotation.kt +++ b/compiler/testData/codegen/box/reflection/properties/jvmField/interfaceCompanionWithAnnotation.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/reflection/properties/memberAndMemberExtensionWithSameName.kt b/compiler/testData/codegen/box/reflection/properties/memberAndMemberExtensionWithSameName.kt index fdc5d84f8a3..7a8ad1ff851 100644 --- a/compiler/testData/codegen/box/reflection/properties/memberAndMemberExtensionWithSameName.kt +++ b/compiler/testData/codegen/box/reflection/properties/memberAndMemberExtensionWithSameName.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/properties/privateToThisAccessors.kt b/compiler/testData/codegen/box/reflection/properties/privateToThisAccessors.kt index 8bd23cf7d20..21eb7df89a3 100644 --- a/compiler/testData/codegen/box/reflection/properties/privateToThisAccessors.kt +++ b/compiler/testData/codegen/box/reflection/properties/privateToThisAccessors.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/reflection/properties/propertyOfNestedClassAndArrayType.kt b/compiler/testData/codegen/box/reflection/properties/propertyOfNestedClassAndArrayType.kt index 91607cf1c2c..e251b8cf449 100644 --- a/compiler/testData/codegen/box/reflection/properties/propertyOfNestedClassAndArrayType.kt +++ b/compiler/testData/codegen/box/reflection/properties/propertyOfNestedClassAndArrayType.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/properties/protectedClassVar.kt b/compiler/testData/codegen/box/reflection/properties/protectedClassVar.kt index 703e13581ad..543fcd02329 100644 --- a/compiler/testData/codegen/box/reflection/properties/protectedClassVar.kt +++ b/compiler/testData/codegen/box/reflection/properties/protectedClassVar.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/reflection/properties/publicClassValAccessible.kt b/compiler/testData/codegen/box/reflection/properties/publicClassValAccessible.kt index 18fd002aa48..f616d9a0453 100644 --- a/compiler/testData/codegen/box/reflection/properties/publicClassValAccessible.kt +++ b/compiler/testData/codegen/box/reflection/properties/publicClassValAccessible.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/reflection/properties/simpleGetProperties.kt b/compiler/testData/codegen/box/reflection/properties/simpleGetProperties.kt index 38e797ae2b9..c9058988996 100644 --- a/compiler/testData/codegen/box/reflection/properties/simpleGetProperties.kt +++ b/compiler/testData/codegen/box/reflection/properties/simpleGetProperties.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/supertypes/builtInClassSupertypes.kt b/compiler/testData/codegen/box/reflection/supertypes/builtInClassSupertypes.kt index b07b388ad04..51c7a202d6a 100644 --- a/compiler/testData/codegen/box/reflection/supertypes/builtInClassSupertypes.kt +++ b/compiler/testData/codegen/box/reflection/supertypes/builtInClassSupertypes.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/reflection/supertypes/simpleSupertypes.kt b/compiler/testData/codegen/box/reflection/supertypes/simpleSupertypes.kt index 7392d3d91eb..785c7a4f62c 100644 --- a/compiler/testData/codegen/box/reflection/supertypes/simpleSupertypes.kt +++ b/compiler/testData/codegen/box/reflection/supertypes/simpleSupertypes.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/typeParameters/declarationSiteVariance.kt b/compiler/testData/codegen/box/reflection/typeParameters/declarationSiteVariance.kt index 3f8c8d8ff46..494522c21aa 100644 --- a/compiler/testData/codegen/box/reflection/typeParameters/declarationSiteVariance.kt +++ b/compiler/testData/codegen/box/reflection/typeParameters/declarationSiteVariance.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/typeParameters/typeParametersAndNames.kt b/compiler/testData/codegen/box/reflection/typeParameters/typeParametersAndNames.kt index 2be85e75df8..f08da123cc0 100644 --- a/compiler/testData/codegen/box/reflection/typeParameters/typeParametersAndNames.kt +++ b/compiler/testData/codegen/box/reflection/typeParameters/typeParametersAndNames.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/typeParameters/upperBounds.kt b/compiler/testData/codegen/box/reflection/typeParameters/upperBounds.kt index e0d0141ccd2..2fdc4cea305 100644 --- a/compiler/testData/codegen/box/reflection/typeParameters/upperBounds.kt +++ b/compiler/testData/codegen/box/reflection/typeParameters/upperBounds.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/types/classifierIsTypeParameter.kt b/compiler/testData/codegen/box/reflection/types/classifierIsTypeParameter.kt index 500a516e6cf..c996a57bebb 100644 --- a/compiler/testData/codegen/box/reflection/types/classifierIsTypeParameter.kt +++ b/compiler/testData/codegen/box/reflection/types/classifierIsTypeParameter.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/types/createType/innerGeneric.kt b/compiler/testData/codegen/box/reflection/types/createType/innerGeneric.kt index 76b2e36adbd..b664e36db88 100644 --- a/compiler/testData/codegen/box/reflection/types/createType/innerGeneric.kt +++ b/compiler/testData/codegen/box/reflection/types/createType/innerGeneric.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/types/createType/typeParameter.kt b/compiler/testData/codegen/box/reflection/types/createType/typeParameter.kt index 3efa2a28ea9..02f5002a603 100644 --- a/compiler/testData/codegen/box/reflection/types/createType/typeParameter.kt +++ b/compiler/testData/codegen/box/reflection/types/createType/typeParameter.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/types/createType/wrongNumberOfArguments.kt b/compiler/testData/codegen/box/reflection/types/createType/wrongNumberOfArguments.kt index 8cdf98a8396..f9b647a6197 100644 --- a/compiler/testData/codegen/box/reflection/types/createType/wrongNumberOfArguments.kt +++ b/compiler/testData/codegen/box/reflection/types/createType/wrongNumberOfArguments.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/types/innerGenericArguments.kt b/compiler/testData/codegen/box/reflection/types/innerGenericArguments.kt index aa9d791021d..4ba5a9d8c80 100644 --- a/compiler/testData/codegen/box/reflection/types/innerGenericArguments.kt +++ b/compiler/testData/codegen/box/reflection/types/innerGenericArguments.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/types/platformTypeNotEqualToKotlinType.kt b/compiler/testData/codegen/box/reflection/types/platformTypeNotEqualToKotlinType.kt index b2df2719301..d4a033b063f 100644 --- a/compiler/testData/codegen/box/reflection/types/platformTypeNotEqualToKotlinType.kt +++ b/compiler/testData/codegen/box/reflection/types/platformTypeNotEqualToKotlinType.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/reflection/types/subtyping/platformType.kt b/compiler/testData/codegen/box/reflection/types/subtyping/platformType.kt index dbbf1375790..f9932a50a7d 100644 --- a/compiler/testData/codegen/box/reflection/types/subtyping/platformType.kt +++ b/compiler/testData/codegen/box/reflection/types/subtyping/platformType.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/reflection/types/subtyping/simpleGenericTypes.kt b/compiler/testData/codegen/box/reflection/types/subtyping/simpleGenericTypes.kt index 2000521c470..56898204b25 100644 --- a/compiler/testData/codegen/box/reflection/types/subtyping/simpleGenericTypes.kt +++ b/compiler/testData/codegen/box/reflection/types/subtyping/simpleGenericTypes.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/types/subtyping/simpleSubtypeSupertype.kt b/compiler/testData/codegen/box/reflection/types/subtyping/simpleSubtypeSupertype.kt index 927c6a23b4b..ce82270a60e 100644 --- a/compiler/testData/codegen/box/reflection/types/subtyping/simpleSubtypeSupertype.kt +++ b/compiler/testData/codegen/box/reflection/types/subtyping/simpleSubtypeSupertype.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/types/subtyping/typeProjection.kt b/compiler/testData/codegen/box/reflection/types/subtyping/typeProjection.kt index bd6247658e6..29863590942 100644 --- a/compiler/testData/codegen/box/reflection/types/subtyping/typeProjection.kt +++ b/compiler/testData/codegen/box/reflection/types/subtyping/typeProjection.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/types/typeArguments.kt b/compiler/testData/codegen/box/reflection/types/typeArguments.kt index e8a005f2d86..7334b017e0a 100644 --- a/compiler/testData/codegen/box/reflection/types/typeArguments.kt +++ b/compiler/testData/codegen/box/reflection/types/typeArguments.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/types/useSiteVariance.kt b/compiler/testData/codegen/box/reflection/types/useSiteVariance.kt index c3c0e87123c..d6b0fc3fc1f 100644 --- a/compiler/testData/codegen/box/reflection/types/useSiteVariance.kt +++ b/compiler/testData/codegen/box/reflection/types/useSiteVariance.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/types/withNullability.kt b/compiler/testData/codegen/box/reflection/types/withNullability.kt index 0999b3c7636..f1f2aae2ad7 100644 --- a/compiler/testData/codegen/box/reflection/types/withNullability.kt +++ b/compiler/testData/codegen/box/reflection/types/withNullability.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT