Return the right value in VerifyClass.
We used to return kNoFailure when a class was already processed.
But it could have had soft failures.
Also remove IsCompileTimeVerified to avoid future confusions and
introduce ShouldVerifyAtRuntime.
Add some more checks to make sure we record the right things in
the vdex file.
bug: 33845394
test: verifier_deps_test test-art-host
Change-Id: Iff11a96e825c85db416083413761981515f405b7
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index d232714..360d4ab 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -3900,8 +3900,10 @@
if (!supertype->IsVerified() && !supertype->IsErroneous()) {
VerifyClass(self, supertype);
}
- if (supertype->IsCompileTimeVerified()) {
- // Either we are verified or we soft failed and need to retry at runtime.
+
+ if (supertype->IsVerified() || supertype->ShouldVerifyAtRuntime()) {
+ // The supertype is either verified, or we soft failed at AOT time.
+ DCHECK(supertype->IsVerified() || Runtime::Current()->IsAotCompiler());
return true;
}
// If we got this far then we have a hard failure.
@@ -3967,13 +3969,16 @@
return verifier::MethodVerifier::kHardFailure;
}
- // Don't attempt to re-verify if already sufficiently verified.
+ // Don't attempt to re-verify if already verified.
if (klass->IsVerified()) {
EnsureSkipAccessChecksMethods(klass, image_pointer_size_);
return verifier::MethodVerifier::kNoFailure;
}
- if (klass->IsCompileTimeVerified() && Runtime::Current()->IsAotCompiler()) {
- return verifier::MethodVerifier::kNoFailure;
+
+ // For AOT, don't attempt to re-verify if we have already found we should
+ // verify at runtime.
+ if (Runtime::Current()->IsAotCompiler() && klass->ShouldVerifyAtRuntime()) {
+ return verifier::MethodVerifier::kSoftFailure;
}
if (klass->GetStatus() == mirror::Class::kStatusResolved) {