#ifdef WITH_JIT
if (gDvm.executionMode == kExecutionModeJit) {
- if (!dvmJitStartup())
+ if (!dvmCompilerStartup())
return false;
}
#endif
#ifdef WITH_JIT
if (gDvm.executionMode == kExecutionModeJit) {
/* shut down the compiler thread */
- dvmJitShutdown();
+ dvmCompilerShutdown();
}
#endif
else if (gDvm.verboseShutdown)
LOGD("Compiler thread has shut down\n");
}
-}
+ if (gDvm.verboseShutdown)
+ dvmCompilerDumpStats();
+
+ dvmDestroyMutex(&gDvmJit.tableLock);
+ dvmDestroyMutex(&gDvmJit.compilerLock);
+ dvmDestroyMutex(&gDvmJit.compilerICPatchLock);
+
+ if (gDvmJit.pJitEntryTable) {
+ free(gDvmJit.pJitEntryTable);
+ gDvmJit.pJitEntryTable = NULL;
+ }
+
+ if (gDvmJit.pProfTable) {
+ free(gDvmJit.pProfTable);
+ gDvmJit.pProfTable = NULL;
+ }
+
+}
void dvmCompilerStateRefresh()
{
}
#endif
-int dvmJitStartup(void)
-{
- unsigned int i;
- bool res = true; /* Assume success */
-
- // Create the compiler thread, which will complete initialization
- if (gDvm.executionMode == kExecutionModeJit) {
- res = dvmCompilerStartup();
- }
- return res;
-}
-
/*
* If one of our fixed tables or the translation buffer fills up,
* call this routine to avoid wasting cycles on future translation requests.
}
-/*
- * Final JIT shutdown. Only do this once, and do not attempt to restart
- * the JIT later.
- */
-void dvmJitShutdown(void)
-{
- /* Shutdown the compiler thread */
-
- dvmCompilerShutdown();
-
- if (gDvm.verboseShutdown)
- dvmCompilerDumpStats();
-
- dvmDestroyMutex(&gDvmJit.tableLock);
-
- if (gDvmJit.pJitEntryTable) {
- free(gDvmJit.pJitEntryTable);
- gDvmJit.pJitEntryTable = NULL;
- }
-
- if (gDvmJit.pProfTable) {
- free(gDvmJit.pProfTable);
- gDvmJit.pProfTable = NULL;
- }
-}
-
void setTraceConstruction(JitEntry *slot, bool value)
{
void* codeAddress; /* Code address of native translation */
} JitEntry;
-int dvmJitStartup(void);
-void dvmJitShutdown(void);
int dvmCheckJit(const u2* pc, Thread* self, InterpState* interpState);
void* dvmJitGetCodeAddr(const u2* dPC);
bool dvmJitCheckTraceRequest(Thread* self, InterpState* interpState);
JValue* pResult)
{
#if defined(WITH_JIT)
- dvmLockMutex(&gDvmJit.compilerLock);
- pthread_cond_signal(&gDvmJit.compilerQueueActivity);
- dvmUnlockMutex(&gDvmJit.compilerLock);
+ if (gDvm.executionMode == kExecutionModeJit) {
+ dvmLockMutex(&gDvmJit.compilerLock);
+ pthread_cond_signal(&gDvmJit.compilerQueueActivity);
+ dvmUnlockMutex(&gDvmJit.compilerLock);
+ }
#endif
RETURN_VOID();
}