JVM IR: do not optimize properties with -Xno-optimized-callable-references

#KT-50019 Fixed
This commit is contained in:
Alexander Udalov
2021-12-07 00:41:47 +01:00
parent f47a3a3d1c
commit 1471602c9f
9 changed files with 51 additions and 0 deletions
@@ -14083,6 +14083,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
runTest("compiler/testData/codegen/box/delegatedProperty/delegateToAnother/kt49793_object.kt");
}
@Test
@TestMetadata("kt50019_noOptimizedCallableReferences.kt")
public void testKt50019_noOptimizedCallableReferences() throws Exception {
runTest("compiler/testData/codegen/box/delegatedProperty/delegateToAnother/kt50019_noOptimizedCallableReferences.kt");
}
@Test
@TestMetadata("mutable.kt")
public void testMutable() throws Exception {
@@ -35,6 +35,7 @@ internal val propertyReferenceDelegationPhase = makeIrFilePhase(
private class PropertyReferenceDelegationLowering(val context: JvmBackendContext) : FileLoweringPass {
override fun lower(irFile: IrFile) {
if (!context.state.generateOptimizedCallableReferenceSuperClasses) return
irFile.transform(PropertyReferenceDelegationTransformer(context), null)
}
}
@@ -0,0 +1,9 @@
// WITH_STDLIB
// NO_OPTIMIZED_CALLABLE_REFERENCES
class A {
val x = "OK"
val y by ::x
}
fun box(): String = A().y
@@ -13999,6 +13999,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
runTest("compiler/testData/codegen/box/delegatedProperty/delegateToAnother/kt49793_object.kt");
}
@Test
@TestMetadata("kt50019_noOptimizedCallableReferences.kt")
public void testKt50019_noOptimizedCallableReferences() throws Exception {
runTest("compiler/testData/codegen/box/delegatedProperty/delegateToAnother/kt50019_noOptimizedCallableReferences.kt");
}
@Test
@TestMetadata("mutable.kt")
public void testMutable() throws Exception {
@@ -14083,6 +14083,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
runTest("compiler/testData/codegen/box/delegatedProperty/delegateToAnother/kt49793_object.kt");
}
@Test
@TestMetadata("kt50019_noOptimizedCallableReferences.kt")
public void testKt50019_noOptimizedCallableReferences() throws Exception {
runTest("compiler/testData/codegen/box/delegatedProperty/delegateToAnother/kt50019_noOptimizedCallableReferences.kt");
}
@Test
@TestMetadata("mutable.kt")
public void testMutable() throws Exception {
@@ -11407,6 +11407,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
runTest("compiler/testData/codegen/box/delegatedProperty/delegateToAnother/kt49793_object.kt");
}
@TestMetadata("kt50019_noOptimizedCallableReferences.kt")
public void testKt50019_noOptimizedCallableReferences() throws Exception {
runTest("compiler/testData/codegen/box/delegatedProperty/delegateToAnother/kt50019_noOptimizedCallableReferences.kt");
}
@TestMetadata("mutable.kt")
public void testMutable() throws Exception {
runTest("compiler/testData/codegen/box/delegatedProperty/delegateToAnother/mutable.kt");
@@ -10731,6 +10731,12 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/delegatedProperty/delegateToAnother/kt49793_object.kt");
}
@Test
@TestMetadata("kt50019_noOptimizedCallableReferences.kt")
public void testKt50019_noOptimizedCallableReferences() throws Exception {
runTest("compiler/testData/codegen/box/delegatedProperty/delegateToAnother/kt50019_noOptimizedCallableReferences.kt");
}
@Test
@TestMetadata("mutable.kt")
public void testMutable() throws Exception {
@@ -10773,6 +10773,12 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/delegatedProperty/delegateToAnother/kt49793_object.kt");
}
@Test
@TestMetadata("kt50019_noOptimizedCallableReferences.kt")
public void testKt50019_noOptimizedCallableReferences() throws Exception {
runTest("compiler/testData/codegen/box/delegatedProperty/delegateToAnother/kt50019_noOptimizedCallableReferences.kt");
}
@Test
@TestMetadata("mutable.kt")
public void testMutable() throws Exception {
@@ -11543,6 +11543,12 @@ public class NativeExtBlackBoxTestGenerated extends AbstractNativeBlackBoxTest {
runTest("compiler/testData/codegen/box/delegatedProperty/delegateToAnother/kt49793_object.kt");
}
@Test
@TestMetadata("kt50019_noOptimizedCallableReferences.kt")
public void testKt50019_noOptimizedCallableReferences() throws Exception {
runTest("compiler/testData/codegen/box/delegatedProperty/delegateToAnother/kt50019_noOptimizedCallableReferences.kt");
}
@Test
@TestMetadata("mutable.kt")
public void testMutable() throws Exception {