When2Switch: generate ifnonnull check for nullable values before *switch-opcode

This commit is contained in:
Denis Zharkov
2014-07-17 11:59:58 +04:00
committed by Evgeny Gerashchenko
parent 706bbd7b72
commit 8d8c3d2b9e
11 changed files with 218 additions and 13 deletions
@@ -340,6 +340,11 @@ public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest {
doTest("compiler/testData/codegen/bytecodeText/whenEnumOptimization/nonConstantEnum.kt");
}
@TestMetadata("nullability.kt")
public void testNullability() throws Exception {
doTest("compiler/testData/codegen/bytecodeText/whenEnumOptimization/nullability.kt");
}
@TestMetadata("subjectAny.kt")
public void testSubjectAny() throws Exception {
doTest("compiler/testData/codegen/bytecodeText/whenEnumOptimization/subjectAny.kt");
@@ -383,6 +388,11 @@ public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest {
doTest("compiler/testData/codegen/bytecodeText/whenStringOptimization/nonInlinedConst.kt");
}
@TestMetadata("nullability.kt")
public void testNullability() throws Exception {
doTest("compiler/testData/codegen/bytecodeText/whenStringOptimization/nullability.kt");
}
@TestMetadata("sameHashCode.kt")
public void testSameHashCode() throws Exception {
doTest("compiler/testData/codegen/bytecodeText/whenStringOptimization/sameHashCode.kt");
@@ -1993,6 +1993,11 @@ public class BlackBoxWithStdlibCodegenTestGenerated extends AbstractBlackBoxCode
doTestWithStdlib("compiler/testData/codegen/boxWithStdlib/whenEnumOptimization/nonConstantEnum.kt");
}
@TestMetadata("nullability.kt")
public void testNullability() throws Exception {
doTestWithStdlib("compiler/testData/codegen/boxWithStdlib/whenEnumOptimization/nullability.kt");
}
@TestMetadata("subjectAny.kt")
public void testSubjectAny() throws Exception {
doTestWithStdlib("compiler/testData/codegen/boxWithStdlib/whenEnumOptimization/subjectAny.kt");
@@ -2026,6 +2031,11 @@ public class BlackBoxWithStdlibCodegenTestGenerated extends AbstractBlackBoxCode
doTestWithStdlib("compiler/testData/codegen/boxWithStdlib/whenStringOptimization/expression.kt");
}
@TestMetadata("nullability.kt")
public void testNullability() throws Exception {
doTestWithStdlib("compiler/testData/codegen/boxWithStdlib/whenStringOptimization/nullability.kt");
}
@TestMetadata("sameHashCode.kt")
public void testSameHashCode() throws Exception {
doTestWithStdlib("compiler/testData/codegen/boxWithStdlib/whenStringOptimization/sameHashCode.kt");