aboutsummaryrefslogtreecommitdiff
path: root/vm/compiler/codegen/arm/ArchUtility.c
diff options
context:
space:
mode:
Diffstat (limited to 'vm/compiler/codegen/arm/ArchUtility.c')
-rw-r--r--vm/compiler/codegen/arm/ArchUtility.c54
1 files changed, 39 insertions, 15 deletions
diff --git a/vm/compiler/codegen/arm/ArchUtility.c b/vm/compiler/codegen/arm/ArchUtility.c
index 0b76eb58b..be6d56b94 100644
--- a/vm/compiler/codegen/arm/ArchUtility.c
+++ b/vm/compiler/codegen/arm/ArchUtility.c
@@ -25,18 +25,24 @@ static char *shiftNames[4] = {
"ror"};
/* Decode and print a ARM register name */
-static char * decodeRegList(int vector, char *buf)
+static char * decodeRegList(ArmOpcode opcode, int vector, char *buf)
{
int i;
bool printed = false;
buf[0] = 0;
- for (i = 0; i < 8; i++, vector >>= 1) {
+ for (i = 0; i < 16; i++, vector >>= 1) {
if (vector & 0x1) {
+ int regId = i;
+ if (opcode == kThumbPush && i == 8) {
+ regId = rlr;
+ } else if (opcode == kThumbPop && i == 8) {
+ regId = rpc;
+ }
if (printed) {
- sprintf(buf + strlen(buf), ", r%d", i);
+ sprintf(buf + strlen(buf), ", r%d", regId);
} else {
printed = true;
- sprintf(buf, "r%d", i);
+ sprintf(buf, "r%d", regId);
}
}
}
@@ -189,9 +195,10 @@ static void buildInsnString(char *fmt, ArmLIR *lir, char* buf,
}
break;
case 't':
- sprintf(tbuf,"0x%08x",
+ sprintf(tbuf,"0x%08x (L%p)",
(int) baseAddr + lir->generic.offset + 4 +
- (operand << 1));
+ (operand << 1),
+ lir->generic.target);
break;
case 'u': {
int offset_1 = lir->operands[0];
@@ -209,7 +216,7 @@ static void buildInsnString(char *fmt, ArmLIR *lir, char* buf,
strcpy(tbuf, "see above");
break;
case 'R':
- decodeRegList(operand, tbuf);
+ decodeRegList(lir->opcode, operand, tbuf);
break;
default:
strcpy(tbuf,"DecodeError");
@@ -256,10 +263,22 @@ void dvmDumpResourceMask(LIR *lir, u8 mask, const char *prefix)
if (mask & ENCODE_FP_STATUS) {
strcat(buf, "fpcc ");
}
+
+ /* Memory bits */
if (armLIR && (mask & ENCODE_DALVIK_REG)) {
sprintf(buf + strlen(buf), "dr%d%s", armLIR->aliasInfo & 0xffff,
(armLIR->aliasInfo & 0x80000000) ? "(+1)" : "");
}
+ if (mask & ENCODE_LITERAL) {
+ strcat(buf, "lit ");
+ }
+
+ if (mask & ENCODE_HEAP_REF) {
+ strcat(buf, "heap ");
+ }
+ if (mask & ENCODE_MUST_NOT_ALIAS) {
+ strcat(buf, "noalias ");
+ }
}
if (buf[0]) {
LOGD("%s: %s", prefix, buf);
@@ -296,8 +315,6 @@ void dvmDumpLIRInsn(LIR *arg, unsigned char *baseAddr)
case kArmPseudoSSARep:
DUMP_SSA_REP(LOGD("-------- %s\n", (char *) dest));
break;
- case kArmPseudoTargetLabel:
- break;
case kArmPseudoChainingCellBackwardBranch:
LOGD("-------- chaining cell (backward branch): 0x%04x\n", dest);
break;
@@ -338,11 +355,12 @@ void dvmDumpLIRInsn(LIR *arg, unsigned char *baseAddr)
case kArmPseudoEHBlockLabel:
LOGD("Exception_Handling:\n");
break;
+ case kArmPseudoTargetLabel:
case kArmPseudoNormalBlockLabel:
- LOGD("L%#06x:\n", dest);
+ LOGD("L%p:\n", lir);
break;
default:
- if (lir->isNop && !dumpNop) {
+ if (lir->flags.isNop && !dumpNop) {
break;
}
buildInsnString(EncodingMap[lir->opcode].name, lir, opName,
@@ -351,15 +369,15 @@ void dvmDumpLIRInsn(LIR *arg, unsigned char *baseAddr)
256);
LOGD("%p (%04x): %-8s%s%s\n",
baseAddr + offset, offset, opName, buf,
- lir->isNop ? "(nop)" : "");
+ lir->flags.isNop ? "(nop)" : "");
break;
}
- if (lir->useMask && (!lir->isNop || dumpNop)) {
+ if (lir->useMask && (!lir->flags.isNop || dumpNop)) {
DUMP_RESOURCE_MASK(dvmDumpResourceMask((LIR *) lir,
lir->useMask, "use"));
}
- if (lir->defMask && (!lir->isNop || dumpNop)) {
+ if (lir->defMask && (!lir->flags.isNop || dumpNop)) {
DUMP_RESOURCE_MASK(dvmDumpResourceMask((LIR *) lir,
lir->defMask, "def"));
}
@@ -375,7 +393,7 @@ void dvmCompilerCodegenDump(CompilationUnit *cUnit)
LOGD("installed code is at %p\n", cUnit->baseAddr);
LOGD("total size is %d bytes\n", cUnit->totalSize);
for (lirInsn = cUnit->firstLIRInsn; lirInsn; lirInsn = lirInsn->next) {
- dvmDumpLIRInsn(lirInsn, cUnit->baseAddr);
+ dvmDumpLIRInsn(lirInsn, (unsigned char *) cUnit->baseAddr);
}
for (lirInsn = cUnit->wordList; lirInsn; lirInsn = lirInsn->next) {
armLIR = (ArmLIR *) lirInsn;
@@ -385,3 +403,9 @@ void dvmCompilerCodegenDump(CompilationUnit *cUnit)
armLIR->operands[0]);
}
}
+
+/* Target-specific cache flushing */
+int dvmCompilerCacheFlush(long start, long end, long flags)
+{
+ return cacheflush(start, end, flags);
+}