Support jump out of the constructor call in suspend functions

Jump out from expression (e.g., break or continue expression in call
arguments) requires stack normalization, which inserts POP instructions.
POPping an uninitialized value is similar to ASTORE, except that it
doesn't store a value to a local variable. Such POP instructions should
be removed during postprocessing of the uninitialized stores.
This commit is contained in:
Dmitry Petrov
2017-10-03 10:22:53 +03:00
parent da6841163b
commit c3d74bdabb
6 changed files with 215 additions and 7 deletions
@@ -6152,6 +6152,12 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
doTest(fileName);
}
@TestMetadata("suspendInTheMiddleOfObjectConstructionWithJumpOut.kt")
public void testSuspendInTheMiddleOfObjectConstructionWithJumpOut() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstructionWithJumpOut.kt");
doTest(fileName);
}
@TestMetadata("suspensionInsideSafeCall.kt")
public void testSuspensionInsideSafeCall() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspensionInsideSafeCall.kt");