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/Compiler.c b/vm/compiler/Compiler.c
index 13749ac..597fbb2 100644
--- a/vm/compiler/Compiler.c
+++ b/vm/compiler/Compiler.c
@@ -479,11 +479,17 @@
                 if (gDvmJit.haltCompilerThread) {
                     LOGD("Compiler shutdown in progress - discarding request");
                 } else if (!gDvmJit.codeCacheFull) {
-                    /* If compilation failed, use interpret-template */
-                    if (!dvmCompilerDoWork(&work)) {
-                        work.result.codeAddress = gDvmJit.interpretTemplate;
+                    bool compileOK = false;
+                    jmp_buf jmpBuf;
+                    work.bailPtr = &jmpBuf;
+                    bool aborted = setjmp(jmpBuf);
+                    if (!aborted) {
+                        compileOK = dvmCompilerDoWork(&work);
                     }
-                    if (!work.result.discardResult) {
+                    if (aborted || !compileOK) {
+                        dvmCompilerArenaReset();
+                        work.result.codeAddress = gDvmJit.interpretTemplate;
+                    } else if (!work.result.discardResult) {
                         dvmJitSetCodeAddr(work.pc, work.result.codeAddress,
                                           work.result.instructionSet);
                     }