Home | History | Annotate | Download | only in mips

Lines Matching full:cunit

36  * dataflow analysis and refer to slot numbers in the cUnit->regLocation
38 * entries in the cUnit->reglocation[] array. Therefore, when location
48 extern void dvmCompilerResetRegPool(CompilationUnit *cUnit)
51 for (i=0; i < cUnit->regPool->numCoreTemps; i++) {
52 cUnit->regPool->coreTemps[i].inUse = false;
54 for (i=0; i < cUnit->regPool->numFPTemps; i++) {
55 cUnit->regPool->FPTemps[i].inUse = false;
85 static RegisterInfo *getRegInfo(CompilationUnit *cUnit, int reg)
87 int numTemps = cUnit->regPool->numCoreTemps;
88 RegisterInfo *p = cUnit->regPool->coreTemps;
95 p = cUnit->regPool->FPTemps;
96 numTemps = cUnit->regPool->numFPTemps;
103 dvmCompilerAbort(cUnit);
107 static void flushRegWide(CompilationUnit *cUnit, int reg1, int reg2)
109 RegisterInfo *info1 = getRegInfo(cUnit, reg1);
110 RegisterInfo *info2 = getRegInfo(cUnit, reg2);
117 if (dvmCompilerS2VReg(cUnit, info2->sReg) <
118 dvmCompilerS2VReg(cUnit, info1->sReg))
120 dvmCompilerFlushRegWideImpl(cUnit, rFP,
121 dvmCompilerS2VReg(cUnit, info1->sReg) << 2,
126 static void flushReg(CompilationUnit *cUnit, int reg)
128 RegisterInfo *info = getRegInfo(cUnit, reg);
131 dvmCompilerFlushRegImpl(cUnit, rFP,
132 dvmCompilerS2VReg(cUnit, info->sReg) << 2,
138 static bool clobberRegBody(CompilationUnit *cUnit, RegisterInfo *p,
146 flushRegWide(cUnit, p[i].reg, p[i].partner);
148 flushReg(cUnit, p[i].reg);
158 clobberRegBody(cUnit, p, numTemps, p[i].partner);
167 void dvmCompilerClobber(CompilationUnit *cUnit, int reg)
169 if (!clobberRegBody(cUnit, cUnit->regPool->coreTemps,
170 cUnit->regPool->numCoreTemps, reg)) {
171 clobberRegBody(cUnit, cUnit->regPool->FPTemps,
172 cUnit->regPool->numFPTemps, reg);
189 extern void dvmCompilerClobberSReg(CompilationUnit *cUnit, int sReg)
191 clobberSRegBody(cUnit->regPool->coreTemps, cUnit->regPool->numCoreTemps,
193 clobberSRegBody(cUnit->regPool->FPTemps, cUnit->regPool->numFPTemps,
197 static int allocTempBody(CompilationUnit *cUnit, RegisterInfo *p, int numTemps,
206 dvmCompilerClobber(cUnit, p[next].reg);
219 dvmCompilerClobber(cUnit, p[next].reg);
229 dvmCompilerAbort(cUnit);
235 extern int dvmCompilerAllocTempDouble(CompilationUnit *cUnit)
237 RegisterInfo *p = cUnit->regPool->FPTemps;
238 int numTemps = cUnit->regPool->numFPTemps;
240 int start = cUnit->regPool->nextFPTemp + (cUnit->regPool->nextFPTemp & 1);
249 dvmCompilerClobber(cUnit, p[next].reg);
250 dvmCompilerClobber(cUnit, p[next+1].reg);
255 cUnit->regPool->nextFPTemp += 2;
265 dvmCompilerClobber(cUnit, p[next].reg);
266 dvmCompilerClobber(cUnit, p[next+1].reg);
271 cUnit->regPool->nextFPTemp += 2;
277 dvmCompilerAbort(cUnit);
282 extern int dvmCompilerAllocFreeTemp(CompilationUnit *cUnit)
284 return allocTempBody(cUnit, cUnit->regPool->coreTemps,
285 cUnit->regPool->numCoreTemps,
286 &cUnit->regPool->nextCoreTemp, true);
289 extern int dvmCompilerAllocTemp(CompilationUnit *cUnit)
291 return allocTempBody(cUnit, cUnit->regPool->coreTemps,
292 cUnit->regPool->numCoreTemps,
293 &cUnit->regPool->nextCoreTemp, true);
296 extern int dvmCompilerAllocTempFloat(CompilationUnit *cUnit)
298 return allocTempBody(cUnit, cUnit->regPool->FPTemps,
299 cUnit->regPool->numFPTemps,
300 &cUnit->regPool->nextFPTemp, true);
317 static RegisterInfo *allocLive(CompilationUnit *cUnit, int sReg,
323 res = allocLiveBody(cUnit->regPool->FPTemps,
324 cUnit->regPool->numFPTemps, sReg);
329 res = allocLiveBody(cUnit->regPool->coreTemps,
330 cUnit->regPool->numCoreTemps, sReg);
333 res = allocLiveBody(cUnit->regPool->FPTemps,
334 cUnit->regPool->numFPTemps, sReg);
338 dvmCompilerAbort(cUnit);
343 extern void dvmCompilerFreeTemp(CompilationUnit *cUnit, int reg)
345 RegisterInfo *p = cUnit->regPool->coreTemps;
346 int numTemps = cUnit->regPool->numCoreTemps;
355 p = cUnit->regPool->FPTemps;
356 numTemps = cUnit->regPool->numFPTemps;
365 dvmCompilerAbort(cUnit);
372 extern RegisterInfo *dvmCompilerIsLive(CompilationUnit *cUnit, int reg)
374 RegisterInfo *p = cUnit->regPool->coreTemps;
375 int numTemps = cUnit->regPool->numCoreTemps;
382 p = cUnit->regPool->FPTemps;
383 numTemps = cUnit->regPool->numFPTemps;
392 extern RegisterInfo *dvmCompilerIsTemp(CompilationUnit *cUnit, int reg)
394 RegisterInfo *p = cUnit->regPool->coreTemps;
395 int numTemps = cUnit->regPool->numCoreTemps;
402 p = cUnit->regPool->FPTemps;
403 numTemps = cUnit->regPool->numFPTemps;
417 extern void dvmCompilerLockTemp(CompilationUnit *cUnit, int reg)
419 RegisterInfo *p = cUnit->regPool->coreTemps;
420 int numTemps = cUnit->regPool->numCoreTemps;
429 p = cUnit->regPool->FPTemps;
430 numTemps = cUnit->regPool->numFPTemps;
439 dvmCompilerAbort(cUnit);
443 extern void dvmCompilerClobberCallRegs(CompilationUnit *cUnit)
445 dvmCompilerClobber(cUnit, r_ZERO);
446 dvmCompilerClobber(cUnit, r_AT);
447 dvmCompilerClobber(cUnit, r_V0);
448 dvmCompilerClobber(cUnit, r_V1);
449 dvmCompilerClobber(cUnit, r_A0);
450 dvmCompilerClobber(cUnit, r_A1);
451 dvmCompilerClobber(cUnit, r_A2);
452 dvmCompilerClobber(cUnit, r_A3);
453 dvmCompilerClobber(cUnit, r_T0);
454 dvmCompilerClobber(cUnit, r_T1);
455 dvmCompilerClobber(cUnit, r_T2);
456 dvmCompilerClobber(cUnit, r_T3);
457 dvmCompilerClobber(cUnit, r_T4);
458 dvmCompilerClobber(cUnit, r_T5);
459 dvmCompilerClobber(cUnit, r_T6);
460 dvmCompilerClobber(cUnit, r_T7);
461 dvmCompilerClobber(cUnit, r_T8);
462 dvmCompilerClobber(cUnit, r_T9);
463 dvmCompilerClobber(cUnit, r_K0);
464 dvmCompilerClobber(cUnit, r_K1);
465 dvmCompilerClobber(cUnit, r_GP);
466 dvmCompilerClobber(cUnit, r_FP);
467 dvmCompilerClobber(cUnit, r_RA);
468 dvmCompilerClobber(cUnit, r_HI);
469 dvmCompilerClobber(cUnit, r_LO);
470 dvmCompilerClobber(cUnit, r_F0);
471 dvmCompilerClobber(cUnit, r_F1);
472 dvmCompilerClobber(cUnit, r_F2);
473 dvmCompilerClobber(cUnit, r_F3);
474 dvmCompilerClobber(cUnit, r_F4);
475 dvmCompilerClobber(cUnit, r_F5);
476 dvmCompilerClobber(cUnit, r_F6);
477 dvmCompilerClobber(cUnit, r_F7);
478 dvmCompilerClobber(cUnit, r_F8);
479 dvmCompilerClobber(cUnit, r_F9);
480 dvmCompilerClobber(cUnit, r_F10);
481 dvmCompilerClobber(cUnit, r_F11);
482 dvmCompilerClobber(cUnit, r_F12);
483 dvmCompilerClobber(cUnit, r_F13);
484 dvmCompilerClobber(cUnit, r_F14);
485 dvmCompilerClobber(cUnit, r_F15);
489 extern void dvmCompilerClobberHandlerRegs(CompilationUnit *cUnit)
492 dvmCompilerClobberCallRegs(cUnit);
493 dvmCompilerClobber(cUnit, r_S0);
494 dvmCompilerClobber(cUnit, r_S1);
495 dvmCompilerClobber(cUnit, r_S2);
496 dvmCompilerClobber(cUnit, r_S3);
497 dvmCompilerClobber(cUnit, r_S4);
498 dvmCompilerClobber(cUnit, r_S5);
499 dvmCompilerClobber(cUnit, r_S6);
500 dvmCompilerClobber(cUnit, r_S7);
503 extern void dvmCompilerResetDef(CompilationUnit *cUnit, int reg)
505 RegisterInfo *p = getRegInfo(cUnit, reg);
510 static void nullifyRange(CompilationUnit *cUnit, LIR *start, LIR *finish,
529 extern void dvmCompilerMarkDef(CompilationUnit *cUnit, RegLocation rl,
535 RegisterInfo *p = getRegInfo(cUnit, rl.lowReg);
545 extern void dvmCompilerMarkDefWide(CompilationUnit *cUnit, RegLocation rl,
551 RegisterInfo *p = getRegInfo(cUnit, rl.lowReg);
552 dvmCompilerResetDef(cUnit, rl.highReg); // Only track low of pair
557 extern RegLocation dvmCompilerWideToNarrow(CompilationUnit *cUnit,
562 RegisterInfo *infoLo = getRegInfo(cUnit, rl.lowReg);
563 RegisterInfo *infoHi = getRegInfo(cUnit, rl.highReg);
565 dumpRegPool(cUnit->regPool->coreTemps,
566 cUnit->regPool->numCoreTemps);
570 dumpRegPool(cUnit->regPool->coreTemps,
571 cUnit->regPool->numCoreTemps);
595 extern void dvmCompilerResetDefLoc(CompilationUnit *cUnit, RegLocation rl)
599 RegisterInfo *p = getRegInfo(cUnit, rl.lowReg);
601 nullifyRange(cUnit, p->defStart, p->defEnd,
604 dvmCompilerResetDef(cUnit, rl.lowReg);
607 extern void dvmCompilerResetDefLocWide(CompilationUnit *cUnit, RegLocation rl)
611 RegisterInfo *p = getRegInfo(cUnit, rl.lowReg);
613 nullifyRange(cUnit, p->defStart, p->defEnd,
616 dvmCompilerResetDef(cUnit, rl.lowReg);
617 dvmCompilerResetDef(cUnit, rl.highReg);
620 extern void dvmCompilerResetDefTracking(CompilationUnit *cUnit)
623 for (i=0; i< cUnit->regPool->numCoreTemps; i++) {
624 dvmCompilerResetDef(cUnit, cUnit->regPool->coreTemps[i].reg);
626 for (i=0; i< cUnit->regPool->numFPTemps; i++) {
627 dvmCompilerResetDef(cUnit, cUnit->regPool->FPTemps[i].reg);
631 extern void dvmCompilerClobberAllRegs(CompilationUnit *cUnit)
634 for (i=0; i< cUnit->regPool->numCoreTemps; i++) {
635 dvmCompilerClobber(cUnit, cUnit->regPool->coreTemps[i].reg);
637 for (i=0; i< cUnit->regPool->numFPTemps; i++) {
638 dvmCompilerClobber(cUnit, cUnit->regPool->FPTemps[i].reg);
643 extern void dvmCompilerLockAllTemps(CompilationUnit *cUnit)
646 for (i=0; i< cUnit->regPool->numCoreTemps; i++) {
647 dvmCompilerLockTemp(cUnit, cUnit->regPool->coreTemps[i].reg);
652 static void flushAllRegsBody(CompilationUnit *cUnit, RegisterInfo *info,
659 flushRegWide(cUnit, info[i].reg, info[i].partner);
661 flushReg(cUnit, info[i].reg);
667 extern void dvmCompilerFlushAllRegs(CompilationUnit *cUnit)
669 flushAllRegsBody(cUnit, cUnit->regPool->coreTemps,
670 cUnit->regPool->numCoreTemps);
671 flushAllRegsBody(cUnit, cUnit->regPool->FPTemps,
672 cUnit->regPool->numFPTemps);
673 dvmCompilerClobberAllRegs(cUnit);
689 extern void dvmCompilerMarkLive(CompilationUnit *cUnit, int reg, int sReg)
691 RegisterInfo *info = getRegInfo(cUnit, reg);
695 dvmCompilerClobberSReg(cUnit, sReg);
704 extern void dvmCompilerMarkPair(CompilationUnit *cUnit, int lowReg, int highReg)
706 RegisterInfo *infoLo = getRegInfo(cUnit, lowReg);
707 RegisterInfo *infoHi = getRegInfo(cUnit, highReg);
713 extern void dvmCompilerMarkClean(CompilationUnit *cUnit, int reg)
715 RegisterInfo *info = getRegInfo(cUnit, reg);
719 extern void dvmCompilerMarkDirty(CompilationUnit *cUnit, int reg)
721 RegisterInfo *info = getRegInfo(cUnit, reg);
725 extern void dvmCompilerMarkInUse(CompilationUnit *cUnit, int reg)
727 RegisterInfo *info = getRegInfo(cUnit, reg);
731 void copyRegInfo(CompilationUnit *cUnit, int newReg, int oldReg)
733 RegisterInfo *newInfo = getRegInfo(cUnit, newReg);
734 RegisterInfo *oldInfo = getRegInfo(cUnit, oldReg);
748 extern RegLocation dvmCompilerUpdateLoc(CompilationUnit *cUnit, RegLocation loc)
752 RegisterInfo *infoLo = allocLive(cUnit, loc.sRegLow, kAnyReg);
755 dvmCompilerClobber(cUnit, infoLo->reg);
756 dvmCompilerClobber(cUnit, infoLo->partner);
768 extern RegLocation dvmCompilerUpdateLocWide(CompilationUnit *cUnit,
774 RegisterInfo *infoLo = allocLive(cUnit, loc.sRegLow, kAnyReg);
775 RegisterInfo *infoHi = allocLive(cUnit,
798 dvmCompilerMarkPair(cUnit, loc.lowReg, loc.highReg);
804 dvmCompilerClobber(cUnit, infoLo->reg);
806 dvmCompilerClobber(cUnit, infoLo->partner);
809 dvmCompilerClobber(cUnit, infoHi->reg);
811 dvmCompilerClobber(cUnit, infoHi->partner);
818 static RegLocation evalLocWide(CompilationUnit *cUnit, RegLocation loc,
826 loc = dvmCompilerUpdateLocWide(cUnit, loc);
834 newRegs = dvmCompilerAllocTypedTempPair(cUnit, loc.fp, regClass);
837 dvmCompilerRegCopyWide(cUnit, lowReg, highReg, loc.lowReg,
839 copyRegInfo(cUnit, lowReg, loc.lowReg);
840 copyRegInfo(cUnit, highReg, loc.highReg);
841 dvmCompilerClobber(cUnit, loc.lowReg);
842 dvmCompilerClobber(cUnit, loc.highReg);
845 dvmCompilerMarkPair(cUnit, loc.lowReg, loc.highReg);
855 newRegs = dvmCompilerAllocTypedTempPair(cUnit, loc.fp, regClass);
859 dvmCompilerMarkPair(cUnit, loc.lowReg, loc.highReg);
862 dvmCompilerMarkLive(cUnit, loc.lowReg, loc.sRegLow);
863 dvmCompilerMarkLive(cUnit, loc.highReg, dvmCompilerSRegHi(loc.sRegLow));
869 extern RegLocation dvmCompilerEvalLoc(CompilationUnit *cUnit, RegLocation loc,
874 return evalLocWide(cUnit, loc, regClass, update);
875 loc = dvmCompilerUpdateLoc(cUnit, loc);
880 newReg = dvmCompilerAllocTypedTemp(cUnit, loc.fp, regClass);
881 dvmCompilerRegCopy(cUnit, newReg, loc.lowReg);
882 copyRegInfo(cUnit, newReg, loc.lowReg);
883 dvmCompilerClobber(cUnit, loc.lowReg);
891 newReg = dvmCompilerAllocTypedTemp(cUnit, loc.fp, regClass);
896 dvmCompilerMarkLive(cUnit, loc.lowReg, loc.sRegLow);
908 extern RegLocation dvmCompilerGetSrc(CompilationUnit *cUnit, MIR *mir, int num)
910 RegLocation loc = cUnit->regLocation[
911 SREG(cUnit, dvmCompilerSSASrc(mir, num))];
912 loc.fp = cUnit->regLocation[dvmCompilerSSASrc(mir, num)].fp;
918 extern RegLocation dvmCompilerGetDest(CompilationUnit *cUnit, MIR *mir,
921 RegLocation loc = cUnit->regLocation[SREG(cUnit, getDestSSAName(mir, num))];
922 loc.fp = cUnit->regLocation[getDestSSAName(mir, num)].fp;
927 static RegLocation getLocWide(CompilationUnit *cUnit, MIR *mir,
934 lowLoc = dvmCompilerGetSrc(cUnit, mir, low);
935 highLoc = dvmCompilerGetSrc(cUnit, mir, high);
937 lowLoc = dvmCompilerGetDest(cUnit, mir, low);
938 highLoc = dvmCompilerGetDest(cUnit, mir, high);
951 extern RegLocation dvmCompilerGetDestWide(CompilationUnit *cUnit, MIR *mir,
954 return getLocWide(cUnit, mir, low, high, false);
957 extern RegLocation dvmCompilerGetSrcWide(CompilationUnit *cUnit, MIR *mir,
960 return getLocWide(cUnit, mir, low, high, true);
963 extern RegLocation dvmCompilerGetReturnWide(CompilationUnit *cUnit)
966 dvmCompilerClobber(cUnit, r_V0);
967 dvmCompilerClobber(cUnit, r_V1);
968 dvmCompilerMarkInUse(cUnit, r_V0);
969 dvmCompilerMarkInUse(cUnit, r_V1);
970 dvmCompilerMarkPair(cUnit, res.lowReg, res.highReg);
974 extern RegLocation dvmCompilerGetReturn(CompilationUnit *cUnit)
977 dvmCompilerClobber(cUnit, r_V0);
978 dvmCompilerMarkInUse(cUnit, r_V0);
982 extern RegLocation dvmCompilerGetReturnWideAlt(CompilationUnit *cUnit)
985 dvmCompilerClobber(cUnit, r_F0);
986 dvmCompilerClobber(cUnit, r_F1);
987 dvmCompilerMarkInUse(cUnit, r_F0);
988 dvmCompilerMarkInUse(cUnit, r_F1);
989 dvmCompilerMarkPair(cUnit, res.lowReg, res.highReg);
993 extern RegLocation dvmCompilerGetReturnAlt(CompilationUnit *cUnit)
996 dvmCompilerClobber(cUnit, r_F0);
997 dvmCompilerMarkInUse(cUnit, r_F0);
1002 extern void dvmCompilerKillNullCheckedLoc(CompilationUnit *cUnit,
1007 dvmClearBit(cUnit->regPool->nullCheckedRegs, loc.sRegLow);
1010 dvmClearBit(cUnit->regPool->nullCheckedRegs,
1016 extern void dvmCompilerFlushRegWideForV5TEVFP(CompilationUnit *cUnit,
1019 flushRegWide(cUnit, reg1, reg2);
1022 extern void dvmCompilerFlushRegForV5TEVFP(CompilationUnit *cUnit, int reg)
1024 flushReg(cUnit