From 055215c54f0a11e8e7b5bf718112978e8bdeeabe Mon Sep 17 00:00:00 2001 From: Georgy Bronnikov Date: Tue, 18 Sep 2018 14:49:43 +0300 Subject: [PATCH] JVM_IR. Support compile time constants --- .../ConstAndJvmFieldPropertiesLowering.kt | 11 +++++++++- .../ir/util/DeclarationStubGenerator.kt | 22 +++++++++++++++---- .../codegen/box/binaryOp/overflowChar.kt | 1 - .../codegen/box/binaryOp/overflowInt.kt | 1 - .../codegen/box/binaryOp/overflowLong.kt | 1 - .../testData/codegen/box/constants/kt9532.kt | 1 + .../box/intrinsics/defaultObjectMapping.kt | 1 - .../codegen/box/intrinsics/kt12125.kt | 1 - .../codegen/box/intrinsics/kt12125_inc.kt | 1 - .../testData/codegen/box/intrinsics/kt8666.kt | 1 - .../primitiveCompanion/byteCompanionObject.kt | 1 - .../primitiveCompanion/charCompanionObject.kt | 1 - .../primitiveCompanion/intCompanionObject.kt | 1 - .../primitiveCompanion/longCompanionObject.kt | 1 - .../shortCompanionObject.kt | 1 - .../ranges/contains/inOptimizableIntRange.kt | 1 - .../ranges/contains/inOptimizableLongRange.kt | 1 - .../inRangeWithNonmatchingArguments.kt | 1 - .../expression/overflowZeroDownToMaxValue.kt | 1 - .../box/ranges/forInUntil/forInUntilMaxint.kt | 1 - .../box/ranges/forInUntil/forInUntilMinint.kt | 1 - .../ranges/forInUntil/forInUntilMinlong.kt | 1 - .../forInDownToCharMinValue.kt | 1 - .../forInDownToCharMinValueReversed.kt | 1 - .../forInDownToIntMinValue.kt | 1 - .../forInDownToIntMinValueReversed.kt | 1 - .../forInDownToLongMinValue.kt | 1 - .../forInDownToLongMinValueReversed.kt | 1 - .../forInRangeToCharMaxValue.kt | 3 +-- .../forInRangeToCharMaxValueReversed.kt | 3 +-- .../forInRangeToIntMaxValue.kt | 1 - .../forInRangeToIntMaxValueReversed.kt | 1 - .../forInRangeToLongMaxValue.kt | 1 - .../forInRangeToLongMaxValueReversed.kt | 1 - .../forInUntilIntMinValueReversed.kt | 1 - .../literal/overflowZeroDownToMaxValue.kt | 1 - .../boxInline/private/accessorForConst.kt | 1 - .../syntheticAccessors/constField.kt | 1 - .../stubs/constFromBuiltins__kotlin.Int.txt | 4 ++++ 39 files changed, 35 insertions(+), 42 deletions(-) diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/ConstAndJvmFieldPropertiesLowering.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/ConstAndJvmFieldPropertiesLowering.kt index cedf8aa5105..ee20b5514ce 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/ConstAndJvmFieldPropertiesLowering.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/ConstAndJvmFieldPropertiesLowering.kt @@ -13,7 +13,9 @@ import org.jetbrains.kotlin.descriptors.PropertyGetterDescriptor import org.jetbrains.kotlin.ir.IrStatement import org.jetbrains.kotlin.ir.declarations.IrFile import org.jetbrains.kotlin.ir.declarations.IrProperty +import org.jetbrains.kotlin.ir.declarations.IrSimpleFunction import org.jetbrains.kotlin.ir.expressions.IrCall +import org.jetbrains.kotlin.ir.expressions.IrConst import org.jetbrains.kotlin.ir.expressions.IrExpression import org.jetbrains.kotlin.ir.expressions.impl.IrGetFieldImpl import org.jetbrains.kotlin.ir.expressions.impl.IrSetFieldImpl @@ -22,6 +24,7 @@ import org.jetbrains.kotlin.ir.visitors.transformChildrenVoid import org.jetbrains.kotlin.synthetic.SyntheticJavaPropertyDescriptor class ConstAndJvmFieldPropertiesLowering(val context: JvmBackendContext) : IrElementTransformerVoid(), FileLoweringPass { + override fun lower(irFile: IrFile) { irFile.transformChildrenVoid(this) } @@ -36,6 +39,12 @@ class ConstAndJvmFieldPropertiesLowering(val context: JvmBackendContext) : IrEle } override fun visitCall(expression: IrCall): IrExpression { + val irProperty = (expression.symbol.owner as? IrSimpleFunction)?.correspondingProperty ?: return super.visitCall(expression) + + if (irProperty.isConst) { + (irProperty.backingField?.initializer?.expression as? IrConst<*>)?.let { return it } + } + val descriptor = expression.descriptor as? PropertyAccessorDescriptor ?: return super.visitCall(expression) val property = descriptor.correspondingProperty @@ -65,7 +74,7 @@ class ConstAndJvmFieldPropertiesLowering(val context: JvmBackendContext) : IrEle ) } - private fun substituteGetter(descriptor: PropertyGetterDescriptor, expression: IrCall): IrGetFieldImpl { + private fun substituteGetter(descriptor: PropertyGetterDescriptor, expression: IrCall): IrExpression { return IrGetFieldImpl( expression.startOffset, expression.endOffset, diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/DeclarationStubGenerator.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/DeclarationStubGenerator.kt index 9a07917fada..94feea84cbc 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/DeclarationStubGenerator.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/DeclarationStubGenerator.kt @@ -79,14 +79,21 @@ class DeclarationStubGenerator( throw AssertionError("Unexpected member descriptor: $descriptor") } - internal fun generatePropertyStub(descriptor: PropertyDescriptor, bindingContext: BindingContext? = null): IrProperty = + internal fun generatePropertyStub( + descriptor: PropertyDescriptor, + bindingContext: BindingContext? = null + ): IrProperty = IrPropertyImpl(UNDEFINED_OFFSET, UNDEFINED_OFFSET, origin, descriptor).also { irProperty -> if (descriptor.hasBackingField(bindingContext)) { irProperty.backingField = generateFieldStub(descriptor) } - irProperty.getter = descriptor.getter?.let { generateFunctionStub(it) } - irProperty.setter = descriptor.setter?.let { generateFunctionStub(it) } + irProperty.getter = descriptor.getter?.let { generateFunctionStub(it, createPropertyIfNeeded = false) }?.apply { + correspondingProperty = irProperty + } + irProperty.setter = descriptor.setter?.let { generateFunctionStub(it, createPropertyIfNeeded = false) }?.apply { + correspondingProperty = irProperty + } } private fun generateFieldStub(descriptor: PropertyDescriptor): IrField { @@ -117,12 +124,19 @@ class DeclarationStubGenerator( } } - fun generateFunctionStub(descriptor: FunctionDescriptor): IrSimpleFunction { + fun generateFunctionStub(descriptor: FunctionDescriptor, createPropertyIfNeeded: Boolean = true): IrSimpleFunction { val referenced = symbolTable.referenceSimpleFunction(descriptor) if (referenced.isBound) { return referenced.owner } + if (createPropertyIfNeeded && descriptor is PropertyGetterDescriptor) { + return generatePropertyStub(descriptor.correspondingProperty).getter!! + } + if (createPropertyIfNeeded && descriptor is PropertySetterDescriptor) { + return generatePropertyStub(descriptor.correspondingProperty).setter!! + } + val origin = if (descriptor.kind == CallableMemberDescriptor.Kind.FAKE_OVERRIDE) IrDeclarationOrigin.FAKE_OVERRIDE diff --git a/compiler/testData/codegen/box/binaryOp/overflowChar.kt b/compiler/testData/codegen/box/binaryOp/overflowChar.kt index 377f8553ca2..9fc3a9adc82 100644 --- a/compiler/testData/codegen/box/binaryOp/overflowChar.kt +++ b/compiler/testData/codegen/box/binaryOp/overflowChar.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JVM_IR fun box(): String { val c1: Char = Char.MIN_VALUE val c2 = c1 - 1 diff --git a/compiler/testData/codegen/box/binaryOp/overflowInt.kt b/compiler/testData/codegen/box/binaryOp/overflowInt.kt index 63d62b42fe0..a0504afe7ab 100644 --- a/compiler/testData/codegen/box/binaryOp/overflowInt.kt +++ b/compiler/testData/codegen/box/binaryOp/overflowInt.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JVM_IR // IGNORE_BACKEND: JS_IR fun box(): String { val i1: Int = Int.MAX_VALUE diff --git a/compiler/testData/codegen/box/binaryOp/overflowLong.kt b/compiler/testData/codegen/box/binaryOp/overflowLong.kt index e62a3e38bf5..946518a1495 100644 --- a/compiler/testData/codegen/box/binaryOp/overflowLong.kt +++ b/compiler/testData/codegen/box/binaryOp/overflowLong.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JVM_IR // IGNORE_BACKEND: JS_IR fun box(): String { val a: Long = 2147483647 + 1 diff --git a/compiler/testData/codegen/box/constants/kt9532.kt b/compiler/testData/codegen/box/constants/kt9532.kt index 15a72d3b3ac..e74fd2d5b9e 100644 --- a/compiler/testData/codegen/box/constants/kt9532.kt +++ b/compiler/testData/codegen/box/constants/kt9532.kt @@ -1,3 +1,4 @@ +// !LANGUAGE: -NoConstantValueAttributeForNonConstVals // IGNORE_BACKEND: JVM_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: NATIVE diff --git a/compiler/testData/codegen/box/intrinsics/defaultObjectMapping.kt b/compiler/testData/codegen/box/intrinsics/defaultObjectMapping.kt index 4c15c008500..2c35c735d2d 100644 --- a/compiler/testData/codegen/box/intrinsics/defaultObjectMapping.kt +++ b/compiler/testData/codegen/box/intrinsics/defaultObjectMapping.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: 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/intrinsics/kt12125.kt b/compiler/testData/codegen/box/intrinsics/kt12125.kt index c0e8ec79232..36444ec6063 100644 --- a/compiler/testData/codegen/box/intrinsics/kt12125.kt +++ b/compiler/testData/codegen/box/intrinsics/kt12125.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JVM_IR // IGNORE_BACKEND: JS_IR fun test(i: Int): Int { return i diff --git a/compiler/testData/codegen/box/intrinsics/kt12125_inc.kt b/compiler/testData/codegen/box/intrinsics/kt12125_inc.kt index 7ba7520e2d8..5d0763868d3 100644 --- a/compiler/testData/codegen/box/intrinsics/kt12125_inc.kt +++ b/compiler/testData/codegen/box/intrinsics/kt12125_inc.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JVM_IR // IGNORE_BACKEND: JS_IR fun test(i: Int): Int { return i diff --git a/compiler/testData/codegen/box/intrinsics/kt8666.kt b/compiler/testData/codegen/box/intrinsics/kt8666.kt index 945034feeca..babdea592d3 100644 --- a/compiler/testData/codegen/box/intrinsics/kt8666.kt +++ b/compiler/testData/codegen/box/intrinsics/kt8666.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JVM_IR // IGNORE_BACKEND: JS_IR val MAX_LONG = "9223372036854775807" val PREFIX = "max = " diff --git a/compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/byteCompanionObject.kt b/compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/byteCompanionObject.kt index 4beacd00275..1e539afbceb 100644 --- a/compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/byteCompanionObject.kt +++ b/compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/byteCompanionObject.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JVM_IR fun assertEquals(a: T, b: T) { if (a != b) throw AssertionError("$a != $b") } diff --git a/compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/charCompanionObject.kt b/compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/charCompanionObject.kt index f9c605aacf3..31e55f43f32 100644 --- a/compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/charCompanionObject.kt +++ b/compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/charCompanionObject.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JVM_IR fun assertEquals(a: T, b: T) { if (a != b) throw AssertionError("$a != $b") } diff --git a/compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/intCompanionObject.kt b/compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/intCompanionObject.kt index df7698f37cb..79aeca44f55 100644 --- a/compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/intCompanionObject.kt +++ b/compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/intCompanionObject.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JVM_IR fun assertEquals(a: T, b: T) { if (a != b) throw AssertionError("$a != $b") } diff --git a/compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/longCompanionObject.kt b/compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/longCompanionObject.kt index c1f7089eef2..a40231e5241 100644 --- a/compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/longCompanionObject.kt +++ b/compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/longCompanionObject.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JVM_IR fun assertEquals(a: T, b: T) { if (a != b) throw AssertionError("$a != $b") } diff --git a/compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/shortCompanionObject.kt b/compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/shortCompanionObject.kt index eeb98a04bca..63f4a386e11 100644 --- a/compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/shortCompanionObject.kt +++ b/compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/shortCompanionObject.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JVM_IR fun assertEquals(a: T, b: T) { if (a != b) throw AssertionError("$a != $b") } diff --git a/compiler/testData/codegen/box/ranges/contains/inOptimizableIntRange.kt b/compiler/testData/codegen/box/ranges/contains/inOptimizableIntRange.kt index cba7cec1d31..f43735658c2 100644 --- a/compiler/testData/codegen/box/ranges/contains/inOptimizableIntRange.kt +++ b/compiler/testData/codegen/box/ranges/contains/inOptimizableIntRange.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS diff --git a/compiler/testData/codegen/box/ranges/contains/inOptimizableLongRange.kt b/compiler/testData/codegen/box/ranges/contains/inOptimizableLongRange.kt index 7e5a97ae365..9efa1bf15a9 100644 --- a/compiler/testData/codegen/box/ranges/contains/inOptimizableLongRange.kt +++ b/compiler/testData/codegen/box/ranges/contains/inOptimizableLongRange.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS diff --git a/compiler/testData/codegen/box/ranges/contains/inRangeWithNonmatchingArguments.kt b/compiler/testData/codegen/box/ranges/contains/inRangeWithNonmatchingArguments.kt index a1b2e3d22cb..67f74ee1353 100644 --- a/compiler/testData/codegen/box/ranges/contains/inRangeWithNonmatchingArguments.kt +++ b/compiler/testData/codegen/box/ranges/contains/inRangeWithNonmatchingArguments.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS diff --git a/compiler/testData/codegen/box/ranges/expression/overflowZeroDownToMaxValue.kt b/compiler/testData/codegen/box/ranges/expression/overflowZeroDownToMaxValue.kt index 7af329851d0..e0dd9cd75d5 100644 --- a/compiler/testData/codegen/box/ranges/expression/overflowZeroDownToMaxValue.kt +++ b/compiler/testData/codegen/box/ranges/expression/overflowZeroDownToMaxValue.kt @@ -1,5 +1,4 @@ // TODO: muted automatically, investigate should it be ran for JVM_IR or not -// IGNORE_BACKEND: JVM_IR // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/ranges/forInUntil/forInUntilMaxint.kt b/compiler/testData/codegen/box/ranges/forInUntil/forInUntilMaxint.kt index 00929a522d5..bf012c8d0ff 100644 --- a/compiler/testData/codegen/box/ranges/forInUntil/forInUntilMaxint.kt +++ b/compiler/testData/codegen/box/ranges/forInUntil/forInUntilMaxint.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JVM_IR // WITH_RUNTIME import kotlin.test.assertEquals diff --git a/compiler/testData/codegen/box/ranges/forInUntil/forInUntilMinint.kt b/compiler/testData/codegen/box/ranges/forInUntil/forInUntilMinint.kt index d3a78ce3566..31ae7acede2 100644 --- a/compiler/testData/codegen/box/ranges/forInUntil/forInUntilMinint.kt +++ b/compiler/testData/codegen/box/ranges/forInUntil/forInUntilMinint.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JVM_IR // WITH_RUNTIME import kotlin.test.assertEquals diff --git a/compiler/testData/codegen/box/ranges/forInUntil/forInUntilMinlong.kt b/compiler/testData/codegen/box/ranges/forInUntil/forInUntilMinlong.kt index 865c6580f54..b44b7f9f440 100644 --- a/compiler/testData/codegen/box/ranges/forInUntil/forInUntilMinlong.kt +++ b/compiler/testData/codegen/box/ranges/forInUntil/forInUntilMinlong.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JVM_IR // WITH_RUNTIME import kotlin.test.assertEquals diff --git a/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInDownToCharMinValue.kt b/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInDownToCharMinValue.kt index 66346cea158..2a70ba6b146 100644 --- a/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInDownToCharMinValue.kt +++ b/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInDownToCharMinValue.kt @@ -1,5 +1,4 @@ // WITH_RUNTIME -// IGNORE_BACKEND: JVM_IR const val M = Char.MIN_VALUE diff --git a/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInDownToCharMinValueReversed.kt b/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInDownToCharMinValueReversed.kt index 27f11177a4e..9c129160c66 100644 --- a/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInDownToCharMinValueReversed.kt +++ b/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInDownToCharMinValueReversed.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JVM_IR // WITH_RUNTIME const val M = Char.MIN_VALUE diff --git a/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInDownToIntMinValue.kt b/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInDownToIntMinValue.kt index 4cb8afaf68a..901769c7ef4 100644 --- a/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInDownToIntMinValue.kt +++ b/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInDownToIntMinValue.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JVM_IR // WITH_RUNTIME const val M = Int.MIN_VALUE diff --git a/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInDownToIntMinValueReversed.kt b/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInDownToIntMinValueReversed.kt index cd01bb8ab19..e7d894ec0c1 100644 --- a/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInDownToIntMinValueReversed.kt +++ b/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInDownToIntMinValueReversed.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JVM_IR // WITH_RUNTIME const val M = Int.MIN_VALUE diff --git a/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInDownToLongMinValue.kt b/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInDownToLongMinValue.kt index 63e18ab3c22..451ba31d1db 100644 --- a/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInDownToLongMinValue.kt +++ b/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInDownToLongMinValue.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JVM_IR // WITH_RUNTIME const val M = Long.MIN_VALUE diff --git a/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInDownToLongMinValueReversed.kt b/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInDownToLongMinValueReversed.kt index 5c62e7f35e9..94e3d184771 100644 --- a/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInDownToLongMinValueReversed.kt +++ b/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInDownToLongMinValueReversed.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JVM_IR // WITH_RUNTIME const val M = Long.MIN_VALUE diff --git a/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInRangeToCharMaxValue.kt b/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInRangeToCharMaxValue.kt index db5ce2d2c49..e11176265bc 100644 --- a/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInRangeToCharMaxValue.kt +++ b/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInRangeToCharMaxValue.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JVM_IR const val M = Char.MAX_VALUE fun box(): String { @@ -11,4 +10,4 @@ fun box(): String { } if (count != 1) throw AssertionError("Should be executed once") return "OK" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInRangeToCharMaxValueReversed.kt b/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInRangeToCharMaxValueReversed.kt index 7b2a006f537..5de30bd36af 100644 --- a/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInRangeToCharMaxValueReversed.kt +++ b/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInRangeToCharMaxValueReversed.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JVM_IR // WITH_RUNTIME const val M = Char.MAX_VALUE @@ -13,4 +12,4 @@ fun box(): String { } if (count != 1) throw AssertionError("Should be executed once") return "OK" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInRangeToIntMaxValue.kt b/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInRangeToIntMaxValue.kt index 27709c25dbd..b5cce712005 100644 --- a/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInRangeToIntMaxValue.kt +++ b/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInRangeToIntMaxValue.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JVM_IR const val M = Int.MAX_VALUE fun box(): String { diff --git a/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInRangeToIntMaxValueReversed.kt b/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInRangeToIntMaxValueReversed.kt index 4ada68a9a10..8e98a8c48a6 100644 --- a/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInRangeToIntMaxValueReversed.kt +++ b/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInRangeToIntMaxValueReversed.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JVM_IR // WITH_RUNTIME const val M = Int.MAX_VALUE diff --git a/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInRangeToLongMaxValue.kt b/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInRangeToLongMaxValue.kt index d1f2e84af97..5f0b3f77c9c 100644 --- a/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInRangeToLongMaxValue.kt +++ b/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInRangeToLongMaxValue.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JVM_IR const val M = Long.MAX_VALUE fun box(): String { diff --git a/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInRangeToLongMaxValueReversed.kt b/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInRangeToLongMaxValueReversed.kt index fc76ac0395a..b06b2417660 100644 --- a/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInRangeToLongMaxValueReversed.kt +++ b/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInRangeToLongMaxValueReversed.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JVM_IR // WITH_RUNTIME const val M = Long.MAX_VALUE diff --git a/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInUntilIntMinValueReversed.kt b/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInUntilIntMinValueReversed.kt index a7dadbf025c..bd269a4fb79 100644 --- a/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInUntilIntMinValueReversed.kt +++ b/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInUntilIntMinValueReversed.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JVM_IR // WITH_RUNTIME const val M = Int.MIN_VALUE diff --git a/compiler/testData/codegen/box/ranges/literal/overflowZeroDownToMaxValue.kt b/compiler/testData/codegen/box/ranges/literal/overflowZeroDownToMaxValue.kt index 24cad8504f0..b9407370793 100644 --- a/compiler/testData/codegen/box/ranges/literal/overflowZeroDownToMaxValue.kt +++ b/compiler/testData/codegen/box/ranges/literal/overflowZeroDownToMaxValue.kt @@ -1,5 +1,4 @@ // TODO: muted automatically, investigate should it be ran for JVM_IR or not -// IGNORE_BACKEND: JVM_IR // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME diff --git a/compiler/testData/codegen/boxInline/private/accessorForConst.kt b/compiler/testData/codegen/boxInline/private/accessorForConst.kt index 297c74e2412..9d057efdda5 100644 --- a/compiler/testData/codegen/boxInline/private/accessorForConst.kt +++ b/compiler/testData/codegen/boxInline/private/accessorForConst.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JVM_IR // FILE: 1.kt package test diff --git a/compiler/testData/codegen/boxInline/syntheticAccessors/constField.kt b/compiler/testData/codegen/boxInline/syntheticAccessors/constField.kt index 3a4c0cff018..7900725284c 100644 --- a/compiler/testData/codegen/boxInline/syntheticAccessors/constField.kt +++ b/compiler/testData/codegen/boxInline/syntheticAccessors/constField.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JVM_IR // FILE: 1.kt package test diff --git a/compiler/testData/ir/irText/stubs/constFromBuiltins__kotlin.Int.txt b/compiler/testData/ir/irText/stubs/constFromBuiltins__kotlin.Int.txt index 1d2ab09641b..08414ae9b30 100644 --- a/compiler/testData/ir/irText/stubs/constFromBuiltins__kotlin.Int.txt +++ b/compiler/testData/ir/irText/stubs/constFromBuiltins__kotlin.Int.txt @@ -221,24 +221,28 @@ CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:Int modality:FINAL visibility:publ EXPRESSION_BODY CONST Int type=kotlin.Int value=2147483647 FUN IR_EXTERNAL_DECLARATION_STUB name: visibility:public modality:FINAL <> ($this:kotlin.Int.Companion) returnType:kotlin.Int flags: + correspondingProperty: PROPERTY IR_EXTERNAL_DECLARATION_STUB name:MAX_VALUE visibility:public modality:FINAL flags:const,val $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int.Companion flags: PROPERTY IR_EXTERNAL_DECLARATION_STUB name:MIN_VALUE visibility:public modality:FINAL flags:const,val FIELD IR_EXTERNAL_DECLARATION_STUB name:MIN_VALUE type:kotlin.Int visibility:public flags:final EXPRESSION_BODY CONST Int type=kotlin.Int value=-2147483648 FUN IR_EXTERNAL_DECLARATION_STUB name: visibility:public modality:FINAL <> ($this:kotlin.Int.Companion) returnType:kotlin.Int flags: + correspondingProperty: PROPERTY IR_EXTERNAL_DECLARATION_STUB name:MIN_VALUE visibility:public modality:FINAL flags:const,val $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int.Companion flags: PROPERTY IR_EXTERNAL_DECLARATION_STUB name:SIZE_BITS visibility:public modality:FINAL flags:const,val FIELD IR_EXTERNAL_DECLARATION_STUB name:SIZE_BITS type:kotlin.Int visibility:public flags:final EXPRESSION_BODY CONST Int type=kotlin.Int value=32 FUN IR_EXTERNAL_DECLARATION_STUB name: visibility:public modality:FINAL <> ($this:kotlin.Int.Companion) returnType:kotlin.Int flags: + correspondingProperty: PROPERTY IR_EXTERNAL_DECLARATION_STUB name:SIZE_BITS visibility:public modality:FINAL flags:const,val $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int.Companion flags: PROPERTY IR_EXTERNAL_DECLARATION_STUB name:SIZE_BYTES visibility:public modality:FINAL flags:const,val FIELD IR_EXTERNAL_DECLARATION_STUB name:SIZE_BYTES type:kotlin.Int visibility:public flags:final EXPRESSION_BODY CONST Int type=kotlin.Int value=4 FUN IR_EXTERNAL_DECLARATION_STUB name: visibility:public modality:FINAL <> ($this:kotlin.Int.Companion) returnType:kotlin.Int flags: + correspondingProperty: PROPERTY IR_EXTERNAL_DECLARATION_STUB name:SIZE_BYTES visibility:public modality:FINAL flags:const,val $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int.Companion flags: FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean flags: overridden: