diff options
author | Nicolas Geoffray <ngeoffray@google.com> | 2015-03-09 14:56:37 +0000 |
---|---|---|
committer | Nicolas Geoffray <ngeoffray@google.com> | 2015-03-09 17:23:01 +0000 |
commit | ee0770379ab3e328fdd5a733e62f05b9f5216e38 (patch) | |
tree | e37dfb0e4530395abad5a6c344651645b56e3082 /runtime/thread.cc | |
parent | 2cfdabd2bb4833d7092819d27ef08a9e1cdffead (diff) | |
download | art-ee0770379ab3e328fdd5a733e62f05b9f5216e38.tar.gz art-ee0770379ab3e328fdd5a733e62f05b9f5216e38.tar.bz2 art-ee0770379ab3e328fdd5a733e62f05b9f5216e38.zip |
Use the current Java stack instead of the ThrowLocation.
The ThrowLocation contains information we can actually retrieve
from the current stack.
Change-Id: I7e5b2f519f95830c457cb31ea10a581aa9c973ee
Diffstat (limited to 'runtime/thread.cc')
-rw-r--r-- | runtime/thread.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/runtime/thread.cc b/runtime/thread.cc index e31af16278..94d10590c7 100644 --- a/runtime/thread.cc +++ b/runtime/thread.cc @@ -1730,21 +1730,21 @@ void Thread::ThrowNewException(const ThrowLocation& throw_location, ThrowNewWrappedException(throw_location, exception_class_descriptor, msg); } -static mirror::ClassLoader* GetClassLoaderFromThrowLocation(const ThrowLocation& throw_location) +static mirror::ClassLoader* GetCurrentClassLoader(Thread* self) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { - return throw_location.GetMethod() != nullptr - ? throw_location.GetMethod()->GetDeclaringClass()->GetClassLoader() + mirror::ArtMethod* method = self->GetCurrentMethod(nullptr); + return method != nullptr + ? method->GetDeclaringClass()->GetClassLoader() : nullptr; } -void Thread::ThrowNewWrappedException(const ThrowLocation& throw_location, +void Thread::ThrowNewWrappedException(const ThrowLocation& throw_location ATTRIBUTE_UNUSED, const char* exception_class_descriptor, const char* msg) { DCHECK_EQ(this, Thread::Current()); ScopedObjectAccessUnchecked soa(this); StackHandleScope<3> hs(soa.Self()); - Handle<mirror::ClassLoader> class_loader( - hs.NewHandle(GetClassLoaderFromThrowLocation(throw_location))); + Handle<mirror::ClassLoader> class_loader(hs.NewHandle(GetCurrentClassLoader(soa.Self()))); ScopedLocalRef<jobject> cause(GetJniEnv(), soa.AddLocalReference<jobject>(GetException())); ClearException(); Runtime* runtime = Runtime::Current(); |