summaryrefslogtreecommitdiffstats
path: root/runtime/class_linker.cc
diff options
context:
space:
mode:
authorNicolas Geoffray <ngeoffray@google.com>2015-03-05 10:40:17 +0000
committerNicolas Geoffray <ngeoffray@google.com>2015-03-09 10:09:33 +0000
commit14691c5e786e8c2c5734f687e4c96217340771be (patch)
tree7c2156671b323c70ffdd1d48d5e2f1d1de79c5fc /runtime/class_linker.cc
parent3d7d2af4c6502b771b032ee9bf3ab30e78f9c60d (diff)
downloadandroid_art-14691c5e786e8c2c5734f687e4c96217340771be.tar.gz
android_art-14691c5e786e8c2c5734f687e4c96217340771be.tar.bz2
android_art-14691c5e786e8c2c5734f687e4c96217340771be.zip
Compute the right catch location for the debugger.
Also remove tls ThrowLocation, it is not needed anymore. Change-Id: I78fddf09ce968ca475e39c17fa76d699c589c8d9
Diffstat (limited to 'runtime/class_linker.cc')
-rw-r--r--runtime/class_linker.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index 2989b8c6ce..f0c8819a52 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -103,7 +103,7 @@ static void ThrowEarlierClassFailure(mirror::Class* c)
if (runtime->IsAotCompiler()) {
// At compile time, accurate errors and NCDFE are disabled to speed compilation.
mirror::Throwable* pre_allocated = runtime->GetPreAllocatedNoClassDefFoundError();
- self->SetException(ThrowLocation(), pre_allocated);
+ self->SetException(pre_allocated);
} else {
ThrowLocation throw_location = self->GetCurrentLocationForThrow();
if (c->GetVerifyErrorClass() != NULL) {
@@ -123,7 +123,7 @@ static void VlogClassInitializationFailure(Handle<mirror::Class> klass)
if (VLOG_IS_ON(class_linker)) {
std::string temp;
LOG(INFO) << "Failed to initialize class " << klass->GetDescriptor(&temp) << " from "
- << klass->GetLocation() << "\n" << Thread::Current()->GetException(nullptr)->Dump();
+ << klass->GetLocation() << "\n" << Thread::Current()->GetException()->Dump();
}
}
@@ -2195,7 +2195,7 @@ mirror::Class* ClassLinker::FindClass(Thread* self, const char* descriptor,
// expected and will be wrapped in a ClassNotFoundException. Use the pre-allocated error to
// trigger the chaining with a proper stack trace.
mirror::Throwable* pre_allocated = Runtime::Current()->GetPreAllocatedNoClassDefFoundError();
- self->SetException(ThrowLocation(), pre_allocated);
+ self->SetException(pre_allocated);
return nullptr;
}
} else if (Runtime::Current()->UseCompileTimeClassPath()) {
@@ -2227,7 +2227,7 @@ mirror::Class* ClassLinker::FindClass(Thread* self, const char* descriptor,
} else {
// Use the pre-allocated NCDFE at compile time to avoid wasting time constructing exceptions.
mirror::Throwable* pre_allocated = Runtime::Current()->GetPreAllocatedNoClassDefFoundError();
- self->SetException(ThrowLocation(), pre_allocated);
+ self->SetException(pre_allocated);
return nullptr;
}
} else {
@@ -3529,13 +3529,13 @@ void ClassLinker::VerifyClass(Thread* self, Handle<mirror::Class> klass) {
PrettyDescriptor(klass.Get()).c_str(),
PrettyDescriptor(super.Get()).c_str()));
LOG(WARNING) << error_msg << " in " << klass->GetDexCache()->GetLocation()->ToModifiedUtf8();
- Handle<mirror::Throwable> cause(hs.NewHandle(self->GetException(nullptr)));
+ Handle<mirror::Throwable> cause(hs.NewHandle(self->GetException()));
if (cause.Get() != nullptr) {
self->ClearException();
}
ThrowVerifyError(klass.Get(), "%s", error_msg.c_str());
if (cause.Get() != nullptr) {
- self->GetException(nullptr)->SetCause(cause.Get());
+ self->GetException()->SetCause(cause.Get());
}
ClassReference ref(klass->GetDexCache()->GetDexFile(), klass->GetDexClassDefIndex());
if (Runtime::Current()->IsAotCompiler()) {
@@ -4168,7 +4168,7 @@ bool ClassLinker::InitializeClass(Thread* self, Handle<mirror::Class> klass,
<< PrettyDescriptor(handle_scope_super.Get())
<< " that has unexpected status " << handle_scope_super->GetStatus()
<< "\nPending exception:\n"
- << (self->GetException(nullptr) != nullptr ? self->GetException(nullptr)->Dump() : "");
+ << (self->GetException() != nullptr ? self->GetException()->Dump() : "");
ObjectLock<mirror::Class> lock(self, klass);
// Initialization failed because the super-class is erroneous.
klass->SetStatus(mirror::Class::kStatusError, self);
@@ -5671,12 +5671,12 @@ mirror::Class* ClassLinker::ResolveType(const DexFile& dex_file, uint16_t type_i
<< "Expected pending exception for failed resolution of: " << descriptor;
// Convert a ClassNotFoundException to a NoClassDefFoundError.
StackHandleScope<1> hs(self);
- Handle<mirror::Throwable> cause(hs.NewHandle(self->GetException(nullptr)));
+ Handle<mirror::Throwable> cause(hs.NewHandle(self->GetException()));
if (cause->InstanceOf(GetClassRoot(kJavaLangClassNotFoundException))) {
DCHECK(resolved == nullptr); // No Handle needed to preserve resolved.
self->ClearException();
ThrowNoClassDefFoundError("Failed resolution of: %s", descriptor);
- self->GetException(nullptr)->SetCause(cause.Get());
+ self->GetException()->SetCause(cause.Get());
}
}
}