ART: Recognize compile-time soft-fails
Add recognition of RetryVerificationAtRuntime to the AoT
classlinker. In that case, report a soft failure.
Bug: 63467744
Bug: 65318848
Test: m test-art-host
Change-Id: I66c623179363db77ce3019233903da96a659ce04
diff --git a/runtime/aot_class_linker.cc b/runtime/aot_class_linker.cc
index d07a0fd..a62cbec 100644
--- a/runtime/aot_class_linker.cc
+++ b/runtime/aot_class_linker.cc
@@ -78,9 +78,17 @@
CompilerCallbacks* callbacks = runtime->GetCompilerCallbacks();
ClassStatus old_status = callbacks->GetPreviousClassState(
ClassReference(&klass->GetDexFile(), klass->GetDexClassDefIndex()));
+ // Was it verified? Report no failure.
if (old_status >= ClassStatus::kStatusVerified) {
return verifier::FailureKind::kNoFailure;
}
+ // Does it need to be verified at runtime? Report soft failure.
+ if (old_status >= ClassStatus::kStatusRetryVerificationAtRuntime) {
+ // Error messages from here are only reported through -verbose:class. It is not worth it to
+ // create a message.
+ return verifier::FailureKind::kSoftFailure;
+ }
+ // Do the actual work.
return ClassLinker::PerformClassVerification(self, klass, log_level, error_msg);
}