+1
-1
@@ -56,7 +56,7 @@ public class RedundantNullCheckMethodTransformer extends MethodTransformer {
|
|||||||
AbstractInsnNode insn = insnList.get(i);
|
AbstractInsnNode insn = insnList.get(i);
|
||||||
|
|
||||||
if ((insn.getOpcode() == Opcodes.IFNULL || insn.getOpcode() == Opcodes.IFNONNULL) &&
|
if ((insn.getOpcode() == Opcodes.IFNULL || insn.getOpcode() == Opcodes.IFNONNULL) &&
|
||||||
frame.getStack(frame.getStackSize() - 1) instanceof BoxedBasicValue) {
|
frame != null && frame.getStack(frame.getStackSize() - 1) instanceof BoxedBasicValue) {
|
||||||
|
|
||||||
insnsToOptimize.add(insn);
|
insnsToOptimize.add(insn);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
fun box() : String {
|
||||||
|
try {
|
||||||
|
return "OK"
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
null?.hashCode()
|
||||||
|
}
|
||||||
|
}
|
||||||
+5
@@ -119,6 +119,11 @@ public class BlackBoxWithStdlibCodegenTestGenerated extends AbstractBlackBoxCode
|
|||||||
doTestWithStdlib("compiler/testData/codegen/boxWithStdlib/boxingOptimization/fold.kt");
|
doTestWithStdlib("compiler/testData/codegen/boxWithStdlib/boxingOptimization/fold.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("kt5493.kt")
|
||||||
|
public void testKt5493() throws Exception {
|
||||||
|
doTestWithStdlib("compiler/testData/codegen/boxWithStdlib/boxingOptimization/kt5493.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("nullCheck.kt")
|
@TestMetadata("nullCheck.kt")
|
||||||
public void testNullCheck() throws Exception {
|
public void testNullCheck() throws Exception {
|
||||||
doTestWithStdlib("compiler/testData/codegen/boxWithStdlib/boxingOptimization/nullCheck.kt");
|
doTestWithStdlib("compiler/testData/codegen/boxWithStdlib/boxingOptimization/nullCheck.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user