From 43a364291dcdfe08e530e9568748359735dd7442 Mon Sep 17 00:00:00 2001 From: buzbee Date: Wed, 14 Sep 2011 14:00:13 -0700 Subject: Fix null check elimination The existing null check elimination mechanism suffered from the same limitation as the SSA renaming: it took shortcuts that were valid in a trace compilation world, but not in a method compilation world. This CL replaces the old mechanism, and additionally takes advantage of some the fact that "this" is always non-null, as are objects returned from OP_NEW_* (thanks Ian!). Two test cases added. The one for ensuring that unnecessary null checks are elminated requires manual inspection. The other - that we don't eliminate a necessary null check - is disabled until exceptions are working. Change-Id: I2a9b72741f56617bf609e4d7c20244796c988f28 --- src/compiler/codegen/CodegenFactory.cc | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/compiler/codegen/CodegenFactory.cc') diff --git a/src/compiler/codegen/CodegenFactory.cc b/src/compiler/codegen/CodegenFactory.cc index 5a75cee80b..14c7e5722f 100644 --- a/src/compiler/codegen/CodegenFactory.cc +++ b/src/compiler/codegen/CodegenFactory.cc @@ -127,7 +127,6 @@ static void storeValue(CompilationUnit* cUnit, RegLocation rlDest, LIR* defEnd; assert(!rlDest.wide); assert(!rlSrc.wide); - oatKillNullCheckedLoc(cUnit, rlDest); rlSrc = oatUpdateLoc(cUnit, rlSrc); rlDest = oatUpdateLoc(cUnit, rlDest); if (rlSrc.location == kLocPhysReg) { @@ -190,7 +189,6 @@ static void storeValueWide(CompilationUnit* cUnit, RegLocation rlDest, assert(FPREG(rlSrc.lowReg)==FPREG(rlSrc.highReg)); assert(rlDest.wide); assert(rlSrc.wide); - oatKillNullCheckedLoc(cUnit, rlDest); if (rlSrc.location == kLocPhysReg) { if (oatIsLive(cUnit, rlSrc.lowReg) || oatIsLive(cUnit, rlSrc.highReg) || -- cgit v1.2.3-59-g8ed1b