JVM_IR: create temporaries for complex super constructor arguments

As for SAM wrappers, the bytecode sequence

    new A
    dup
    new B
    dup
    invokespecial B.<init>
    invokespecial A.<init>

breaks the inliner, so instead we do

    new B
    dup
    invokespecial B.<init>
    store x
    new A
    dup
    load x
    invokespecial A.<init>
This commit is contained in:
pyos
2019-10-22 10:03:58 +02:00
committed by max-kammerer
parent 42f75b3247
commit 5d8aac456f
6 changed files with 53 additions and 11 deletions
@@ -271,6 +271,11 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo
runTest("compiler/testData/codegen/boxInline/anonymousObject/sam.kt");
}
@TestMetadata("superConstructorWithObjectParameter.kt")
public void testSuperConstructorWithObjectParameter() throws Exception {
runTest("compiler/testData/codegen/boxInline/anonymousObject/superConstructorWithObjectParameter.kt");
}
@TestMetadata("compiler/testData/codegen/boxInline/anonymousObject/enumWhen")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)