Home | History | Annotate | Download | only in compiler

Lines Matching full:cunit

512 static BasicBlock *splitBlock(CompilationUnit *cUnit,
527 cUnit->numBlocks++);
528 dvmInsertGrowableList(&cUnit->blockList, (intptr_t) bottomBlock);
596 static BasicBlock *findBlock(CompilationUnit *cUnit,
601 GrowableList *blockList = &cUnit->blockList;
613 BasicBlock *newBB = splitBlock(cUnit, codeOffset, bb,
620 bb = dvmCompilerNewBB(kDalvikByteCode, cUnit->numBlocks++);
621 dvmInsertGrowableList(&cUnit->blockList, (intptr_t) bb);
629 void dvmDumpCFG(CompilationUnit *cUnit, const char *dirPrefix)
631 const Method *method = cUnit->method;
635 sprintf(startOffset, "_%x", cUnit->entryBlock->fallThrough->startOffset);
673 int numReachableBlocks = cUnit->numReachableBlocks;
675 const GrowableList *blockList = &cUnit->blockList;
678 int blockIdx = cUnit->dfsOrder.elemList[idx];
695 dvmCompilerFullDisassembler(cUnit, mir) :
797 static bool verifyPredInfo(CompilationUnit *cUnit, BasicBlock *bb)
806 dvmGrowableListGetElement(&cUnit->blockList, blockIdx);
832 dvmDumpCFG(cUnit, "/sdcard/cfg/");
842 static void processTryCatchBlocks(CompilationUnit *cUnit)
844 const Method *meth = cUnit->method;
855 BitVector *tryBlockAddr = cUnit->tryBlockAddr;
888 findBlock(cUnit, handler->address,
902 static void processCanBranch(CompilationUnit *cUnit, BasicBlock *curBlock,
934 BasicBlock *takenBlock = findBlock(cUnit, target,
946 BasicBlock *fallthroughBlock = findBlock(cUnit,
970 findBlock(cUnit, curOffset + width,
982 static void processCanSwitch(CompilationUnit *cUnit, BasicBlock *curBlock,
985 u2 *switchData= (u2 *) (cUnit->method->insns + curOffset +
1036 BasicBlock *caseBlock = findBlock(cUnit, curOffset + targetTable[i],
1055 BasicBlock *fallthroughBlock = findBlock(cUnit,
1068 static void processCanThrow(CompilationUnit *cUnit, BasicBlock *curBlock,
1073 const Method *method = cUnit->method;
1101 BasicBlock *catchBlock = findBlock(cUnit, handler->address,
1120 cUnit->numBlocks++);
1122 dvmInsertGrowableList(&cUnit->blockList, (intptr_t) ehBlock);
1136 BasicBlock *fallthroughBlock = findBlock(cUnit,
1166 CompilationUnit cUnit;
1179 memset(&cUnit, 0, sizeof(cUnit));
1180 cUnit.method = method;
1182 cUnit.jitMode = kJitMethod;
1185 dvmInitGrowableList(&cUnit.blockList, 4);
1192 dvmInitGrowableList(&cUnit.pcReconstructionList, 8);
1197 cUnit.tryBlockAddr = tryBlockAddr;
1203 cUnit.entryBlock = entryBlock;
1204 cUnit.exitBlock = exitBlock;
1206 dvmInsertGrowableList(&cUnit.blockList, (intptr_t) entryBlock);
1207 dvmInsertGrowableList(&cUnit.blockList, (intptr_t) exitBlock);
1212 dvmInsertGrowableList(&cUnit.blockList, (intptr_t) curBlock);
1218 * accessing cUnit.
1220 cUnit.numBlocks = numBlocks;
1223 processTryCatchBlocks(&cUnit);
1242 processCanBranch(&cUnit, curBlock, insn, curOffset, width, flags,
1257 findBlock(&cUnit, curOffset + width,
1267 processCanThrow(&cUnit, curBlock, insn, curOffset, width, flags,
1270 processCanSwitch(&cUnit, curBlock, insn, curOffset, width, flags);
1273 BasicBlock *nextBlock = findBlock(&cUnit, curOffset,
1300 if (cUnit.printMe) {
1301 dvmCompilerDumpCompilationUnit(&cUnit);
1305 cUnit.numDalvikRegisters = cUnit.method->registersSize;
1309 dvmCompilerDataFlowAnalysisDispatcher(&cUnit, verifyPredInfo,
1315 dvmCompilerMethodSSATransformation(&cUnit);
1317 dvmCompilerInitializeRegAlloc(&cUnit); // Needs to happen after SSA naming
1320 dvmCompilerLocalRegAlloc(&cUnit);
1323 dvmCompilerMethodMIR2LIR(&cUnit);
1326 //dvmDumpCFG(&cUnit, "/sdcard/cfg/");
1329 if (cUnit.firstLIRInsn) {
1332 dvmCompilerAssembleLIR(&cUnit, info);
1333 cUnit.assemblerRetries++;
1334 if (cUnit.printMe && cUnit.assemblerStatus != kSuccess)
1335 ALOGD("Assembler abort #%d on %d",cUnit.assemblerRetries,
1336 cUnit.assemblerStatus);
1337 } while (cUnit.assemblerStatus == kRetryAll);
1339 if (cUnit.printMe) {
1340 dvmCompilerCodegenDump(&cUnit);
1357 cUnit, BasicBlock *curBlock)
1360 const u2 *codePtr = cUnit->method->insns + curOffset;
1378 changed |= exhaustTrace(cUnit, curBlock->taken);
1380 changed |= exhaustTrace(cUnit, curBlock->fallThrough);
1400 curBlock->fallThrough = cUnit->exitBlock;
1401 dvmCompilerSetBit(cUnit->exitBlock->predecessors, curBlock->id);
1404 processCanBranch(cUnit, curBlock, insn, curOffset, width, flags,
1407 exhaustTrace(cUnit, curBlock->taken);
1410 exhaustTrace(cUnit, curBlock->fallThrough);
1415 BasicBlock *nextBlock = findBlock(cUnit, curOffset,
1431 curBlock->fallThrough == cUnit->exitBlock);
1450 static bool compileLoop(CompilationUnit *cUnit, unsigned int startOffset,
1463 cUnit->jitMode = kJitLoop;
1466 dvmInitGrowableList(&cUnit->blockList, 4);
1469 dvmInitGrowableList(&cUnit->pcReconstructionList, 8);
1476 cUnit->entryBlock = entryBlock;
1477 cUnit->exitBlock = exitBlock;
1479 dvmInsertGrowableList(&cUnit->blockList, (intptr_t) entryBlock);
1480 dvmInsertGrowableList(&cUnit->blockList, (intptr_t) exitBlock);
1486 dvmInsertGrowableList(&cUnit->blockList, (intptr_t) curBlock);
1492 * accessing cUnit.
1494 cUnit->numBlocks = numBlocks;
1497 dvmCompilerDataFlowAnalysisDispatcher(cUnit,
1501 changed = exhaustTrace(cUnit, curBlock);
1505 bb = dvmCompilerNewBB(kChainingCellBackwardBranch, cUnit->numBlocks++);
1506 dvmInsertGrowableList(&cUnit->blockList, (intptr_t) bb);
1507 cUnit->backChainBlock = bb;
1510 bb = dvmCompilerNewBB(kPCReconstruction, cUnit->numBlocks++);
1511 dvmInsertGrowableList(&cUnit->blockList, (intptr_t) bb);
1514 bb = dvmCompilerNewBB(kExceptionHandling, cUnit->numBlocks++);
1515 dvmInsertGrowableList(&cUnit->blockList, (intptr_t) bb);
1516 cUnit->puntBlock = bb;
1518 cUnit->numDalvikRegisters = cUnit->method->registersSize;
1522 dvmCompilerDataFlowAnalysisDispatcher(cUnit, verifyPredInfo,
1528 if (!dvmCompilerBuildLoop(cUnit))
1531 dvmCompilerLoopOpt(cUnit);
1537 dvmCompilerInsertBackwardChaining(cUnit);
1539 dvmCompilerInitializeRegAlloc(cUnit);
1542 dvmCompilerLocalRegAlloc(cUnit);
1545 dvmCompilerMIR2LIR(cUnit);
1548 if (cUnit->quitLoopMode) {
1549 if (cUnit->printMe || gDvmJit.receivedSIGUSR2) {
1551 cUnit->entryBlock->startOffset);
1558 dvmCompilerAssembleLIR(cUnit, info);
1559 cUnit->assemblerRetries++;
1560 if (cUnit->printMe && cUnit->assemblerStatus != kSuccess)
1561 ALOGD("Assembler abort #%d on %d", cUnit->assemblerRetries,
1562 cUnit->assemblerStatus);
1563 } while (cUnit->assemblerStatus == kRetryAll);
1566 if (cUnit->assemblerStatus == kRetryHalve) {
1570 if (cUnit->printMe || gDvmJit.receivedSIGUSR2) {
1571 ALOGD("Loop trace @ offset %04x", cUnit->entryBlock->startOffset);
1572 dvmCompilerCodegenDump(cUnit);
1582 if (cUnit->hasClassLiterals && info->codeAddress) {
1583 dvmJitInstallClassObjectPointers(cUnit, (char *) info->codeAddress);
1592 assert(cUnit->assemblerStatus == kSuccess);
1596 methodStats->nativeSize += cUnit->totalSize;
1627 CompilationUnit cUnit;
1649 memset(&cUnit, 0, sizeof(CompilationUnit));
1657 cUnit.bailPtr = bailPtr;
1660 cUnit.printMe = gDvmJit.printMe;
1663 cUnit.method = desc->method;
1666 cUnit.traceDesc = desc;
1667 cUnit.jitMode = kJitTrace;
1670 dvmInitGrowableList(&cUnit.pcReconstructionList, 8);
1673 blockList = &cUnit.blockList;
1738 cUnit.allSingleStep = true;
1744 cUnit.printMe = true;
1760 if (cUnit.printMe) {
1774 width = parseInsn(codePtr, &insn->dalvikInsn, cUnit.printMe);
1781 cUnit.numInsts++;
1800 if (cUnit.numInsts >= numMaxInsts) {
1863 cUnit.hasInvoke = true;
1872 return compileLoop(&cUnit, startOffset, desc, numMaxInsts,
1924 cUnit.switchOverflowPad =
2024 cUnit.puntBlock = curBB;
2026 if (cUnit.printMe) {
2042 cUnit.numBlocks = numBlocks;
2045 cUnit.instructionSet = dvmCompilerInstructionSet();
2048 if (cUnit.hasInvoke && !(gDvmJit.disableOpt & (1 << kMethodInlining))) {
2049 dvmCompilerInlineMIR(&cUnit, info);
2052 cUnit.numDalvikRegisters = cUnit.method->registersSize;
2055 dvmInitializeSSAConversion(&cUnit);
2057 dvmCompilerNonLoopAnalysis(&cUnit);
2059 dvmCompilerInitializeRegAlloc(&cUnit); // Needs to happen after SSA naming
2061 if (cUnit.printMe) {
2062 dvmCompilerDumpCompilationUnit(&cUnit);
2066 dvmCompilerLocalRegAlloc(&cUnit);
2069 dvmCompilerMIR2LIR(&cUnit);
2073 dvmCompilerAssembleLIR(&cUnit, info);
2074 cUnit.assemblerRetries++;
2075 if (cUnit.printMe && cUnit.assemblerStatus != kSuccess)
2076 ALOGD("Assembler abort #%d on %d",cUnit.assemblerRetries,
2077 cUnit.assemblerStatus);
2078 } while (cUnit.assemblerStatus == kRetryAll);
2080 if (cUnit.printMe) {
2082 dvmCompilerCodegenDump(&cUnit);
2085 cUnit.numInsts);
2088 if (cUnit.assemblerStatus == kRetryHalve) {
2093 return dvmCompileTrace(desc, cUnit.numInsts / 2, info, bailPtr,
2104 if (cUnit.hasClassLiterals && info->codeAddress) {
2105 dvmJitInstallClassObjectPointers(&cUnit, (char *) info->codeAddress);
2114 assert(cUnit.assemblerStatus == kSuccess);
2116 methodStats->nativeSize += cUnit.totalSize;