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/Ralloc.h | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'src/compiler/codegen/Ralloc.h') diff --git a/src/compiler/codegen/Ralloc.h b/src/compiler/codegen/Ralloc.h index 82ce23eb82..ad19475b9b 100644 --- a/src/compiler/codegen/Ralloc.h +++ b/src/compiler/codegen/Ralloc.h @@ -45,12 +45,6 @@ static inline int oatS2VReg(CompilationUnit* cUnit, int sReg) return DECODE_REG(oatConvertSSARegToDalvik(cUnit, sReg)); } -/* Reset the tracker to unknown state */ -static inline void oatResetNullCheck(CompilationUnit* cUnit) -{ - oatClearAllBits(cUnit->regPool->nullCheckedRegs); -} - /* * Get the "real" sreg number associated with an sReg slot. In general, * sReg values passed through codegen are the SSA names created by @@ -161,10 +155,6 @@ extern void oatResetDefLocWide(CompilationUnit* cUnit, RegLocation rl); extern void oatResetDefTracking(CompilationUnit* cUnit); -/* Kill the corresponding bit in the null-checked register list */ -extern void oatKillNullCheckedLoc(CompilationUnit* cUnit, - RegLocation loc); - extern RegisterInfo *oatIsLive(CompilationUnit* cUnit, int reg); /* To be used when explicitly managing register use */ -- cgit v1.2.3-59-g8ed1b