summaryrefslogtreecommitdiff
path: root/runtime/mirror/class.cc
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/mirror/class.cc')
-rw-r--r--runtime/mirror/class.cc39
1 files changed, 3 insertions, 36 deletions
diff --git a/runtime/mirror/class.cc b/runtime/mirror/class.cc
index 77275f007b..91e1cecbdf 100644
--- a/runtime/mirror/class.cc
+++ b/runtime/mirror/class.cc
@@ -94,42 +94,9 @@ void Class::SetStatus(Handle<Class> h_this, Status new_status, Thread* self) {
}
}
- // Stash current exception.
- StackHandleScope<1> hs(self);
- Handle<mirror::Throwable> old_exception(hs.NewHandle(self->GetException()));
- CHECK(old_exception.Get() != nullptr);
- Class* eiie_class;
- // Do't attempt to use FindClass if we have an OOM error since this can try to do more
- // allocations and may cause infinite loops.
- bool throw_eiie = (old_exception.Get() == nullptr);
- if (!throw_eiie) {
- std::string temp;
- const char* old_exception_descriptor = old_exception->GetClass()->GetDescriptor(&temp);
- throw_eiie = (strcmp(old_exception_descriptor, "Ljava/lang/OutOfMemoryError;") != 0);
- }
- if (throw_eiie) {
- // Clear exception to call FindSystemClass.
- self->ClearException();
- eiie_class = Runtime::Current()->GetClassLinker()->FindSystemClass(
- self, "Ljava/lang/ExceptionInInitializerError;");
- CHECK(!self->IsExceptionPending());
- // Only verification errors, not initialization problems, should set a verify error.
- // This is to ensure that ThrowEarlierClassFailure will throw NoClassDefFoundError in that
- // case.
- Class* exception_class = old_exception->GetClass();
- if (!eiie_class->IsAssignableFrom(exception_class)) {
- // Store the exception class when this is the AoT compiler. Don't store full exceptions,
- // as they need to be trimmed (native components are not storable in an image).
- if (Runtime::Current()->IsAotCompiler()) {
- h_this->SetVerifyError(exception_class);
- } else {
- h_this->SetVerifyError(old_exception.Get());
- }
- }
- }
-
- // Restore exception.
- self->SetException(old_exception.Get());
+ // Remember the current exception.
+ CHECK(self->GetException() != nullptr);
+ h_this->SetVerifyError(self->GetException());
}
static_assert(sizeof(Status) == sizeof(uint32_t), "Size of status not equal to uint32");
if (Runtime::Current()->IsActiveTransaction()) {