Jit stress mode: translate everything we can and self verify.

This represents a general clean-up of some existing command-line
options: -Xjitthreshold:num and -Xjitblocking.  The jit threshold
controls how quickly we treat a Dalvik address as a potential trace
head.  Normally this is set around 200 (and the range is 0..255, where
0 is in effect 256 and 1 means begin trace selection on first visit).

-Xjitblocking forces the system to pause execution whenever a translation
request is made and resume when that translation is complete.  Normally
the system make a request but continues execution (to avoid jitter).

Additionally, if WITH_SELF_VERIFICATION is defined, we force blocking
to be true, and set the threshold to 1.  And finally, we treat
threshold==1 as a special case and disable the 2nd-level trace-building
filter - which causes the system to immediately start trace selection.
diff --git a/vm/compiler/Compiler.c b/vm/compiler/Compiler.c
index a44e1c3..b53ebf8 100644
--- a/vm/compiler/Compiler.c
+++ b/vm/compiler/Compiler.c
@@ -96,11 +96,13 @@
 /* Block until queue length is 0 */
 void dvmCompilerDrainQueue(void)
 {
+    int oldStatus = dvmChangeStatus(NULL, THREAD_VMWAIT);
     dvmLockMutex(&gDvmJit.compilerLock);
     while (workQueueLength() != 0 && !gDvmJit.haltCompilerThread) {
         pthread_cond_wait(&gDvmJit.compilerQueueEmpty, &gDvmJit.compilerLock);
     }
     dvmUnlockMutex(&gDvmJit.compilerLock);
+    dvmChangeStatus(NULL, oldStatus);
 }
 
 static void *compilerThreadStart(void *arg)
@@ -135,11 +137,12 @@
                 if (gDvmJit.haltCompilerThread) {
                     LOGD("Compiler shutdown in progress - discarding request");
                 } else {
-                    /* Compilation is successful */
-                    if (dvmCompilerDoWork(&work)) {
-                        dvmJitSetCodeAddr(work.pc, work.result.codeAddress,
-                                          work.result.instructionSet);
+                    /* If compilation failed, use interpret-template */
+                    if (!dvmCompilerDoWork(&work)) {
+                        work.result.codeAddress = gDvmJit.interpretTemplate;
                     }
+                    dvmJitSetCodeAddr(work.pc, work.result.codeAddress,
+                                      work.result.instructionSet);
                 }
                 free(work.info);
                 dvmLockMutex(&gDvmJit.compilerLock);
diff --git a/vm/compiler/codegen/arm/armv7-a/ArchVariant.c b/vm/compiler/codegen/arm/armv7-a/ArchVariant.c
index 02b9b79..a2e4175 100644
--- a/vm/compiler/codegen/arm/armv7-a/ArchVariant.c
+++ b/vm/compiler/codegen/arm/armv7-a/ArchVariant.c
@@ -323,6 +323,7 @@
     if (isDouble) {
         rlSrc1 = loadValueWide(cUnit, rlSrc1, kFPReg);
         rlSrc2 = loadValueWide(cUnit, rlSrc2, kFPReg);
+        clobberSReg(cUnit, rlDest.sRegLow);
         rlResult = evalLoc(cUnit, rlDest, kCoreReg, true);
         loadConstant(cUnit, rlResult.lowReg, defaultResult);
         newLIR2(cUnit, kThumb2Vcmpd, S2D(rlSrc1.lowReg, r1Src2.highReg),
@@ -330,6 +331,7 @@
     } else {
         rlSrc1 = loadValue(cUnit, rlSrc1, kFPReg);
         rlSrc2 = loadValue(cUnit, rlSrc2, kFPReg);
+        clobberSReg(cUnit, rlDest.sRegLow);
         rlResult = evalLoc(cUnit, rlDest, kCoreReg, true);
         loadConstant(cUnit, rlResult.lowReg, defaultResult);
         newLIR2(cUnit, kThumb2Vcmps, rlSrc1.lowReg, rlSrc2.lowReg);