Clean up class resolution and lookup.

Simplify the code and avoid read barriers when appropriate.
Relax class status check in ArtField::GetDeclaringClass()
because we can see ClassStatus::kIdx from the from-space
class object for kReadBarrierOption=kWithoutReadBarrier.

Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Change-Id: I83886a64fe5a99a1c3c30eab3b35dae449e6b4bc
diff --git a/runtime/art_method-inl.h b/runtime/art_method-inl.h
index c1fac36..ec66966 100644
--- a/runtime/art_method-inl.h
+++ b/runtime/art_method-inl.h
@@ -324,7 +324,7 @@
 template <ReadBarrierOption kReadBarrierOption>
 inline mirror::DexCache* ArtMethod::GetDexCache() {
   if (LIKELY(!IsObsolete<kReadBarrierOption>())) {
-    mirror::Class* klass = GetDeclaringClass<kReadBarrierOption>();
+    ObjPtr<mirror::Class> klass = GetDeclaringClass<kReadBarrierOption>();
     return klass->GetDexCache<kDefaultVerifyFlags, kReadBarrierOption>();
   } else {
     DCHECK(!IsProxyMethod());