ART: Check that boot image classes are verified

In a debug build, check that all classes in the boot image are
at least fully verified. This is to avoid issues when we need to
bring up a runtime quickly and without verification, e.g., the
decryption screen.

Change-Id: I819683d8d35b6ffb50c6387a0f8091b9f130980d
diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc
index 2e9f835..a3187a3 100644
--- a/compiler/driver/compiler_driver.cc
+++ b/compiler/driver/compiler_driver.cc
@@ -1693,6 +1693,12 @@
 
     CHECK(klass->IsCompileTimeVerified() || klass->IsErroneous())
         << PrettyDescriptor(klass.Get()) << ": 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()->IsImage() || klass->IsVerified()) << "Boot classpath class " <<
+        PrettyClass(klass.Get()) << " failed to fully verify.";
   }
   soa.Self()->AssertNoPendingException();
 }