ObjPtr<>-ify ArtMethod and mirror::Method.

And clean up some forgotten things after old CLs.

Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Bug: 31113334
Change-Id: I8af0e845c24d674d0efab21d80c29949b1cc0593
diff --git a/runtime/stack.cc b/runtime/stack.cc
index f58fc3b..c4851e1 100644
--- a/runtime/stack.cc
+++ b/runtime/stack.cc
@@ -597,7 +597,7 @@
 void StackVisitor::SanityCheckFrame() const {
   if (kIsDebugBuild) {
     ArtMethod* method = GetMethod();
-    mirror::Class* declaring_class = method->GetDeclaringClass();
+    ObjPtr<mirror::Class> declaring_class = method->GetDeclaringClass();
     // Runtime methods have null declaring class.
     if (!method->IsRuntimeMethod()) {
       CHECK(declaring_class != nullptr);
@@ -613,7 +613,7 @@
       // We get the canonical method as copied methods may have their declaring
       // class from another class loader.
       ArtMethod* canonical = method->GetCanonicalMethod();
-      mirror::Class* klass = canonical->GetDeclaringClass();
+      ObjPtr<mirror::Class> klass = canonical->GetDeclaringClass();
       LinearAlloc* const class_linear_alloc = (klass != nullptr)
           ? runtime->GetClassLinker()->GetAllocatorForClassLoader(klass->GetClassLoader())
           : linear_alloc;