From ed3e930109e3f01804ca32cee4afe4f2d4b3f4d8 Mon Sep 17 00:00:00 2001 From: buzbee Date: Fri, 23 Sep 2011 17:34:19 -0700 Subject: assert to DCHECK conversion Also replaced static function defs with a STATIC macro to make normally hidden functions visible to DCHECK's traceback listing). Additionally, added some portions of the new type & size inference mechanism (but not taking advantage of them yet). Change-Id: Ib42a08777f28ab879d0df37617e1b77e3f09ba52 --- src/compiler/codegen/Ralloc.h | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src/compiler/codegen/Ralloc.h') diff --git a/src/compiler/codegen/Ralloc.h b/src/compiler/codegen/Ralloc.h index ad19475b9b..0c3fbcaea2 100644 --- a/src/compiler/codegen/Ralloc.h +++ b/src/compiler/codegen/Ralloc.h @@ -31,7 +31,7 @@ * Must use a core register for data types narrower than word (due * to possible unaligned load/store. */ -static inline RegisterClass oatRegClassBySize(OpSize size) +STATIC inline RegisterClass oatRegClassBySize(OpSize size) { return (size == kUnsignedHalf || size == kSignedHalf || @@ -39,9 +39,9 @@ static inline RegisterClass oatRegClassBySize(OpSize size) size == kSignedByte ) ? kCoreReg : kAnyReg; } -static inline int oatS2VReg(CompilationUnit* cUnit, int sReg) +STATIC inline int oatS2VReg(CompilationUnit* cUnit, int sReg) { - assert(sReg != INVALID_SREG); + DCHECK_NE(sReg, INVALID_SREG); return DECODE_REG(oatConvertSSARegToDalvik(cUnit, sReg)); } @@ -55,20 +55,20 @@ static inline int oatS2VReg(CompilationUnit* cUnit, int sReg) * identified by the dataflow pass what it's new name is. */ -static inline int oatSRegHi(int lowSreg) { +STATIC inline int oatSRegHi(int lowSreg) { return (lowSreg == INVALID_SREG) ? INVALID_SREG : lowSreg + 1; } -static inline bool oatLiveOut(CompilationUnit* cUnit, int sReg) +STATIC inline bool oatLiveOut(CompilationUnit* cUnit, int sReg) { //For now. return true; } -static inline int oatSSASrc(MIR* mir, int num) +STATIC inline int oatSSASrc(MIR* mir, int num) { - assert(mir->ssaRep->numUses > num); + DCHECK_GT(mir->ssaRep->numUses, num); return mir->ssaRep->uses[num]; } @@ -84,6 +84,9 @@ extern RegLocation oatUpdateLoc(CompilationUnit* cUnit, extern RegLocation oatUpdateLocWide(CompilationUnit* cUnit, RegLocation loc); +extern RegLocation oatUpdateRawLoc(CompilationUnit* cUnit, + RegLocation loc); + extern void oatMarkLive(CompilationUnit* cUnit, int reg, int sReg); extern void oatMarkTemp(CompilationUnit* cUnit, int reg); -- cgit v1.2.3-59-g8ed1b