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/native/java_lang_Class.cc b/runtime/native/java_lang_Class.cc
index 82e54e2..5a5fb16 100644
--- a/runtime/native/java_lang_Class.cc
+++ b/runtime/native/java_lang_Class.cc
@@ -544,8 +544,8 @@
     if (MethodMatchesConstructor(&m, public_only, enforce_hidden_api)) {
       DCHECK_EQ(Runtime::Current()->GetClassLinker()->GetImagePointerSize(), kRuntimePointerSize);
       DCHECK(!Runtime::Current()->IsActiveTransaction());
-      auto* constructor = mirror::Constructor::CreateFromArtMethod<kRuntimePointerSize, false>(
-          soa.Self(), &m);
+      ObjPtr<mirror::Constructor> constructor =
+          mirror::Constructor::CreateFromArtMethod<kRuntimePointerSize, false>(soa.Self(), &m);
       if (UNLIKELY(constructor == nullptr)) {
         soa.Self()->AssertPendingOOMException();
         return nullptr;
@@ -605,7 +605,7 @@
         IsDiscoverable(public_only, enforce_hidden_api, &m)) {
       DCHECK_EQ(Runtime::Current()->GetClassLinker()->GetImagePointerSize(), kRuntimePointerSize);
       DCHECK(!Runtime::Current()->IsActiveTransaction());
-      auto* method =
+      ObjPtr<mirror::Method> method =
           mirror::Method::CreateFromArtMethod<kRuntimePointerSize, false>(soa.Self(), &m);
       if (method == nullptr) {
         soa.Self()->AssertPendingException();
@@ -838,7 +838,7 @@
     return nullptr;
   }
   // Verify that we can access the constructor.
-  auto* declaring_class = constructor->GetDeclaringClass();
+  ObjPtr<mirror::Class> declaring_class = constructor->GetDeclaringClass();
   if (!constructor->IsPublic()) {
     if (caller == nullptr) {
       caller.Assign(GetCallingClass(soa.Self(), 1));