return insnWidth;
}
+#define UNKNOWN_TARGET 0xffffffff
+
/*
* Identify block-ending instructions and collect supplemental information
* regarding the following instructions.
case OP_RETURN_WIDE:
case OP_RETURN_OBJECT:
case OP_THROW:
+ *target = UNKNOWN_TARGET;
+ break;
case OP_INVOKE_VIRTUAL:
case OP_INVOKE_VIRTUAL_RANGE:
case OP_INVOKE_INTERFACE:
default:
return false;
- } return true;
+ }
+ return true;
}
/*
/* Target block not included in the trace */
if (curBB->taken == NULL &&
- (isInvoke || (targetOffset != curOffset))) {
+ (isInvoke || (targetOffset != UNKNOWN_TARGET &&
+ targetOffset != curOffset))) {
BasicBlock *newBB;
if (isInvoke) {
/* Monomorphic callee */
break;
#endif
default:
- dvmAbort();
+ if (!debugOrProfile) {
+ LOGE("Unexpected JIT state: %d", interpState->jitState);
+ dvmAbort();
+ }
+ break;
}
return switchInterp;
}
#endif
break;
default:
+ LOGE("Unexpected JIT state: %d", interpState->jitState);
dvmAbort();
}
}
common_selectTrace:
mov r2,#kJitTSelectRequest @ ask for trace selection
str r2,[rGLUE,#offGlue_jitState]
+ mov r2,#kInterpEntryInstr @ normal entry reason
+ str r2,[rGLUE,#offGlue_entryPoint]
mov r1,#1 @ set changeInterp
b common_gotoBail
common_periodicChecks:
ldr r3, [rGLUE, #offGlue_pSelfSuspendCount] @ r3<- &suspendCount
+ @ speculatively store r0 before it is clobbered by dvmCheckSuspendPending
+ str r0, [rGLUE, #offGlue_entryPoint]
+
#if defined(WITH_DEBUGGER)
ldr r1, [rGLUE, #offGlue_pDebuggerActive] @ r1<- &debuggerActive
#endif
3: @ debugger/profiler enabled, bail out
add rPC, rPC, r9 @ update rPC
- str r0, [rGLUE, #offGlue_entryPoint]
mov r1, #1 @ "want switch" = true
b common_gotoBail
common_selectTrace:
mov r2,#kJitTSelectRequest @ ask for trace selection
str r2,[rGLUE,#offGlue_jitState]
+ mov r2,#kInterpEntryInstr @ normal entry reason
+ str r2,[rGLUE,#offGlue_entryPoint]
mov r1,#1 @ set changeInterp
b common_gotoBail
common_periodicChecks:
ldr r3, [rGLUE, #offGlue_pSelfSuspendCount] @ r3<- &suspendCount
+ @ speculatively store r0 before it is clobbered by dvmCheckSuspendPending
+ str r0, [rGLUE, #offGlue_entryPoint]
+
#if defined(WITH_DEBUGGER)
ldr r1, [rGLUE, #offGlue_pDebuggerActive] @ r1<- &debuggerActive
#endif
3: @ debugger/profiler enabled, bail out
add rPC, rPC, r9 @ update rPC
- str r0, [rGLUE, #offGlue_entryPoint]
mov r1, #1 @ "want switch" = true
b common_gotoBail
common_selectTrace:
mov r2,#kJitTSelectRequest @ ask for trace selection
str r2,[rGLUE,#offGlue_jitState]
+ mov r2,#kInterpEntryInstr @ normal entry reason
+ str r2,[rGLUE,#offGlue_entryPoint]
mov r1,#1 @ set changeInterp
b common_gotoBail
common_periodicChecks:
ldr r3, [rGLUE, #offGlue_pSelfSuspendCount] @ r3<- &suspendCount
+ @ speculatively store r0 before it is clobbered by dvmCheckSuspendPending
+ str r0, [rGLUE, #offGlue_entryPoint]
+
#if defined(WITH_DEBUGGER)
ldr r1, [rGLUE, #offGlue_pDebuggerActive] @ r1<- &debuggerActive
#endif
3: @ debugger/profiler enabled, bail out
add rPC, rPC, r9 @ update rPC
- str r0, [rGLUE, #offGlue_entryPoint]
mov r1, #1 @ "want switch" = true
b common_gotoBail
common_selectTrace:
mov r2,#kJitTSelectRequest @ ask for trace selection
str r2,[rGLUE,#offGlue_jitState]
+ mov r2,#kInterpEntryInstr @ normal entry reason
+ str r2,[rGLUE,#offGlue_entryPoint]
mov r1,#1 @ set changeInterp
b common_gotoBail
common_periodicChecks:
ldr r3, [rGLUE, #offGlue_pSelfSuspendCount] @ r3<- &suspendCount
+ @ speculatively store r0 before it is clobbered by dvmCheckSuspendPending
+ str r0, [rGLUE, #offGlue_entryPoint]
+
#if defined(WITH_DEBUGGER)
ldr r1, [rGLUE, #offGlue_pDebuggerActive] @ r1<- &debuggerActive
#endif
3: @ debugger/profiler enabled, bail out
add rPC, rPC, r9 @ update rPC
- str r0, [rGLUE, #offGlue_entryPoint]
mov r1, #1 @ "want switch" = true
b common_gotoBail
common_selectTrace:
mov r2,#kJitTSelectRequest @ ask for trace selection
str r2,[rGLUE,#offGlue_jitState]
+ mov r2,#kInterpEntryInstr @ normal entry reason
+ str r2,[rGLUE,#offGlue_entryPoint]
mov r1,#1 @ set changeInterp
b common_gotoBail
common_periodicChecks:
ldr r3, [rGLUE, #offGlue_pSelfSuspendCount] @ r3<- &suspendCount
+ @ speculatively store r0 before it is clobbered by dvmCheckSuspendPending
+ str r0, [rGLUE, #offGlue_entryPoint]
+
#if defined(WITH_DEBUGGER)
ldr r1, [rGLUE, #offGlue_pDebuggerActive] @ r1<- &debuggerActive
#endif
3: @ debugger/profiler enabled, bail out
add rPC, rPC, r9 @ update rPC
- str r0, [rGLUE, #offGlue_entryPoint]
mov r1, #1 @ "want switch" = true
b common_gotoBail
checkDebugAndProf(pc, fp, self, curMethod, &debugIsMethodEntry)
#if defined(WITH_JIT)
-#define CHECK_JIT() \
- if (dvmCheckJit(pc, self, interpState)) GOTO_bail_switch()
+#define CHECK_JIT() (dvmCheckJit(pc, self, interpState))
#else
-#define CHECK_JIT() \
- ((void)0)
+#define CHECK_JIT() (0)
#endif
/* File: portable/stubdefs.c */
inst = FETCH(0); \
CHECK_DEBUG_AND_PROF(); \
CHECK_TRACKED_REFS(); \
- CHECK_JIT(); \
+ if (CHECK_JIT()) GOTO_bail_switch(); \
goto *handlerTable[INST_INST(inst)]; \
}
#else
} \
}
-
/* File: c/opcommon.c */
/* forward declarations of goto targets */
GOTO_TARGET_DECL(filledNewArray, bool methodCallRange);
/* just fall through to instruction loop or threaded kickstart */
break;
case kInterpEntryReturn:
+ CHECK_JIT();
goto returnFromMethod;
case kInterpEntryThrow:
goto exceptionThrown;
#define CHECK_DEBUG_AND_PROF() ((void)0)
-#define CHECK_JIT() ((void)0)
+#define CHECK_JIT() (0)
/* File: portable/stubdefs.c */
/*
inst = FETCH(0); \
CHECK_DEBUG_AND_PROF(); \
CHECK_TRACKED_REFS(); \
- CHECK_JIT(); \
+ if (CHECK_JIT()) GOTO_bail_switch(); \
goto *handlerTable[INST_INST(inst)]; \
}
#else
} \
}
-
/* File: c/opcommon.c */
/* forward declarations of goto targets */
GOTO_TARGET_DECL(filledNewArray, bool methodCallRange);
/* just fall through to instruction loop or threaded kickstart */
break;
case kInterpEntryReturn:
+ CHECK_JIT();
goto returnFromMethod;
case kInterpEntryThrow:
goto exceptionThrown;
/* just fall through to instruction loop or threaded kickstart */
break;
case kInterpEntryReturn:
+ CHECK_JIT();
goto returnFromMethod;
case kInterpEntryThrow:
goto exceptionThrown;
checkDebugAndProf(pc, fp, self, curMethod, &debugIsMethodEntry)
#if defined(WITH_JIT)
-#define CHECK_JIT() \
- if (dvmCheckJit(pc, self, interpState)) GOTO_bail_switch()
+#define CHECK_JIT() (dvmCheckJit(pc, self, interpState))
#else
-#define CHECK_JIT() \
- ((void)0)
+#define CHECK_JIT() (0)
#endif
#define CHECK_DEBUG_AND_PROF() ((void)0)
-#define CHECK_JIT() ((void)0)
+#define CHECK_JIT() (0)
inst = FETCH(0); \
CHECK_DEBUG_AND_PROF(); \
CHECK_TRACKED_REFS(); \
- CHECK_JIT(); \
+ if (CHECK_JIT()) GOTO_bail_switch(); \
goto *handlerTable[INST_INST(inst)]; \
}
#else
GOTO_bail_switch(); \
} \
}
-