JVM: streamline handling of tail-call suspend functions
Just see if every suspend call is followed only by safe instructions or returns, then insert a suspension point check if there isn't a direct return. The first part of this is equivalent to the old implementation, just refactored. The second part generates strictly more checks; see, for example, the fixed test, in which the previous implementation failed to insert a check before a CHECKCAST. ^KT-51818 Fixed
This commit is contained in:
+5
@@ -10203,6 +10203,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
runTest("compiler/testData/codegen/box/coroutines/tailCallOptimizations/checkcast.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("checkcast2.kt")
|
||||
public void testCheckcast2() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/coroutines/tailCallOptimizations/checkcast2.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("crossinline.kt")
|
||||
public void testCrossinline() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/coroutines/tailCallOptimizations/crossinline.kt");
|
||||
|
||||
Reference in New Issue
Block a user