diff options
author | Elliott Hughes <enh@google.com> | 2011-07-19 17:53:51 -0700 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2011-07-19 17:53:51 -0700 |
commit | 8bc8bf71a52e17d483021b4c9dc8e735d9bce3ed (patch) | |
tree | ee9183f1ae87226d10f157b8bc6ce6bae372fd09 /vm/interp | |
parent | 5b298a2a95dfb3562ee297d284bef565e595a70c (diff) | |
download | android_dalvik-8bc8bf71a52e17d483021b4c9dc8e735d9bce3ed.tar.gz android_dalvik-8bc8bf71a52e17d483021b4c9dc8e735d9bce3ed.tar.bz2 android_dalvik-8bc8bf71a52e17d483021b4c9dc8e735d9bce3ed.zip |
Don't use dvmIsValidObject outside the GC.
Use dvmIsHeapPointer outside the GC. (This still isn't safe because there's
no synchronization when dealing with the HeapSource.)
Bug: 5049447
Change-Id: Ie0b325ef0a92687ea1eaf1491a4bb832298893c5
Diffstat (limited to 'vm/interp')
-rw-r--r-- | vm/interp/Interp.cpp | 6 | ||||
-rw-r--r-- | vm/interp/Stack.cpp | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/vm/interp/Interp.cpp b/vm/interp/Interp.cpp index 430d669e1..02a33d7a2 100644 --- a/vm/interp/Interp.cpp +++ b/vm/interp/Interp.cpp @@ -667,7 +667,7 @@ void dvmReportPreNativeInvoke(const Method* methodToCall, Thread* self, u4* fp) #endif if (self->interpBreak.ctl.subMode & kSubModeDebuggerActive) { Object* thisPtr = dvmGetThisPtr(self->interpSave.method, fp); - assert(thisPtr == NULL || dvmIsValidObject(thisPtr)); + assert(thisPtr == NULL || dvmIsHeapAddress(thisPtr)); dvmDbgPostLocationEvent(methodToCall, -1, thisPtr, DBG_METHOD_ENTRY); } } @@ -681,7 +681,7 @@ void dvmReportPostNativeInvoke(const Method* methodToCall, Thread* self, u4* fp) { if (self->interpBreak.ctl.subMode & kSubModeDebuggerActive) { Object* thisPtr = dvmGetThisPtr(self->interpSave.method, fp); - assert(thisPtr == NULL || dvmIsValidObject(thisPtr)); + assert(thisPtr == NULL || dvmIsHeapAddress(thisPtr)); dvmDbgPostLocationEvent(methodToCall, -1, thisPtr, DBG_METHOD_EXIT); } if (self->interpBreak.ctl.subMode & kSubModeMethodTrace) { @@ -858,7 +858,7 @@ static void updateDebugger(const Method* method, const u2* pc, const u4* fp, */ if (eventFlags != 0) { Object* thisPtr = dvmGetThisPtr(method, fp); - if (thisPtr != NULL && !dvmIsValidObject(thisPtr)) { + if (thisPtr != NULL && !dvmIsHeapAddress(thisPtr)) { /* * TODO: remove this check if we're confident that the "this" * pointer is where it should be -- slows us down, especially diff --git a/vm/interp/Stack.cpp b/vm/interp/Stack.cpp index a6f6bbd3e..7b12e7bc4 100644 --- a/vm/interp/Stack.cpp +++ b/vm/interp/Stack.cpp @@ -456,7 +456,7 @@ void dvmCallMethodV(Thread* self, const Method* method, Object* obj, /* put "this" pointer into in0 if appropriate */ if (!dvmIsStaticMethod(method)) { #ifdef WITH_EXTRA_OBJECT_VALIDATION - assert(obj != NULL && dvmIsValidObject(obj)); + assert(obj != NULL && dvmIsHeapAddress(obj)); #endif *ins++ = (u4) obj; verifyCount++; @@ -481,7 +481,7 @@ void dvmCallMethodV(Thread* self, const Method* method, Object* obj, } case 'L': { /* 'shorty' descr uses L for all refs, incl array */ void* arg = va_arg(args, void*); - assert(obj == NULL || dvmIsValidObject(obj)); + assert(obj == NULL || dvmIsHeapAddress(obj)); jobject argObj = reinterpret_cast<jobject>(arg); if (fromJni) *ins++ = (u4) dvmDecodeIndirectRef(env, argObj); @@ -1135,7 +1135,7 @@ static bool extractMonitorEnterObject(Thread* thread, Object** pLockObj, /* get and check the object in that register */ u4* fp = (u4*) framePtr; Object* obj = (Object*) fp[reg]; - if (!dvmIsValidObject(obj)) { + if (obj != NULL && !dvmIsHeapAddress(obj)) { LOGD("ExtrMon: invalid object %p at %p[%d]", obj, fp, reg); return false; } |