Jit: Make most Jit compile failures non-fatal; just abort offending translation
Issue 2175597 Jit compile failures should abort translation, but not the VM
Added new dvmCompileAbort() to replace uses of dvmAbort() when something goes
wrong during the compliation of a trace. In that case, we'll abort the translation
and set it's head to the interpret-only "translation".
diff --git a/vm/compiler/codegen/arm/Assemble.c b/vm/compiler/codegen/arm/Assemble.c
index 28dafe7..0d7895f 100644
--- a/vm/compiler/codegen/arm/Assemble.c
+++ b/vm/compiler/codegen/arm/Assemble.c
@@ -934,7 +934,7 @@
int delta = target - pc;
if (delta & 0x3) {
LOGE("PC-rel distance is not multiples of 4: %d\n", delta);
- dvmAbort();
+ dvmCompilerAbort(cUnit);
}
if ((lir->opCode == kThumb2LdrPcRel12) && (delta > 4091)) {
return true;
@@ -978,7 +978,7 @@
int delta = target - pc;
if (delta > 2046 || delta < -2048) {
LOGE("Unconditional branch distance out of range: %d\n", delta);
- dvmAbort();
+ dvmCompilerAbort(cUnit);
}
lir->operands[0] = delta >> 1;
} else if (lir->opCode == kThumbBlx1) {
@@ -1626,7 +1626,7 @@
default:
targetOffset = 0; // make gcc happy
LOGE("Unexpected chaining type: %d", i);
- dvmAbort();
+ dvmAbort(); // dvmAbort OK here - can't safely recover
}
COMPILER_TRACE_CHAINING(
LOGD("Jit Runtime: unchaining 0x%x", (int)pChainCells));