Generate CHECKCAST after ACONST_NULL in coroutines
If we do not do this, the state-machine builder will not know the type of the ACONST_NULL, defaulting to Object, leading to VerifyError. Alternatively, we could use LVT to deduce the type, but getting types from LVT is something I got rid of long time ago, and I have no desire to return it back. Generating CHECKCAST hints the state-machine builder the type of the variable avoiding the issue of VerifyError. However, this CHECKCAST replaces StrictBasicValue.NULL_VALUE with BasicValue in OptimizationBasicInterpreter. To preserve optimization on not-spilling known nulls, introduce BasicValues, which represent typed nulls and create BasicInterpreter, which is aware of them. This way we have the best of two worlds - we do not spill known nulls, and we know the type of ACONST_NULL. #KT-51718 Fixed
This commit is contained in:
+6
@@ -8041,6 +8041,12 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest
|
||||
runTest("compiler/testData/codegen/box/coroutines/kt49168.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt51718.kt")
|
||||
public void testKt51718() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/coroutines/kt51718.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("lastExpressionIsLoop.kt")
|
||||
public void testLastExpressionIsLoop() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user