JVM_IR: create temporaries for complex SAM conversion arguments

To avoid bytecode sequences like

    new _1Kt$sam$i$java_lang_Runnable$0
    dup
    new _1Kt$f$1
    dup
    invokespecial _1Kt$f$1.<init>()V
    invokespecial _1Kt$sam$i$java_lang_Runnable$0.<init>(...)V

as the different order of `new` and `<init>` confuses the inliner.
This commit is contained in:
pyos
2019-10-21 14:25:30 +02:00
committed by max-kammerer
parent 650e2501bb
commit 862197d713
6 changed files with 46 additions and 0 deletions
@@ -432,6 +432,11 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/anonymousObject/sam"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true);
}
@TestMetadata("anonymousObjectToSam.kt")
public void testAnonymousObjectToSam() throws Exception {
runTest("compiler/testData/codegen/boxInline/anonymousObject/sam/anonymousObjectToSam.kt");
}
@TestMetadata("kt17091.kt")
public void testKt17091() throws Exception {
runTest("compiler/testData/codegen/boxInline/anonymousObject/sam/kt17091.kt");