Added new state and Soft/Hard error return to verifier for bad supers.
Market was failing because a superclass failed with a soft error, and
then its subclass would be rejected with a hard error. New states and
return values were added, and now ClassLinker::VerifyClass allows a
superclass to have either kStatusVerified or
kStatusRetryVerificationAtRuntime as valid states.
Change-Id: I72f23d25fa3bdcfd08f3113b091303535a327c14
diff --git a/src/compiler.cc b/src/compiler.cc
index af06de1..dadfc40 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -1155,8 +1155,8 @@
* will be rejected by the verifier and later skipped during compilation in the compiler.
*/
std::string error_msg;
- if (!verifier::MethodVerifier::VerifyClass(context->GetDexFile(), context->GetDexCache(),
- context->GetClassLoader(), class_def_index, error_msg)) {
+ if (verifier::MethodVerifier::VerifyClass(context->GetDexFile(), context->GetDexCache(),
+ context->GetClassLoader(), class_def_index, error_msg) == verifier::MethodVerifier::kHardFailure) {
const DexFile::ClassDef& class_def = context->GetDexFile()->GetClassDef(class_def_index);
LOG(ERROR) << "Verification failed on class "
<< PrettyDescriptor(context->GetDexFile()->GetClassDescriptor(class_def))
@@ -1172,14 +1172,9 @@
CHECK(Thread::Current()->IsExceptionPending());
Thread::Current()->ClearException();
art::Compiler::ClassReference ref(context->GetDexFile(), class_def_index);
- if (!verifier::MethodVerifier::IsClassRejected(ref)) {
- // If the erroneous class wasn't rejected by the verifier, it was a soft error. We want
- // to try verification again at run-time, so move back into the resolved state.
- klass->SetStatus(Class::kStatusResolved);
- }
}
- CHECK(klass->IsVerified() || klass->IsResolved() || klass->IsErroneous()) << PrettyClass(klass);
+ CHECK(klass->IsCompileTimeVerified() || klass->IsErroneous()) << PrettyClass(klass);
CHECK(!Thread::Current()->IsExceptionPending()) << PrettyTypeOf(Thread::Current()->GetException());
}