Detect inline cycles faster
E.g. in the following code
fun x() {}
inline fun f() { x(); g() }
inline fun g() { x(); f() }
the old implementation of inline cycle detection bailed out after
generating 3 calls of x() in each function, while the new one stops
after 2. In other words, code generation for a single function is no
longer reentered.
This commit is contained in:
Generated
+10
@@ -29,11 +29,21 @@ public class DiagnosticsTestWithJvmIrBackendGenerated extends AbstractDiagnostic
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/testsWithJvmBackend"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
||||
}
|
||||
|
||||
@TestMetadata("indirectInlineCycle.kt")
|
||||
public void testIndirectInlineCycle() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithJvmBackend/indirectInlineCycle.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("inlineCycle.kt")
|
||||
public void testInlineCycle() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithJvmBackend/inlineCycle.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("suspendInlineCycle.kt")
|
||||
public void testSuspendInlineCycle() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithJvmBackend/suspendInlineCycle.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/diagnostics/testsWithJvmBackend/duplicateJvmSignature")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
|
||||
Generated
+10
@@ -29,11 +29,21 @@ public class DiagnosticsTestWithOldJvmBackendGenerated extends AbstractDiagnosti
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/testsWithJvmBackend"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_OLD, true);
|
||||
}
|
||||
|
||||
@TestMetadata("indirectInlineCycle.kt")
|
||||
public void testIndirectInlineCycle() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithJvmBackend/indirectInlineCycle.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("inlineCycle.kt")
|
||||
public void testInlineCycle() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithJvmBackend/inlineCycle.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("suspendInlineCycle.kt")
|
||||
public void testSuspendInlineCycle() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithJvmBackend/suspendInlineCycle.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/diagnostics/testsWithJvmBackend/duplicateJvmSignature")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
|
||||
Reference in New Issue
Block a user