Jit: Phase 1 of register utility cleanup/rewrite - the great renaming
Renaming of all of those register utilities which used to be local because
of our include mechanism to the standard dvmCompiler prefix scheme.
diff --git a/vm/compiler/codegen/arm/Ralloc.h b/vm/compiler/codegen/arm/Ralloc.h
index dce1939..987638a 100644
--- a/vm/compiler/codegen/arm/Ralloc.h
+++ b/vm/compiler/codegen/arm/Ralloc.h
@@ -27,19 +27,14 @@
#include "compiler/Dataflow.h"
#include "compiler/codegen/arm/ArmLIR.h"
-/*
- * The following are register allocation routines exposed to the code generator
- * FIXME - dvmCompiler prefixes are not added yet
- */
-
-static inline int sReg2vReg(CompilationUnit *cUnit, int sReg)
+static inline int dvmCompilerS2VReg(CompilationUnit *cUnit, int sReg)
{
assert(sReg != INVALID_SREG);
return DECODE_REG(dvmConvertSSARegToDalvik(cUnit, sReg));
}
/* Reset the tracker to unknown state */
-static inline void resetNullCheckTracker(CompilationUnit *cUnit)
+static inline void dvmCompilerResetNullCheck(CompilationUnit *cUnit)
{
dvmClearAllBits(cUnit->regPool->nullCheckedRegs);
}
@@ -54,138 +49,144 @@
* identified by the dataflow pass what it's new name is.
*/
-static inline int hiSReg(int lowSreg) {
+static inline int dvmCompilerSRegHi(int lowSreg) {
return (lowSreg == INVALID_SREG) ? INVALID_SREG : lowSreg + 1;
}
-static inline bool liveOut(CompilationUnit *cUnit, int sReg)
+static inline bool dvmCompilerLiveOut(CompilationUnit *cUnit, int sReg)
{
//TODO: fully implement
return true;
}
-static inline int getSrcSSAName(MIR *mir, int num)
+static inline int dvmCompilerSSASrc(MIR *mir, int num)
{
assert(mir->ssaRep->numUses > num);
return mir->ssaRep->uses[num];
}
-extern RegLocation evalLoc(CompilationUnit *cUnit, RegLocation loc,
- int regClass, bool update);
+extern RegLocation dvmCompilerEvalLoc(CompilationUnit *cUnit, RegLocation loc,
+ int regClass, bool update);
/* Mark a temp register as dead. Does not affect allocation state. */
-extern void clobberReg(CompilationUnit *cUnit, int reg);
+extern void dvmCompilerClobber(CompilationUnit *cUnit, int reg);
-extern RegLocation updateLoc(CompilationUnit *cUnit, RegLocation loc);
+extern RegLocation dvmCompilerUpdateLoc(CompilationUnit *cUnit,
+ RegLocation loc);
/* see comments for updateLoc */
-extern RegLocation updateLocWide(CompilationUnit *cUnit, RegLocation loc);
+extern RegLocation dvmCompilerUpdateLocWide(CompilationUnit *cUnit,
+ RegLocation loc);
/* Clobber all of the temps that might be used by a handler. */
-extern void clobberHandlerRegs(CompilationUnit *cUnit);
+extern void dvmCompilerClobberHandlerRegs(CompilationUnit *cUnit);
-extern void markRegLive(CompilationUnit *cUnit, int reg, int sReg);
+extern void dvmCompilerMarkLive(CompilationUnit *cUnit, int reg, int sReg);
-extern void markRegDirty(CompilationUnit *cUnit, int reg);
+extern void dvmCompilerMarkDirty(CompilationUnit *cUnit, int reg);
-extern void markRegPair(CompilationUnit *cUnit, int lowReg, int highReg);
+extern void dvmCompilerMarkPair(CompilationUnit *cUnit, int lowReg,
+ int highReg);
-extern void markRegClean(CompilationUnit *cUnit, int reg);
+extern void dvmCompilerMarkClean(CompilationUnit *cUnit, int reg);
-extern void resetDef(CompilationUnit *cUnit, int reg);
+extern void dvmCompilerResetDef(CompilationUnit *cUnit, int reg);
-extern void resetDefLoc(CompilationUnit *cUnit, RegLocation rl);
+extern void dvmCompilerResetDefLoc(CompilationUnit *cUnit, RegLocation rl);
/* Set up temp & preserved register pools specialized by target */
-extern void initPool(RegisterInfo *regs, int *regNums, int num);
+extern void dvmCompilerInitPool(RegisterInfo *regs, int *regNums, int num);
/*
* Mark the beginning and end LIR of a def sequence. Note that
* on entry start points to the LIR prior to the beginning of the
* sequence.
*/
-extern void markDef(CompilationUnit *cUnit, RegLocation rl,
- LIR *start, LIR *finish);
+extern void dvmCompilerMarkDef(CompilationUnit *cUnit, RegLocation rl,
+ LIR *start, LIR *finish);
/*
* Mark the beginning and end LIR of a def sequence. Note that
* on entry start points to the LIR prior to the beginning of the
* sequence.
*/
-extern void markDefWide(CompilationUnit *cUnit, RegLocation rl,
- LIR *start, LIR *finish);
+extern void dvmCompilerMarkDefWide(CompilationUnit *cUnit, RegLocation rl,
+ LIR *start, LIR *finish);
-extern RegLocation getSrcLocWide(CompilationUnit *cUnit, MIR *mir,
+extern RegLocation dvmCompilerGetSrcWide(CompilationUnit *cUnit, MIR *mir,
int low, int high);
-extern RegLocation getDestLocWide(CompilationUnit *cUnit, MIR *mir,
- int low, int high);
+extern RegLocation dvmCompilerGetDestWide(CompilationUnit *cUnit, MIR *mir,
+ int low, int high);
// Get the LocRecord associated with an SSA name use.
-extern RegLocation getSrcLoc(CompilationUnit *cUnit, MIR *mir, int num);
+extern RegLocation dvmCompilerGetSrc(CompilationUnit *cUnit, MIR *mir, int num);
// Get the LocRecord associated with an SSA name def.
-extern RegLocation getDestLoc(CompilationUnit *cUnit, MIR *mir, int num);
+extern RegLocation dvmCompilerGetDest(CompilationUnit *cUnit, MIR *mir,
+ int num);
-extern RegLocation getReturnLocWide(CompilationUnit *cUnit);
+extern RegLocation dvmCompilerGetReturnWide(CompilationUnit *cUnit);
/* Clobber all regs that might be used by an external C call */
-extern void clobberCallRegs(CompilationUnit *cUnit);
+extern void dvmCompilerColbberCallRegs(CompilationUnit *cUnit);
-extern RegisterInfo *isTemp(CompilationUnit *cUnit, int reg);
+extern RegisterInfo *dvmCompilerIsTemp(CompilationUnit *cUnit, int reg);
-extern void markRegInUse(CompilationUnit *cUnit, int reg);
+extern void dvmcompilerMarkInUse(CompilationUnit *cUnit, int reg);
-extern int allocTemp(CompilationUnit *cUnit);
+extern int dvmCompilerAllocTemp(CompilationUnit *cUnit);
-extern int allocTempFloat(CompilationUnit *cUnit);
+extern int dvmCompilerAllocTempFloat(CompilationUnit *cUnit);
//REDO: too many assumptions.
-extern int allocTempDouble(CompilationUnit *cUnit);
+extern int dvmCompilerAllocTempDouble(CompilationUnit *cUnit);
-extern void freeTemp(CompilationUnit *cUnit, int reg);
+extern void dvmCompilerFreeTemp(CompilationUnit *cUnit, int reg);
-extern void resetDefLocWide(CompilationUnit *cUnit, RegLocation rl);
+extern void dvmCompilerResetDefLocWide(CompilationUnit *cUnit, RegLocation rl);
-extern void resetDefTracking(CompilationUnit *cUnit);
+extern void dvmCompilerResetDefTracking(CompilationUnit *cUnit);
/* Kill the corresponding bit in the null-checked register list */
-extern void killNullCheckedLocation(CompilationUnit *cUnit, RegLocation loc);
+extern void dvmCompilerKillNullCheckedLoc(CompilationUnit *cUnit,
+ RegLocation loc);
//FIXME - this needs to also check the preserved pool.
-extern RegisterInfo *isLive(CompilationUnit *cUnit, int reg);
+extern RegisterInfo *dvmCompilerIsLive(CompilationUnit *cUnit, int reg);
/* To be used when explicitly managing register use */
-extern void lockAllTemps(CompilationUnit *cUnit);
+extern void dvmCompilerLockAllTemps(CompilationUnit *cUnit);
-extern void flushAllRegs(CompilationUnit *cUnit);
+extern void dvmCompilerFlushAllRegs(CompilationUnit *cUnit);
-extern RegLocation getReturnLocWideAlt(CompilationUnit *cUnit);
+extern RegLocation dvmCompilerGetReturnWideAlt(CompilationUnit *cUnit);
-extern RegLocation getReturnLoc(CompilationUnit *cUnit);
+extern RegLocation dvmCompilerGetReturn(CompilationUnit *cUnit);
-extern RegLocation getReturnLocAlt(CompilationUnit *cUnit);
+extern RegLocation dvmCompilerGetReturnAlt(CompilationUnit *cUnit);
/* Clobber any temp associated with an sReg. Could be in either class */
-extern void clobberSReg(CompilationUnit *cUnit, int sReg);
+extern void dvmCompilerClobberSReg(CompilationUnit *cUnit, int sReg);
/* Return a temp if one is available, -1 otherwise */
-extern int allocFreeTemp(CompilationUnit *cUnit);
+extern int dvmCompilerAllocFreeTemp(CompilationUnit *cUnit);
/*
- * Similar to allocTemp(), but forces the allocation of a specific
+ * Similar to dvmCompilerAllocTemp(), but forces the allocation of a specific
* register. No check is made to see if the register was previously
* allocated. Use with caution.
*/
-extern void lockTemp(CompilationUnit *cUnit, int reg);
+extern void dvmCompilerLockTemp(CompilationUnit *cUnit, int reg);
-extern RegLocation wideToNarrowLoc(CompilationUnit *cUnit, RegLocation rl);
+extern RegLocation dvmCompilerWideToNarrow(CompilationUnit *cUnit,
+ RegLocation rl);
/*
* Free all allocated temps in the temp pools. Note that this does
* not affect the "liveness" of a temp register, which will stay
* live until it is either explicitly killed or reallocated.
*/
-extern void resetRegPool(CompilationUnit *cUnit);
+extern void dvmCompilerResetRegPool(CompilationUnit *cUnit);
-extern void clobberAllRegs(CompilationUnit *cUnit);
+extern void dvmCompilerClobberAllRegs(CompilationUnit *cUnit);
-extern void resetDefTracking(CompilationUnit *cUnit);
+extern void dvmCompilerResetDefTracking(CompilationUnit *cUnit);