Refine variables liveness analysis

Do not treat var as alive just because current instruction belongs to an item range
in local variables table, but the item has different sort of type

As liveness analysis is mostly used in coroutines spilling,
not applying this change may lead that to problems on Android (see tests)
This commit is contained in:
Denis Zharkov
2016-07-10 14:08:40 +03:00
parent 434a84eab6
commit 18c2d3070d
7 changed files with 212 additions and 11 deletions
@@ -4386,6 +4386,18 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/tryFinallyWithHandleResult.kt");
doTest(fileName);
}
@TestMetadata("varValueConflictsWithTable.kt")
public void testVarValueConflictsWithTable() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/varValueConflictsWithTable.kt");
doTest(fileName);
}
@TestMetadata("varValueConflictsWithTableSameSort.kt")
public void testVarValueConflictsWithTableSameSort() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/varValueConflictsWithTableSameSort.kt");
doTest(fileName);
}
}
@TestMetadata("compiler/testData/codegen/box/dataClasses")