summaryrefslogtreecommitdiff
path: root/compiler/driver/compiler_driver.cc
diff options
context:
space:
mode:
author Narayan Kamath <narayan@google.com> 2016-10-27 11:47:30 +0100
committer Narayan Kamath <narayan@google.com> 2016-10-28 08:54:34 +0000
commite3eae5e41502c85ba0b4ef88340c10bb53795a47 (patch)
tree1a57a9d37b7a5daead2d670afc83ceb5794ae548 /compiler/driver/compiler_driver.cc
parent384cb6674b967a9c58da9ad70fd6f98caa1d8691 (diff)
compiler_driver: loosen DCHECK for java/lang/invoke classes.
Verifier support for invoke-polymorphic hasn't been implemented yet, so boot classpath classes that use it will not be verified at compile time. This change will be reverted once verifier support is implemented. This change is a hack. Test: make test-art-host Bug: 32496585 Bug: 30550796 Change-Id: Id8fcb3fd0d5ddd09f1c80f751a5f96364b137855
Diffstat (limited to 'compiler/driver/compiler_driver.cc')
-rw-r--r--compiler/driver/compiler_driver.cc20
1 files changed, 14 insertions, 6 deletions
diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc
index 56b4ebd608..1b87725230 100644
--- a/compiler/driver/compiler_driver.cc
+++ b/compiler/driver/compiler_driver.cc
@@ -24,6 +24,8 @@
#include <malloc.h> // For mallinfo
#endif
+#include "android-base/strings.h"
+
#include "art_field-inl.h"
#include "art_method-inl.h"
#include "base/array_ref.h"
@@ -2011,12 +2013,18 @@ class VerifyClassVisitor : public CompilationVisitor {
CHECK(klass->IsCompileTimeVerified() || klass->IsErroneous())
<< klass->PrettyDescriptor() << ": state=" << klass->GetStatus();
- // It is *very* problematic if there are verification errors in the boot classpath.
- // For example, we rely on things working OK without verification when the
- // decryption dialog is brought up. So abort in a debug build if we find this violated.
- DCHECK(!manager_->GetCompiler()->GetCompilerOptions().IsBootImage() || klass->IsVerified())
- << "Boot classpath class " << klass->PrettyClass()
- << " failed to fully verify.";
+ // It is *very* problematic if there are verification errors in the boot classpath. For example,
+ // we rely on things working OK without verification when the decryption dialog is brought up.
+ // So abort in a debug build if we find this violated.
+ if (kIsDebugBuild) {
+ // TODO(narayan): Remove this special case for signature polymorphic
+ // invokes once verifier support is fully implemented.
+ if (manager_->GetCompiler()->GetCompilerOptions().IsBootImage() &&
+ !android::base::StartsWith(descriptor, "Ljava/lang/invoke/")) {
+ DCHECK(klass->IsVerified()) << "Boot classpath class " << klass->PrettyClass()
+ << " failed to fully verify: state= " << klass->GetStatus();
+ }
+ }
} else {
// Make the skip a soft failure, essentially being considered as verify at runtime.
failure_kind = verifier::MethodVerifier::kSoftFailure;