OSDN Git Service

Fix trace builder to not confuse self-verification.
authorBen Cheng <bccheng@google.com>
Fri, 2 Oct 2009 19:58:52 +0000 (12:58 -0700)
committerBen Cheng <bccheng@google.com>
Fri, 2 Oct 2009 19:59:33 +0000 (12:59 -0700)
vm/interp/Jit.c
vm/mterp/c/gotoTargets.c
vm/mterp/out/InterpC-allstubs.c
vm/mterp/out/InterpC-portdbg.c
vm/mterp/out/InterpC-portstd.c
vm/mterp/out/InterpC-x86.c

index aca5fff..5147e9c 100644 (file)
@@ -514,13 +514,6 @@ int dvmCheckJit(const u2* pc, Thread* self, InterpState* interpState)
                           || gDvm.activeProfilers
 #endif
             );
-
-    /* First instruction - just remember the PC and exit */
-    if (interpState->lastPC == NULL) {
-        interpState->lastPC = pc;
-        return switchInterp;
-    }
-
     /* Prepare to handle last PC and stage the current PC */
     const u2 *lastPC = interpState->lastPC;
     interpState->lastPC = pc;
@@ -531,6 +524,8 @@ int dvmCheckJit(const u2* pc, Thread* self, InterpState* interpState)
         int offset;
         DecodedInstruction decInsn;
         case kJitTSelect:
+            /* First instruction - just remember the PC and exit */
+            if (lastPC == NULL) break;
             /* Grow the trace around the last PC if jitState is kJitTSelect */
             dexDecodeInstruction(gDvm.instrFormat, lastPC, &decInsn);
 #if defined(SHOW_TRACE)
index c34d6c4..67b3299 100644 (file)
@@ -578,7 +578,9 @@ GOTO_TARGET(exceptionThrown)
 
 #if defined(WITH_JIT)
         // Something threw during trace selection - abort the current trace
-        interpState->jitState = kJitTSelectEnd;
+        if (interpState->jitState == kJitTSelect) {
+            interpState->jitState = kJitTSelectEnd;
+        }
 #endif
         /*
          * We save off the exception and clear the exception status.  While
index 81e7165..1d31227 100644 (file)
@@ -3611,7 +3611,9 @@ GOTO_TARGET(exceptionThrown)
 
 #if defined(WITH_JIT)
         // Something threw during trace selection - abort the current trace
-        interpState->jitState = kJitTSelectEnd;
+        if (interpState->jitState == kJitTSelect) {
+            interpState->jitState = kJitTSelectEnd;
+        }
 #endif
         /*
          * We save off the exception and clear the exception status.  While
index 45a18da..c2ae63c 100644 (file)
@@ -3911,7 +3911,9 @@ GOTO_TARGET(exceptionThrown)
 
 #if defined(WITH_JIT)
         // Something threw during trace selection - abort the current trace
-        interpState->jitState = kJitTSelectEnd;
+        if (interpState->jitState == kJitTSelect) {
+            interpState->jitState = kJitTSelectEnd;
+        }
 #endif
         /*
          * We save off the exception and clear the exception status.  While
index 3576608..b695b43 100644 (file)
@@ -3625,7 +3625,9 @@ GOTO_TARGET(exceptionThrown)
 
 #if defined(WITH_JIT)
         // Something threw during trace selection - abort the current trace
-        interpState->jitState = kJitTSelectEnd;
+        if (interpState->jitState == kJitTSelect) {
+            interpState->jitState = kJitTSelectEnd;
+        }
 #endif
         /*
          * We save off the exception and clear the exception status.  While
index 6492daf..fa2dfa8 100644 (file)
@@ -1766,7 +1766,9 @@ GOTO_TARGET(exceptionThrown)
 
 #if defined(WITH_JIT)
         // Something threw during trace selection - abort the current trace
-        interpState->jitState = kJitTSelectEnd;
+        if (interpState->jitState == kJitTSelect) {
+            interpState->jitState = kJitTSelectEnd;
+        }
 #endif
         /*
          * We save off the exception and clear the exception status.  While