JVM: Improve line number handling for suspend calls.

Take branching and method calls into account when finding the line
number of the continuation. If there is no line number before
branching instructions or method calls, the following code is
still on the line of the suspend call itself.

This fixes a couple of issues with incorrect line numbers for
multiple throws on the same line or multipe suspend calls on
the same line.

In addition, it avoids the need to spam the method node with
repeated line number instructions in the IR backend.
This commit is contained in:
Mads Ager
2019-10-25 14:17:42 +02:00
committed by Ilmir Usmanov
parent 34d9959b17
commit 1713625718
9 changed files with 209 additions and 22 deletions
@@ -6935,10 +6935,20 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
runTest("compiler/testData/codegen/box/coroutines/debug/fqName.kt");
}
@TestMetadata("multipleSuspendCallsOnSameLine.kt")
public void testMultipleSuspendCallsOnSameLine() throws Exception {
runTest("compiler/testData/codegen/box/coroutines/debug/multipleSuspendCallsOnSameLine.kt");
}
@TestMetadata("runtimeDebugMetadata.kt")
public void testRuntimeDebugMetadata() throws Exception {
runTest("compiler/testData/codegen/box/coroutines/debug/runtimeDebugMetadata.kt");
}
@TestMetadata("throwsOnSameLine.kt")
public void testThrowsOnSameLine() throws Exception {
runTest("compiler/testData/codegen/box/coroutines/debug/throwsOnSameLine.kt");
}
}
@TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection")