Do superclass validation at compile time and log with new class status.

Tries to perform superclass validation for classes that are resolved,
but not initialized at runtime. If successful, saves the result in the
oat file with a new class status. At runtime, the superclass validation
can be skipped during class initialization, saving some time and
reducing string accesses.

Results show savings of 50kB PSS in maps on startup, with slight
decrease in startup time.

Maps (average of 100 runs)
Before: dex 9941.3 odex 15159.8 total 25101.1 launch 908
After: dex 9897.4 odex 15155.7 total 25053.1 launch 906.6

Bug: 63456114
Test: mm test-art-host
Change-Id: If67a4a49d61781b6d561c26118d7e0c6b9cc0d6f
diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc
index bb64755..e8b9150 100644
--- a/compiler/driver/compiler_driver.cc
+++ b/compiler/driver/compiler_driver.cc
@@ -2245,7 +2245,7 @@
     const bool is_boot_image = manager_->GetCompiler()->GetCompilerOptions().IsBootImage();
     const bool is_app_image = manager_->GetCompiler()->GetCompilerOptions().IsAppImage();
 
-    mirror::Class::Status old_status = klass->GetStatus();;
+    mirror::Class::Status old_status = klass->GetStatus();
     // Only try to initialize classes that were successfully verified.
     if (klass->IsVerified()) {
       // Don't initialize classes in boot space when compiling app image
@@ -2363,6 +2363,14 @@
             }
           }
         }
+        // If the class still isn't initialized, at least try some checks that initialization
+        // would do so they can be skipped at runtime.
+        if (!klass->IsInitialized() &&
+            manager_->GetClassLinker()->ValidateSuperClassDescriptors(klass)) {
+          old_status = mirror::Class::kStatusSuperclassValidated;
+        } else {
+          soa.Self()->ClearException();
+        }
         soa.Self()->AssertNoPendingException();
       }
     }
@@ -2860,13 +2868,14 @@
 
 void CompilerDriver::RecordClassStatus(ClassReference ref, mirror::Class::Status status) {
   switch (status) {
-    case mirror::Class::kStatusNotReady:
     case mirror::Class::kStatusErrorResolved:
     case mirror::Class::kStatusErrorUnresolved:
+    case mirror::Class::kStatusNotReady:
+    case mirror::Class::kStatusResolved:
     case mirror::Class::kStatusRetryVerificationAtRuntime:
     case mirror::Class::kStatusVerified:
+    case mirror::Class::kStatusSuperclassValidated:
     case mirror::Class::kStatusInitialized:
-    case mirror::Class::kStatusResolved:
       break;  // Expected states.
     default:
       LOG(FATAL) << "Unexpected class status for class "