From bc2f3e3e41d02eb2896dc16390c5c4023a7b5649 Mon Sep 17 00:00:00 2001 From: Brian Carlstrom Date: Thu, 22 Sep 2011 17:16:54 -0700 Subject: Add support for oat_process for use as a wrap.* launcher Add test support for running Calculator Change-Id: I7ec0681febe6f6c836452e8afb4c12a2ebfa0ea8 --- src/thread.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/thread.cc') diff --git a/src/thread.cc b/src/thread.cc index 22495be9c2..800507201b 100644 --- a/src/thread.cc +++ b/src/thread.cc @@ -301,7 +301,7 @@ void LockObjectFromCode(Thread* thread, Object* obj) { obj->MonitorEnter(thread); DCHECK(thread->HoldsLock(obj)); // Only possible exception is NPE and is handled before entry - DCHECK(thread->GetException() == NULL); + DCHECK(!thread->IsExceptionPending()); } extern "C" void artCheckSuspendFromCode(Thread* thread) { @@ -358,10 +358,14 @@ extern "C" uint64_t artFindInterfaceMethodInCacheFromCode(uint32_t method_idx, Method* interface_method = class_linker->ResolveMethod(method_idx, caller_method, false); if (interface_method == NULL) { // Could not resolve interface method. Throw error and unwind - CHECK(thread->GetException() != NULL); + CHECK(thread->IsExceptionPending()); return 0; } Method* method = this_object->GetClass()->FindVirtualMethodForInterface(interface_method); + if (method == NULL) { + CHECK(thread->IsExceptionPending()); + return 0; + } const void* code = method->GetCode(); uint32_t method_uint = reinterpret_cast(method); @@ -1372,6 +1376,7 @@ void Thread::ThrowNewExceptionV(const char* exception_class_descriptor, const ch CHECK(exception_class != NULL) << "descriptor=\"" << descriptor << "\""; int rc = env->ThrowNew(exception_class, msg.c_str()); CHECK_EQ(rc, JNI_OK); + env->DeleteLocalRef(exception_class); } void Thread::ThrowOutOfMemoryError() { -- cgit v1.2.3-59-g8ed1b