/* * "Mterp entry point. */ void dvmMterpStd(Thread* self) { /* configure mterp items */ self->interpSave.methodClassDex = self->interpSave.method->clazz->pDvmDex; IF_LOGVV() { char* desc = dexProtoCopyMethodDescriptor( &self->interpSave.method->prototype); LOGVV("mterp threadid=%d : %s.%s %s", dvmThreadSelf()->threadId, self->interpSave.method->clazz->descriptor, self->interpSave.method->name, desc); free(desc); } //ALOGI("self is %p, pc=%p, fp=%p", self, self->interpSave.pc, // self->interpSave.curFrame); //ALOGI("first instruction is 0x%04x", self->interpSave.pc[0]); /* * Handle any ongoing profiling and prep for debugging */ if (self->interpBreak.ctl.subMode != 0) { TRACE_METHOD_ENTER(self, self->interpSave.method); self->debugIsMethodEntry = true; // Always true on startup } dvmMterpStdRun(self); #ifdef LOG_INSTR ALOGD("|-- Leaving interpreter loop"); #endif }
/* * "Standard" mterp entry point. This sets up a "glue" structure and then * calls into the assembly interpreter implementation. * * (There is presently no "debug" entry point.) */ bool dvmMterpStd(Thread* self, InterpState* glue) { int changeInterp; /* configure mterp items */ glue->self = self; glue->methodClassDex = glue->method->clazz->pDvmDex; glue->interpStackEnd = self->interpStackEnd; glue->pSelfSuspendCount = &self->suspendCount; glue->cardTable = gDvm.biasedCardTableBase; #if defined(WITH_JIT) glue->pJitProfTable = gDvmJit.pProfTable; glue->ppJitProfTable = &gDvmJit.pProfTable; glue->jitThreshold = gDvmJit.threshold; #endif if (gDvm.jdwpConfigured) { glue->pDebuggerActive = &gDvm.debuggerActive; } else { glue->pDebuggerActive = NULL; } glue->pActiveProfilers = &gDvm.activeProfilers; IF_LOGVV() { char* desc = dexProtoCopyMethodDescriptor(&glue->method->prototype); LOGVV("mterp threadid=%d entry %d: %s.%s %s\n", dvmThreadSelf()->threadId, glue->entryPoint, glue->method->clazz->descriptor, glue->method->name, desc); free(desc); } //LOGI("glue is %p, pc=%p, fp=%p\n", glue, glue->pc, glue->fp); //LOGI("first instruction is 0x%04x\n", glue->pc[0]); changeInterp = dvmMterpStdRun(glue); #if defined(WITH_JIT) if (glue->jitState != kJitSingleStep) { glue->self->inJitCodeCache = NULL; } #endif if (!changeInterp) { /* this is a "normal" exit; we're not coming back */ #ifdef LOG_INSTR LOGD("|-- Leaving interpreter loop"); #endif return false; } else { /* we're "standard", so switch to "debug" */ LOGVV(" mterp returned, changeInterp=%d\n", changeInterp); glue->nextMode = INTERP_DBG; return true; } }