Home | History | Annotate | Download | only in codegen

Lines Matching full:cunit

34  * dataflow analysis and refer to slot numbers in the cUnit->regLocation
36 * entries in the cUnit->reglocation[] array. Therefore, when location
46 extern void dvmCompilerResetRegPool(CompilationUnit *cUnit)
49 for (i=0; i < cUnit->regPool->numCoreTemps; i++) {
50 cUnit->regPool->coreTemps[i].inUse = false;
52 for (i=0; i < cUnit->regPool->numFPTemps; i++) {
53 cUnit->regPool->FPTemps[i].inUse = false;
83 static RegisterInfo *getRegInfo(CompilationUnit *cUnit, int reg)
85 int numTemps = cUnit->regPool->numCoreTemps;
86 RegisterInfo *p = cUnit->regPool->coreTemps;
93 p = cUnit->regPool->FPTemps;
94 numTemps = cUnit->regPool->numFPTemps;
101 dvmCompilerAbort(cUnit);
105 void dvmCompilerFlushRegWide(CompilationUnit *cUnit, int reg1, int reg2)
107 RegisterInfo *info1 = getRegInfo(cUnit, reg1);
108 RegisterInfo *info2 = getRegInfo(cUnit, reg2);
115 if (dvmCompilerS2VReg(cUnit, info2->sReg) <
116 dvmCompilerS2VReg(cUnit, info1->sReg))
118 dvmCompilerFlushRegWideImpl(cUnit, rFP,
119 dvmCompilerS2VReg(cUnit, info1->sReg) << 2,
124 void dvmCompilerFlushReg(CompilationUnit *cUnit, int reg)
126 RegisterInfo *info = getRegInfo(cUnit, reg);
129 dvmCompilerFlushRegImpl(cUnit, rFP,
130 dvmCompilerS2VReg(cUnit, info->sReg) << 2,
136 static bool clobberRegBody(CompilationUnit *cUnit, RegisterInfo *p,
144 dvmCompilerFlushRegWide(cUnit, p[i].reg, p[i].partner);
146 dvmCompilerFlushReg(cUnit, p[i].reg);
156 clobberRegBody(cUnit, p, numTemps, p[i].partner);
165 void dvmCompilerClobber(CompilationUnit *cUnit, int reg)
167 if (!clobberRegBody(cUnit, cUnit->regPool->coreTemps,
168 cUnit->regPool->numCoreTemps, reg)) {
169 clobberRegBody(cUnit, cUnit->regPool->FPTemps,
170 cUnit->regPool->numFPTemps, reg);
187 extern void dvmCompilerClobberSReg(CompilationUnit *cUnit, int sReg)
189 clobberSRegBody(cUnit->regPool->coreTemps, cUnit->regPool->numCoreTemps,
191 clobberSRegBody(cUnit->regPool->FPTemps, cUnit->regPool->numFPTemps,
195 static int allocTempBody(CompilationUnit *cUnit, RegisterInfo *p, int numTemps,
204 dvmCompilerClobber(cUnit, p[next].reg);
217 dvmCompilerClobber(cUnit, p[next].reg);
227 dvmCompilerAbort(cUnit);
233 extern int dvmCompilerAllocTempDouble(CompilationUnit *cUnit)
235 RegisterInfo *p = cUnit->regPool->FPTemps;
236 int numTemps = cUnit->regPool->numFPTemps;
237 int next = cUnit->regPool->nextFPTemp;
248 dvmCompilerClobber(cUnit, p[next].reg);
249 dvmCompilerClobber(cUnit, p[next+1].reg);
254 cUnit->regPool->nextFPTemp += 2;
259 next = cUnit->regPool->nextFPTemp;
264 dvmCompilerClobber(cUnit, p[next].reg);
265 dvmCompilerClobber(cUnit, p[next+1].reg);
270 cUnit->regPool->nextFPTemp += 2;
276 dvmCompilerAbort(cUnit);
281 extern int dvmCompilerAllocFreeTemp(CompilationUnit *cUnit)
283 return allocTempBody(cUnit, cUnit->regPool->coreTemps,
284 cUnit->regPool->numCoreTemps,
285 &cUnit->regPool->nextCoreTemp, true);
288 extern int dvmCompilerAllocTemp(CompilationUnit *cUnit)
290 return allocTempBody(cUnit, cUnit->regPool->coreTemps,
291 cUnit->regPool->numCoreTemps,
292 &cUnit->regPool->nextCoreTemp, true);
295 extern int dvmCompilerAllocTempFloat(CompilationUnit *cUnit)
297 return allocTempBody(cUnit, cUnit->regPool->FPTemps,
298 cUnit->regPool->numFPTemps,
299 &cUnit->regPool->nextFPTemp, true);
316 static RegisterInfo *allocLive(CompilationUnit *cUnit, int sReg,
322 res = allocLiveBody(cUnit->regPool->FPTemps,
323 cUnit->regPool->numFPTemps, sReg);
328 res = allocLiveBody(cUnit->regPool->coreTemps,
329 cUnit->regPool->numCoreTemps, sReg);
332 res = allocLiveBody(cUnit->regPool->FPTemps,
333 cUnit->regPool->numFPTemps, sReg);
337 dvmCompilerAbort(cUnit);
342 extern void dvmCompilerFreeTemp(CompilationUnit *cUnit, int reg)
344 RegisterInfo *p = cUnit->regPool->coreTemps;
345 int numTemps = cUnit->regPool->numCoreTemps;
354 p = cUnit->regPool->FPTemps;
355 numTemps = cUnit->regPool->numFPTemps;
364 dvmCompilerAbort(cUnit);
367 extern RegisterInfo *dvmCompilerIsLive(CompilationUnit *cUnit, int reg)
369 RegisterInfo *p = cUnit->regPool->coreTemps;
370 int numTemps = cUnit->regPool->numCoreTemps;
377 p = cUnit->regPool->FPTemps;
378 numTemps = cUnit->regPool->numFPTemps;
387 extern RegisterInfo *dvmCompilerIsTemp(CompilationUnit *cUnit, int reg)
389 RegisterInfo *p = cUnit->regPool->coreTemps;
390 int numTemps = cUnit->regPool->numCoreTemps;
397 p = cUnit->regPool->FPTemps;
398 numTemps = cUnit->regPool->numFPTemps;
412 extern void dvmCompilerLockTemp(CompilationUnit *cUnit, int reg)
414 RegisterInfo *p = cUnit->regPool->coreTemps;
415 int numTemps = cUnit->regPool->numCoreTemps;
424 p = cUnit->regPool->FPTemps;
425 numTemps = cUnit->regPool->numFPTemps;
434 dvmCompilerAbort(cUnit);
437 extern void dvmCompilerResetDef(CompilationUnit *cUnit, int reg)
439 RegisterInfo *p = getRegInfo(cUnit, reg);
444 static void nullifyRange(CompilationUnit *cUnit, LIR *start, LIR *finish,
463 extern void dvmCompilerMarkDef(CompilationUnit *cUnit, RegLocation rl,
469 RegisterInfo *p = getRegInfo(cUnit, rl.lowReg);
479 extern void dvmCompilerMarkDefWide(CompilationUnit *cUnit, RegLocation rl,
485 RegisterInfo *p = getRegInfo(cUnit, rl.lowReg);
486 dvmCompilerResetDef(cUnit, rl.highReg); // Only track low of pair
491 extern RegLocation dvmCompilerWideToNarrow(CompilationUnit *cUnit,
496 RegisterInfo *infoLo = getRegInfo(cUnit, rl.lowReg);
497 RegisterInfo *infoHi = getRegInfo(cUnit, rl.highReg);
499 dumpRegPool(cUnit->regPool->coreTemps,
500 cUnit->regPool->numCoreTemps);
504 dumpRegPool(cUnit->regPool->coreTemps,
505 cUnit->regPool->numCoreTemps);
523 extern void dvmCompilerResetDefLoc(CompilationUnit *cUnit, RegLocation rl)
527 RegisterInfo *p = getRegInfo(cUnit, rl.lowReg);
529 nullifyRange(cUnit, p->defStart, p->defEnd,
532 cUnit, rl.lowReg);
535 extern void dvmCompilerResetDefLocWide(CompilationUnit *cUnit, RegLocation rl)
539 RegisterInfo *p = getRegInfo(cUnit, rl.lowReg);
541 nullifyRange(cUnit, p->defStart, p->defEnd,
544 dvmCompilerResetDef(cUnit, rl.lowReg);
545 dvmCompilerResetDef(cUnit, rl.highReg);
548 extern void dvmCompilerResetDefTracking(CompilationUnit *cUnit)
551 for (i=0; i< cUnit->regPool->numCoreTemps; i++) {
552 dvmCompilerResetDef(cUnit, cUnit->regPool->coreTemps[i].reg);
554 for (i=0; i< cUnit->regPool->numFPTemps; i++) {
555 dvmCompilerResetDef(cUnit, cUnit->regPool->FPTemps[i].reg);
559 extern void dvmCompilerClobberAllRegs(CompilationUnit *cUnit)
562 for (i=0; i< cUnit->regPool->numCoreTemps; i++) {
563 dvmCompilerClobber(cUnit, cUnit->regPool->coreTemps[i].reg);
565 for (i=0; i< cUnit->regPool->numFPTemps; i++) {
566 dvmCompilerClobber(cUnit, cUnit->regPool->FPTemps[i].reg);
571 extern void dvmCompilerLockAllTemps(CompilationUnit *cUnit)
574 for (i=0; i< cUnit->regPool->numCoreTemps; i++) {
575 dvmCompilerLockTemp(cUnit, cUnit->regPool->coreTemps[i].reg);
580 static void flushAllRegsBody(CompilationUnit *cUnit, RegisterInfo *info,
587 dvmCompilerFlushRegWide(cUnit, info[i].reg, info[i].partner);
589 dvmCompilerFlushReg(cUnit, info[i].reg);
595 extern void dvmCompilerFlushAllRegs(CompilationUnit *cUnit)
597 flushAllRegsBody(cUnit, cUnit->regPool->coreTemps,
598 cUnit->regPool->numCoreTemps);
599 flushAllRegsBody(cUnit, cUnit->regPool->FPTemps,
600 cUnit->regPool->numFPTemps);
601 dvmCompilerClobberAllRegs(cUnit);
617 extern void dvmCompilerMarkLive(CompilationUnit *cUnit, int reg, int sReg)
619 RegisterInfo *info = getRegInfo(cUnit, reg);
623 dvmCompilerClobberSReg(cUnit, sReg);
632 extern void dvmCompilerMarkPair(CompilationUnit *cUnit, int lowReg, int highReg)
634 RegisterInfo *infoLo = getRegInfo(cUnit, lowReg);
635 RegisterInfo *infoHi = getRegInfo(cUnit, highReg);
641 extern void dvmCompilerMarkClean(CompilationUnit *cUnit, int reg)
643 RegisterInfo *info = getRegInfo(cUnit, reg);
647 extern void dvmCompilerMarkDirty(CompilationUnit *cUnit, int reg)
649 RegisterInfo *info = getRegInfo(cUnit, reg);
653 extern void dvmCompilerMarkInUse(CompilationUnit *cUnit, int reg)
655 RegisterInfo *info = getRegInfo(cUnit, reg);
659 static void copyRegInfo(CompilationUnit *cUnit, int newReg, int oldReg)
661 RegisterInfo *newInfo = getRegInfo(cUnit, newReg);
662 RegisterInfo *oldInfo = getRegInfo(cUnit, oldReg);
676 extern RegLocation dvmCompilerUpdateLoc(CompilationUnit *cUnit, RegLocation loc)
680 RegisterInfo *infoLo = allocLive(cUnit, loc.sRegLow, kAnyReg);
683 dvmCompilerClobber(cUnit, infoLo->reg);
684 dvmCompilerClobber(cUnit, infoLo->partner);
696 extern RegLocation dvmCompilerUpdateLocWide(CompilationUnit *cUnit,
702 RegisterInfo *infoLo = allocLive(cUnit, loc.sRegLow, kAnyReg);
703 RegisterInfo *infoHi = allocLive(cUnit,
726 dvmCompilerMarkPair(cUnit, loc.lowReg, loc.highReg);
732 dvmCompilerClobber(cUnit, infoLo->reg);
734 dvmCompilerClobber(cUnit, infoLo->partner);
737 dvmCompilerClobber(cUnit, infoHi->reg);
739 dvmCompilerClobber(cUnit, infoHi->partner);
746 static RegLocation evalLocWide(CompilationUnit *cUnit, RegLocation loc,
754 loc = dvmCompilerUpdateLocWide(cUnit, loc);
762 newRegs = dvmCompilerAllocTypedTempPair(cUnit, loc.fp, regClass);
765 dvmCompilerRegCopyWide(cUnit, lowReg, highReg, loc.lowReg,
767 copyRegInfo(cUnit, lowReg, loc.lowReg);
768 copyRegInfo(cUnit, highReg, loc.highReg);
769 dvmCompilerClobber(cUnit, loc.lowReg);
770 dvmCompilerClobber(cUnit, loc.highReg);
773 dvmCompilerMarkPair(cUnit, loc.lowReg, loc.highReg);
783 newRegs = dvmCompilerAllocTypedTempPair(cUnit, loc.fp, regClass);
787 dvmCompilerMarkPair(cUnit, loc.lowReg, loc.highReg);
790 dvmCompilerMarkLive(cUnit, loc.lowReg, loc.sRegLow);
791 dvmCompilerMarkLive(cUnit, loc.highReg, dvmCompilerSRegHi(loc.sRegLow));
797 extern RegLocation dvmCompilerEvalLoc(CompilationUnit *cUnit, RegLocation loc,
802 return evalLocWide(cUnit, loc, regClass, update);
803 loc = dvmCompilerUpdateLoc(cUnit, loc);
808 newReg = dvmCompilerAllocTypedTemp(cUnit, loc.fp, regClass);
809 dvmCompilerRegCopy(cUnit, newReg, loc.lowReg);
810 copyRegInfo(cUnit, newReg, loc.lowReg);
811 dvmCompilerClobber(cUnit, loc.lowReg);
819 newReg = dvmCompilerAllocTypedTemp(cUnit, loc.fp, regClass);
824 dvmCompilerMarkLive(cUnit, loc.lowReg, loc.sRegLow);
836 extern RegLocation dvmCompilerGetSrc(CompilationUnit *cUnit, MIR *mir, int num)
838 RegLocation loc = cUnit->regLocation[
839 SREG(cUnit, dvmCompilerSSASrc(mir, num))];
840 loc.fp = cUnit->regLocation[dvmCompilerSSASrc(mir, num)].fp;
846 extern RegLocation dvmCompilerGetDest(CompilationUnit *cUnit, MIR *mir,
849 RegLocation loc = cUnit->regLocation[SREG(cUnit, getDestSSAName(mir, num))];
850 loc.fp = cUnit->regLocation[getDestSSAName(mir, num)].fp;
855 static RegLocation getLocWide(CompilationUnit *cUnit, MIR *mir,
862 lowLoc = dvmCompilerGetSrc(cUnit, mir, low);
863 highLoc = dvmCompilerGetSrc(cUnit, mir, high);
865 lowLoc = dvmCompilerGetDest(cUnit, mir, low);
866 highLoc = dvmCompilerGetDest(cUnit, mir, high);
879 extern RegLocation dvmCompilerGetDestWide(CompilationUnit *cUnit, MIR *mir,
882 return getLocWide(cUnit, mir, low, high, false);
885 extern RegLocation dvmCompilerGetSrcWide(CompilationUnit *cUnit, MIR *mir,
888 return getLocWide(cUnit, mir, low, high, true);
892 extern void dvmCompilerKillNullCheckedLoc(CompilationUnit *cUnit,
897 dvmClearBit(cUnit->regPool->nullCheckedRegs, loc.sRegLow);
900 dvmClearBit(cUnit->regPool->nullCheckedRegs,