JVM_IR KT-45103 optimize direct invoke for lambdas and callable refs

This commit is contained in:
Dmitry Petrov
2021-04-26 17:17:25 +03:00
committed by teamcityserver
parent bfb1a06f3d
commit 851980e36f
124 changed files with 1340 additions and 324 deletions
@@ -10353,6 +10353,69 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
}
}
@TestMetadata("compiler/testData/codegen/box/directInvokeOptimization")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class DirectInvokeOptimization extends AbstractIrJsCodegenBoxES6Test {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR_ES6, testDataFilePath);
}
public void testAllFilesPresentInDirectInvokeOptimization() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/directInvokeOptimization"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true);
}
@TestMetadata("boundInnerContructorRef.kt")
public void testBoundInnerContructorRef() throws Exception {
runTest("compiler/testData/codegen/box/directInvokeOptimization/boundInnerContructorRef.kt");
}
@TestMetadata("boundMemberRef.kt")
public void testBoundMemberRef() throws Exception {
runTest("compiler/testData/codegen/box/directInvokeOptimization/boundMemberRef.kt");
}
@TestMetadata("capturingLambda.kt")
public void testCapturingLambda() throws Exception {
runTest("compiler/testData/codegen/box/directInvokeOptimization/capturingLambda.kt");
}
@TestMetadata("contructorRef.kt")
public void testContructorRef() throws Exception {
runTest("compiler/testData/codegen/box/directInvokeOptimization/contructorRef.kt");
}
@TestMetadata("nestedLambdas.kt")
public void testNestedLambdas() throws Exception {
runTest("compiler/testData/codegen/box/directInvokeOptimization/nestedLambdas.kt");
}
@TestMetadata("simpleAnonymousFun.kt")
public void testSimpleAnonymousFun() throws Exception {
runTest("compiler/testData/codegen/box/directInvokeOptimization/simpleAnonymousFun.kt");
}
@TestMetadata("simpleFunRef.kt")
public void testSimpleFunRef() throws Exception {
runTest("compiler/testData/codegen/box/directInvokeOptimization/simpleFunRef.kt");
}
@TestMetadata("simpleLambda.kt")
public void testSimpleLambda() throws Exception {
runTest("compiler/testData/codegen/box/directInvokeOptimization/simpleLambda.kt");
}
@TestMetadata("unboundInnerContructorRef.kt")
public void testUnboundInnerContructorRef() throws Exception {
runTest("compiler/testData/codegen/box/directInvokeOptimization/unboundInnerContructorRef.kt");
}
@TestMetadata("unboundMemberRef.kt")
public void testUnboundMemberRef() throws Exception {
runTest("compiler/testData/codegen/box/directInvokeOptimization/unboundMemberRef.kt");
}
}
@TestMetadata("compiler/testData/codegen/box/elvis")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -9759,6 +9759,69 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
}
}
@TestMetadata("compiler/testData/codegen/box/directInvokeOptimization")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class DirectInvokeOptimization extends AbstractIrJsCodegenBoxTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath);
}
public void testAllFilesPresentInDirectInvokeOptimization() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/directInvokeOptimization"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true);
}
@TestMetadata("boundInnerContructorRef.kt")
public void testBoundInnerContructorRef() throws Exception {
runTest("compiler/testData/codegen/box/directInvokeOptimization/boundInnerContructorRef.kt");
}
@TestMetadata("boundMemberRef.kt")
public void testBoundMemberRef() throws Exception {
runTest("compiler/testData/codegen/box/directInvokeOptimization/boundMemberRef.kt");
}
@TestMetadata("capturingLambda.kt")
public void testCapturingLambda() throws Exception {
runTest("compiler/testData/codegen/box/directInvokeOptimization/capturingLambda.kt");
}
@TestMetadata("contructorRef.kt")
public void testContructorRef() throws Exception {
runTest("compiler/testData/codegen/box/directInvokeOptimization/contructorRef.kt");
}
@TestMetadata("nestedLambdas.kt")
public void testNestedLambdas() throws Exception {
runTest("compiler/testData/codegen/box/directInvokeOptimization/nestedLambdas.kt");
}
@TestMetadata("simpleAnonymousFun.kt")
public void testSimpleAnonymousFun() throws Exception {
runTest("compiler/testData/codegen/box/directInvokeOptimization/simpleAnonymousFun.kt");
}
@TestMetadata("simpleFunRef.kt")
public void testSimpleFunRef() throws Exception {
runTest("compiler/testData/codegen/box/directInvokeOptimization/simpleFunRef.kt");
}
@TestMetadata("simpleLambda.kt")
public void testSimpleLambda() throws Exception {
runTest("compiler/testData/codegen/box/directInvokeOptimization/simpleLambda.kt");
}
@TestMetadata("unboundInnerContructorRef.kt")
public void testUnboundInnerContructorRef() throws Exception {
runTest("compiler/testData/codegen/box/directInvokeOptimization/unboundInnerContructorRef.kt");
}
@TestMetadata("unboundMemberRef.kt")
public void testUnboundMemberRef() throws Exception {
runTest("compiler/testData/codegen/box/directInvokeOptimization/unboundMemberRef.kt");
}
}
@TestMetadata("compiler/testData/codegen/box/elvis")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -9759,6 +9759,69 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
}
}
@TestMetadata("compiler/testData/codegen/box/directInvokeOptimization")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class DirectInvokeOptimization extends AbstractJsCodegenBoxTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath);
}
public void testAllFilesPresentInDirectInvokeOptimization() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/directInvokeOptimization"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true);
}
@TestMetadata("boundInnerContructorRef.kt")
public void testBoundInnerContructorRef() throws Exception {
runTest("compiler/testData/codegen/box/directInvokeOptimization/boundInnerContructorRef.kt");
}
@TestMetadata("boundMemberRef.kt")
public void testBoundMemberRef() throws Exception {
runTest("compiler/testData/codegen/box/directInvokeOptimization/boundMemberRef.kt");
}
@TestMetadata("capturingLambda.kt")
public void testCapturingLambda() throws Exception {
runTest("compiler/testData/codegen/box/directInvokeOptimization/capturingLambda.kt");
}
@TestMetadata("contructorRef.kt")
public void testContructorRef() throws Exception {
runTest("compiler/testData/codegen/box/directInvokeOptimization/contructorRef.kt");
}
@TestMetadata("nestedLambdas.kt")
public void testNestedLambdas() throws Exception {
runTest("compiler/testData/codegen/box/directInvokeOptimization/nestedLambdas.kt");
}
@TestMetadata("simpleAnonymousFun.kt")
public void testSimpleAnonymousFun() throws Exception {
runTest("compiler/testData/codegen/box/directInvokeOptimization/simpleAnonymousFun.kt");
}
@TestMetadata("simpleFunRef.kt")
public void testSimpleFunRef() throws Exception {
runTest("compiler/testData/codegen/box/directInvokeOptimization/simpleFunRef.kt");
}
@TestMetadata("simpleLambda.kt")
public void testSimpleLambda() throws Exception {
runTest("compiler/testData/codegen/box/directInvokeOptimization/simpleLambda.kt");
}
@TestMetadata("unboundInnerContructorRef.kt")
public void testUnboundInnerContructorRef() throws Exception {
runTest("compiler/testData/codegen/box/directInvokeOptimization/unboundInnerContructorRef.kt");
}
@TestMetadata("unboundMemberRef.kt")
public void testUnboundMemberRef() throws Exception {
runTest("compiler/testData/codegen/box/directInvokeOptimization/unboundMemberRef.kt");
}
}
@TestMetadata("compiler/testData/codegen/box/elvis")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -4642,6 +4642,69 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
}
}
@TestMetadata("compiler/testData/codegen/box/directInvokeOptimization")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class DirectInvokeOptimization extends AbstractIrCodegenBoxWasmTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest0(this::doTest, TargetBackend.WASM, testDataFilePath);
}
public void testAllFilesPresentInDirectInvokeOptimization() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/directInvokeOptimization"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true);
}
@TestMetadata("boundInnerContructorRef.kt")
public void testBoundInnerContructorRef() throws Exception {
runTest("compiler/testData/codegen/box/directInvokeOptimization/boundInnerContructorRef.kt");
}
@TestMetadata("boundMemberRef.kt")
public void testBoundMemberRef() throws Exception {
runTest("compiler/testData/codegen/box/directInvokeOptimization/boundMemberRef.kt");
}
@TestMetadata("capturingLambda.kt")
public void testCapturingLambda() throws Exception {
runTest("compiler/testData/codegen/box/directInvokeOptimization/capturingLambda.kt");
}
@TestMetadata("contructorRef.kt")
public void testContructorRef() throws Exception {
runTest("compiler/testData/codegen/box/directInvokeOptimization/contructorRef.kt");
}
@TestMetadata("nestedLambdas.kt")
public void testNestedLambdas() throws Exception {
runTest("compiler/testData/codegen/box/directInvokeOptimization/nestedLambdas.kt");
}
@TestMetadata("simpleAnonymousFun.kt")
public void testSimpleAnonymousFun() throws Exception {
runTest("compiler/testData/codegen/box/directInvokeOptimization/simpleAnonymousFun.kt");
}
@TestMetadata("simpleFunRef.kt")
public void testSimpleFunRef() throws Exception {
runTest("compiler/testData/codegen/box/directInvokeOptimization/simpleFunRef.kt");
}
@TestMetadata("simpleLambda.kt")
public void testSimpleLambda() throws Exception {
runTest("compiler/testData/codegen/box/directInvokeOptimization/simpleLambda.kt");
}
@TestMetadata("unboundInnerContructorRef.kt")
public void testUnboundInnerContructorRef() throws Exception {
runTest("compiler/testData/codegen/box/directInvokeOptimization/unboundInnerContructorRef.kt");
}
@TestMetadata("unboundMemberRef.kt")
public void testUnboundMemberRef() throws Exception {
runTest("compiler/testData/codegen/box/directInvokeOptimization/unboundMemberRef.kt");
}
}
@TestMetadata("compiler/testData/codegen/box/elvis")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)