diff options
-rw-r--r-- | vm/Thread.h | 2 | ||||
-rw-r--r-- | vm/interp/Interp.cpp | 8 | ||||
-rw-r--r-- | vm/mterp/Mterp.h | 10 | ||||
-rw-r--r-- | vm/mterp/cstubs/entry.cpp | 12 | ||||
-rw-r--r-- | vm/mterp/cstubs/stubdefs.cpp | 4 | ||||
-rw-r--r-- | vm/mterp/out/InterpC-allstubs.cpp | 16 | ||||
-rw-r--r-- | vm/mterp/out/InterpC-armv5te-vfp.cpp | 4 | ||||
-rw-r--r-- | vm/mterp/out/InterpC-armv5te.cpp | 4 | ||||
-rw-r--r-- | vm/mterp/out/InterpC-armv7-a-neon.cpp | 4 | ||||
-rw-r--r-- | vm/mterp/out/InterpC-armv7-a.cpp | 4 | ||||
-rw-r--r-- | vm/mterp/out/InterpC-x86-atom.cpp | 4 | ||||
-rw-r--r-- | vm/mterp/out/InterpC-x86.cpp | 4 |
12 files changed, 47 insertions, 29 deletions
diff --git a/vm/Thread.h b/vm/Thread.h index 7f14ce514..9fa2e03bc 100644 --- a/vm/Thread.h +++ b/vm/Thread.h @@ -92,7 +92,7 @@ union InterpBreak { #ifndef DVM_NO_ASM_INTERP void* curHandlerTable; #else - void* unused; + int32_t unused1; #endif } ctl; }; diff --git a/vm/interp/Interp.cpp b/vm/interp/Interp.cpp index de85fa129..bb8887030 100644 --- a/vm/interp/Interp.cpp +++ b/vm/interp/Interp.cpp @@ -1483,8 +1483,10 @@ void updateInterpBreak(Thread* thread, ExecutionSubModes subMode, bool enable) newValue.ctl.breakFlags |= kInterpSingleStep; if (newValue.ctl.subMode & SAFEPOINT_BREAK_MASK) newValue.ctl.breakFlags |= kInterpSafePoint; +#ifndef DVM_NO_ASM_INTERP newValue.ctl.curHandlerTable = (newValue.ctl.breakFlags) ? thread->altHandlerTable : thread->mainHandlerTable; +#endif } while (dvmQuasiAtomicCas64(oldValue.all, newValue.all, &thread->interpBreak.all) != 0); } @@ -1556,12 +1558,16 @@ void dvmCheckInterpStateConsistency() Thread* thread; uint8_t breakFlags; uint8_t subMode; +#ifndef DVM_NO_ASM_INTERP void* handlerTable; +#endif dvmLockThreadList(self); breakFlags = self->interpBreak.ctl.breakFlags; subMode = self->interpBreak.ctl.subMode; +#ifndef DVM_NO_ASM_INTERP handlerTable = self->interpBreak.ctl.curHandlerTable; +#endif for (thread = gDvm.threadList; thread != NULL; thread = thread->next) { if (subMode != thread->interpBreak.ctl.subMode) { LOGD("Warning: subMode mismatch - %#x:%#x, tid[%d]", @@ -1571,11 +1577,13 @@ void dvmCheckInterpStateConsistency() LOGD("Warning: breakFlags mismatch - %#x:%#x, tid[%d]", breakFlags,thread->interpBreak.ctl.breakFlags,thread->threadId); } +#ifndef DVM_NO_ASM_INTERP if (handlerTable != thread->interpBreak.ctl.curHandlerTable) { LOGD("Warning: curHandlerTable mismatch - %#x:%#x, tid[%d]", (int)handlerTable,(int)thread->interpBreak.ctl.curHandlerTable, thread->threadId); } +#endif #if defined(WITH_JIT) if (thread->pJitProfTable != gDvmJit.pProfTable) { LOGD("Warning: pJitProfTable mismatch - %#x:%#x, tid[%d]", diff --git a/vm/mterp/Mterp.h b/vm/mterp/Mterp.h index b27e4f7a7..6762f6726 100644 --- a/vm/mterp/Mterp.h +++ b/vm/mterp/Mterp.h @@ -35,15 +35,9 @@ extern "C" bool dvmCheckAsmConstants(void); /* * Local entry and exit points. The platform-specific implementation must * provide these two. - * - * dvmMterpStdRun() returns the "changeInterp" argument from dvmMterpStdBail(), - * indicating whether we want to bail out of the interpreter or just switch - * between "standard" and "debug" mode. - * - * The "mterp" interpreter is always "standard". */ -extern "C" bool dvmMterpStdRun(Thread* self); -extern "C" void dvmMterpStdBail(Thread* self, bool changeInterp); +extern "C" void dvmMterpStdRun(Thread* self); +extern "C" void dvmMterpStdBail(Thread* self); /* * Helper for common_printMethod(), invoked from the assembly diff --git a/vm/mterp/cstubs/entry.cpp b/vm/mterp/cstubs/entry.cpp index 350bd8603..90b6ceab2 100644 --- a/vm/mterp/cstubs/entry.cpp +++ b/vm/mterp/cstubs/entry.cpp @@ -2,7 +2,7 @@ * Handler function table, one entry per opcode. */ #undef H -#define H(_op) dvmMterp_##_op +#define H(_op) (const void*) dvmMterp_##_op DEFINE_GOTO_TABLE(gDvmMterpHandlers) #undef H @@ -21,12 +21,12 @@ void dvmMterpStdRun(Thread* self) { jmp_buf jmpBuf; - self->bailPtr = &jmpBuf; + self->interpSave.bailPtr = &jmpBuf; /* We exit via a longjmp */ if (setjmp(jmpBuf)) { LOGVV("mterp threadid=%d returning", dvmThreadSelf()->threadId); - return + return; } /* run until somebody longjmp()s out */ @@ -40,8 +40,8 @@ void dvmMterpStdRun(Thread* self) * FINISH code. For allstubs, we must do an explicit check * in the interpretation loop. */ - if (self-interpBreak.ctl.subMode) { - dvmCheckBefore(pc, fp, self, curMethod); + if (self->interpBreak.ctl.subMode) { + dvmCheckBefore(pc, fp, self); } Handler handler = (Handler) gDvmMterpHandlers[inst & 0xff]; (void) gDvmMterpHandlerNames; /* avoid gcc "defined but not used" */ @@ -56,6 +56,6 @@ void dvmMterpStdRun(Thread* self) */ void dvmMterpStdBail(Thread* self) { - jmp_buf* pJmpBuf = self->bailPtr; + jmp_buf* pJmpBuf = (jmp_buf*) self->interpSave.bailPtr; longjmp(*pJmpBuf, 1); } diff --git a/vm/mterp/cstubs/stubdefs.cpp b/vm/mterp/cstubs/stubdefs.cpp index 0bffd49f1..1a851b422 100644 --- a/vm/mterp/cstubs/stubdefs.cpp +++ b/vm/mterp/cstubs/stubdefs.cpp @@ -82,6 +82,8 @@ } #endif +#define FINISH_BKPT(_opcode) /* FIXME? */ +#define DISPATCH_EXTENDED(_opcode) /* FIXME? */ /* * The "goto label" statements turn into function calls followed by @@ -118,7 +120,7 @@ * As a special case, "goto bail" turns into a longjmp. */ #define GOTO_bail() \ - dvmMterpStdBail(self, false); + dvmMterpStdBail(self) /* * Periodically check for thread suspension. diff --git a/vm/mterp/out/InterpC-allstubs.cpp b/vm/mterp/out/InterpC-allstubs.cpp index 49a67bb6e..fac5ef7c3 100644 --- a/vm/mterp/out/InterpC-allstubs.cpp +++ b/vm/mterp/out/InterpC-allstubs.cpp @@ -452,6 +452,8 @@ static inline bool checkForNullExportPC(Object* obj, u4* fp, const u2* pc) } #endif +#define FINISH_BKPT(_opcode) /* FIXME? */ +#define DISPATCH_EXTENDED(_opcode) /* FIXME? */ /* * The "goto label" statements turn into function calls followed by @@ -488,7 +490,7 @@ static inline bool checkForNullExportPC(Object* obj, u4* fp, const u2* pc) * As a special case, "goto bail" turns into a longjmp. */ #define GOTO_bail() \ - dvmMterpStdBail(self, false); + dvmMterpStdBail(self) /* * Periodically check for thread suspension. @@ -4344,7 +4346,7 @@ OP_END * Handler function table, one entry per opcode. */ #undef H -#define H(_op) dvmMterp_##_op +#define H(_op) (const void*) dvmMterp_##_op DEFINE_GOTO_TABLE(gDvmMterpHandlers) #undef H @@ -4363,12 +4365,12 @@ void dvmMterpStdRun(Thread* self) { jmp_buf jmpBuf; - self->bailPtr = &jmpBuf; + self->interpSave.bailPtr = &jmpBuf; /* We exit via a longjmp */ if (setjmp(jmpBuf)) { LOGVV("mterp threadid=%d returning", dvmThreadSelf()->threadId); - return + return; } /* run until somebody longjmp()s out */ @@ -4382,8 +4384,8 @@ void dvmMterpStdRun(Thread* self) * FINISH code. For allstubs, we must do an explicit check * in the interpretation loop. */ - if (self-interpBreak.ctl.subMode) { - dvmCheckBefore(pc, fp, self, curMethod); + if (self->interpBreak.ctl.subMode) { + dvmCheckBefore(pc, fp, self); } Handler handler = (Handler) gDvmMterpHandlers[inst & 0xff]; (void) gDvmMterpHandlerNames; /* avoid gcc "defined but not used" */ @@ -4398,7 +4400,7 @@ void dvmMterpStdRun(Thread* self) */ void dvmMterpStdBail(Thread* self) { - jmp_buf* pJmpBuf = self->bailPtr; + jmp_buf* pJmpBuf = (jmp_buf*) self->interpSave.bailPtr; longjmp(*pJmpBuf, 1); } diff --git a/vm/mterp/out/InterpC-armv5te-vfp.cpp b/vm/mterp/out/InterpC-armv5te-vfp.cpp index 24fbfdc00..28f72b338 100644 --- a/vm/mterp/out/InterpC-armv5te-vfp.cpp +++ b/vm/mterp/out/InterpC-armv5te-vfp.cpp @@ -452,6 +452,8 @@ static inline bool checkForNullExportPC(Object* obj, u4* fp, const u2* pc) } #endif +#define FINISH_BKPT(_opcode) /* FIXME? */ +#define DISPATCH_EXTENDED(_opcode) /* FIXME? */ /* * The "goto label" statements turn into function calls followed by @@ -488,7 +490,7 @@ static inline bool checkForNullExportPC(Object* obj, u4* fp, const u2* pc) * As a special case, "goto bail" turns into a longjmp. */ #define GOTO_bail() \ - dvmMterpStdBail(self, false); + dvmMterpStdBail(self) /* * Periodically check for thread suspension. diff --git a/vm/mterp/out/InterpC-armv5te.cpp b/vm/mterp/out/InterpC-armv5te.cpp index b750929bd..fd9b000e7 100644 --- a/vm/mterp/out/InterpC-armv5te.cpp +++ b/vm/mterp/out/InterpC-armv5te.cpp @@ -452,6 +452,8 @@ static inline bool checkForNullExportPC(Object* obj, u4* fp, const u2* pc) } #endif +#define FINISH_BKPT(_opcode) /* FIXME? */ +#define DISPATCH_EXTENDED(_opcode) /* FIXME? */ /* * The "goto label" statements turn into function calls followed by @@ -488,7 +490,7 @@ static inline bool checkForNullExportPC(Object* obj, u4* fp, const u2* pc) * As a special case, "goto bail" turns into a longjmp. */ #define GOTO_bail() \ - dvmMterpStdBail(self, false); + dvmMterpStdBail(self) /* * Periodically check for thread suspension. diff --git a/vm/mterp/out/InterpC-armv7-a-neon.cpp b/vm/mterp/out/InterpC-armv7-a-neon.cpp index 69bf46960..25404d43e 100644 --- a/vm/mterp/out/InterpC-armv7-a-neon.cpp +++ b/vm/mterp/out/InterpC-armv7-a-neon.cpp @@ -452,6 +452,8 @@ static inline bool checkForNullExportPC(Object* obj, u4* fp, const u2* pc) } #endif +#define FINISH_BKPT(_opcode) /* FIXME? */ +#define DISPATCH_EXTENDED(_opcode) /* FIXME? */ /* * The "goto label" statements turn into function calls followed by @@ -488,7 +490,7 @@ static inline bool checkForNullExportPC(Object* obj, u4* fp, const u2* pc) * As a special case, "goto bail" turns into a longjmp. */ #define GOTO_bail() \ - dvmMterpStdBail(self, false); + dvmMterpStdBail(self) /* * Periodically check for thread suspension. diff --git a/vm/mterp/out/InterpC-armv7-a.cpp b/vm/mterp/out/InterpC-armv7-a.cpp index 4ca2a1c13..2cbd5797b 100644 --- a/vm/mterp/out/InterpC-armv7-a.cpp +++ b/vm/mterp/out/InterpC-armv7-a.cpp @@ -452,6 +452,8 @@ static inline bool checkForNullExportPC(Object* obj, u4* fp, const u2* pc) } #endif +#define FINISH_BKPT(_opcode) /* FIXME? */ +#define DISPATCH_EXTENDED(_opcode) /* FIXME? */ /* * The "goto label" statements turn into function calls followed by @@ -488,7 +490,7 @@ static inline bool checkForNullExportPC(Object* obj, u4* fp, const u2* pc) * As a special case, "goto bail" turns into a longjmp. */ #define GOTO_bail() \ - dvmMterpStdBail(self, false); + dvmMterpStdBail(self) /* * Periodically check for thread suspension. diff --git a/vm/mterp/out/InterpC-x86-atom.cpp b/vm/mterp/out/InterpC-x86-atom.cpp index 5648affa5..1f3c18d4c 100644 --- a/vm/mterp/out/InterpC-x86-atom.cpp +++ b/vm/mterp/out/InterpC-x86-atom.cpp @@ -452,6 +452,8 @@ static inline bool checkForNullExportPC(Object* obj, u4* fp, const u2* pc) } #endif +#define FINISH_BKPT(_opcode) /* FIXME? */ +#define DISPATCH_EXTENDED(_opcode) /* FIXME? */ /* * The "goto label" statements turn into function calls followed by @@ -488,7 +490,7 @@ static inline bool checkForNullExportPC(Object* obj, u4* fp, const u2* pc) * As a special case, "goto bail" turns into a longjmp. */ #define GOTO_bail() \ - dvmMterpStdBail(self, false); + dvmMterpStdBail(self) /* * Periodically check for thread suspension. diff --git a/vm/mterp/out/InterpC-x86.cpp b/vm/mterp/out/InterpC-x86.cpp index 16237208a..53be42f41 100644 --- a/vm/mterp/out/InterpC-x86.cpp +++ b/vm/mterp/out/InterpC-x86.cpp @@ -452,6 +452,8 @@ static inline bool checkForNullExportPC(Object* obj, u4* fp, const u2* pc) } #endif +#define FINISH_BKPT(_opcode) /* FIXME? */ +#define DISPATCH_EXTENDED(_opcode) /* FIXME? */ /* * The "goto label" statements turn into function calls followed by @@ -488,7 +490,7 @@ static inline bool checkForNullExportPC(Object* obj, u4* fp, const u2* pc) * As a special case, "goto bail" turns into a longjmp. */ #define GOTO_bail() \ - dvmMterpStdBail(self, false); + dvmMterpStdBail(self) /* * Periodically check for thread suspension. |