aboutsummaryrefslogtreecommitdiff
path: root/vm/compiler/codegen/arm/CodegenDriver.c
diff options
context:
space:
mode:
authorBill Buzbee <buzbee@google.com>2010-03-06 23:30:57 -0800
committerBill Buzbee <buzbee@google.com>2010-03-07 08:24:00 -0800
commitfc519dc8f4444f6d93806ec15ce7445b322070fd (patch)
tree7128bbc741b5125cbe85300e1cd264ab3aca6bde /vm/compiler/codegen/arm/CodegenDriver.c
parent164d1279b67ec13061e473cb453b1ff24189e0e0 (diff)
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".
Diffstat (limited to 'vm/compiler/codegen/arm/CodegenDriver.c')
-rw-r--r--vm/compiler/codegen/arm/CodegenDriver.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/vm/compiler/codegen/arm/CodegenDriver.c b/vm/compiler/codegen/arm/CodegenDriver.c
index a49615212..21a52d839 100644
--- a/vm/compiler/codegen/arm/CodegenDriver.c
+++ b/vm/compiler/codegen/arm/CodegenDriver.c
@@ -612,7 +612,7 @@ static bool genArithOpLong(CompilationUnit *cUnit, MIR *mir,
}
default:
LOGE("Invalid long arith op");
- dvmAbort();
+ dvmCompilerAbort(cUnit);
}
if (!callOut) {
genLong3Addr(cUnit, firstOp, secondOp, rlDest, rlSrc1, rlSrc2);
@@ -716,7 +716,7 @@ static bool genArithOpInt(CompilationUnit *cUnit, MIR *mir,
default:
LOGE("Invalid word arith op: 0x%x(%d)",
mir->dalvikInsn.opCode, mir->dalvikInsn.opCode);
- dvmAbort();
+ dvmCompilerAbort(cUnit);
}
if (!callOut) {
rlSrc1 = loadValue(cUnit, rlSrc1, kCoreReg);
@@ -1836,7 +1836,7 @@ static bool handleFmt21t(CompilationUnit *cUnit, MIR *mir, BasicBlock *bb,
default:
cond = 0;
LOGE("Unexpected opcode (%d) for Fmt21t\n", dalvikOpCode);
- dvmAbort();
+ dvmCompilerAbort(cUnit);
}
genConditionalBranch(cUnit, cond, &labelList[bb->taken->id]);
/* This mostly likely will be optimized away in a later phase */
@@ -2234,7 +2234,7 @@ static bool handleFmt22t(CompilationUnit *cUnit, MIR *mir, BasicBlock *bb,
default:
cond = 0;
LOGE("Unexpected opcode (%d) for Fmt22t\n", dalvikOpCode);
- dvmAbort();
+ dvmCompilerAbort(cUnit);
}
genConditionalBranch(cUnit, cond, &labelList[bb->taken->id]);
/* This mostly likely will be optimized away in a later phase */
@@ -3106,7 +3106,7 @@ static bool handleExecuteInline(CompilationUnit *cUnit, MIR *mir)
case INLINE_MATH_SIN:
break; /* Handle with C routine */
default:
- dvmAbort();
+ dvmCompilerAbort(cUnit);
}
dvmCompilerFlushAllRegs(cUnit); /* Everything to home location */
dvmCompilerClobberCallRegs(cUnit);
@@ -3723,7 +3723,7 @@ void dvmCompilerMIR2LIR(CompilationUnit *cUnit)
mir->offset,
dalvikOpCode, getOpcodeName(dalvikOpCode),
dalvikFormat);
- dvmAbort();
+ dvmCompilerAbort(cUnit);
break;
}
}
@@ -3804,8 +3804,7 @@ gen_fallthrough:
#endif
default:
LOGE("Bad blocktype %d", blockList[blockId]->blockType);
- dvmAbort();
- break;
+ dvmCompilerAbort(cUnit);
}
}
}
@@ -3851,19 +3850,22 @@ bool dvmCompilerDoWork(CompilerWorkOrder *work)
break;
case kWorkOrderTrace:
/* Start compilation with maximally allowed trace length */
- res = dvmCompileTrace(work->info, JIT_MAX_TRACE_LEN, &work->result);
+ res = dvmCompileTrace(work->info, JIT_MAX_TRACE_LEN, &work->result,
+ work->bailPtr);
break;
case kWorkOrderTraceDebug: {
bool oldPrintMe = gDvmJit.printMe;
gDvmJit.printMe = true;
/* Start compilation with maximally allowed trace length */
- res = dvmCompileTrace(work->info, JIT_MAX_TRACE_LEN, &work->result);
+ res = dvmCompileTrace(work->info, JIT_MAX_TRACE_LEN, &work->result,
+ work->bailPtr);
gDvmJit.printMe = oldPrintMe;;
break;
}
default:
res = false;
- dvmAbort();
+ LOGE("Jit: unknown work order type");
+ assert(0); // Bail if debug build, discard oteherwise
}
return res;
}
@@ -3923,7 +3925,7 @@ bool dvmCompilerArchInit()
if (EncodingMap[i].opCode != i) {
LOGE("Encoding order for %s is wrong: expecting %d, seeing %d",
EncodingMap[i].name, i, EncodingMap[i].opCode);
- dvmAbort();
+ dvmAbort(); // OK to dvmAbort - build error
}
}