Improve verifier speed.

Main improvement is in the RegTypeCache::From() Class lookup, the cache is first
looked up for the passed descriptor instead of trying to resolve the class.
For cases when the descriptor is not found it is resolved to a class and a new type is
created and added to the cache.

Change-Id: I594a4c00b351843dd576b5af29e9dcaed18e04e8
diff --git a/src/class_linker.cc b/src/class_linker.cc
index d262a5d..e55fe78 100644
--- a/src/class_linker.cc
+++ b/src/class_linker.cc
@@ -2109,11 +2109,15 @@
   size_t hash = Hash(descriptor);
   MutexLock mu(Thread::Current(), *Locks::classlinker_classes_lock_);
   // TODO: determine if its better to search classes_ or image_classes_ first
-  mirror::Class* klass = LookupClassLocked(descriptor, class_loader, hash, classes_);
+  mirror::Class* klass = NULL;
+  // Use image class only if the class_loader is null.
+  if (class_loader == NULL) {
+    klass = LookupClassLocked(descriptor, class_loader, hash, image_classes_);
+  }
   if (klass != NULL) {
     return klass;
   }
-  return LookupClassLocked(descriptor, class_loader, hash, image_classes_);
+  return LookupClassLocked(descriptor, class_loader, hash, classes_);
 }
 
 mirror::Class* ClassLinker::LookupClassLocked(const char* descriptor,