Move mirror::ArtMethod to native

Optimizing + quick tests are passing, devices boot.

TODO: Test and fix bugs in mips64.

Saves 16 bytes per most ArtMethod, 7.5MB reduction in system PSS.
Some of the savings are from removal of virtual methods and direct
methods object arrays.

Bug: 19264997
Change-Id: I622469a0cfa0e7082a2119f3d6a9491eb61e3f3d
diff --git a/runtime/monitor.cc b/runtime/monitor.cc
index dc016a5..4be25d6 100644
--- a/runtime/monitor.cc
+++ b/runtime/monitor.cc
@@ -21,6 +21,7 @@
 #include <cutils/trace.h>
 #include <vector>
 
+#include "art_method-inl.h"
 #include "base/mutex.h"
 #include "base/stl_util.h"
 #include "base/time_utils.h"
@@ -28,7 +29,6 @@
 #include "dex_file-inl.h"
 #include "dex_instruction.h"
 #include "lock_word-inl.h"
-#include "mirror/art_method-inl.h"
 #include "mirror/class-inl.h"
 #include "mirror/object-inl.h"
 #include "mirror/object_array-inl.h"
@@ -245,7 +245,7 @@
     // Contended.
     const bool log_contention = (lock_profiling_threshold_ != 0);
     uint64_t wait_start_ms = log_contention ? MilliTime() : 0;
-    mirror::ArtMethod* owners_method = locking_method_;
+    ArtMethod* owners_method = locking_method_;
     uint32_t owners_dex_pc = locking_dex_pc_;
     // Do this before releasing the lock so that we don't get deflated.
     size_t num_waiters = num_waiters_;
@@ -449,7 +449,7 @@
   int prev_lock_count = lock_count_;
   lock_count_ = 0;
   owner_ = nullptr;
-  mirror::ArtMethod* saved_method = locking_method_;
+  ArtMethod* saved_method = locking_method_;
   locking_method_ = nullptr;
   uintptr_t saved_dex_pc = locking_dex_pc_;
   locking_dex_pc_ = 0;
@@ -994,14 +994,15 @@
 
 void Monitor::VisitLocks(StackVisitor* stack_visitor, void (*callback)(mirror::Object*, void*),
                          void* callback_context, bool abort_on_failure) {
-  mirror::ArtMethod* m = stack_visitor->GetMethod();
+  ArtMethod* m = stack_visitor->GetMethod();
   CHECK(m != nullptr);
 
   // Native methods are an easy special case.
   // TODO: use the JNI implementation's table of explicit MonitorEnter calls and dump those too.
   if (m->IsNative()) {
     if (m->IsSynchronized()) {
-      mirror::Object* jni_this = stack_visitor->GetCurrentHandleScope()->GetReference(0);
+      mirror::Object* jni_this =
+          stack_visitor->GetCurrentHandleScope(sizeof(void*))->GetReference(0);
       callback(jni_this, callback_context);
     }
     return;
@@ -1087,7 +1088,7 @@
   return owner_ != nullptr;
 }
 
-void Monitor::TranslateLocation(mirror::ArtMethod* method, uint32_t dex_pc,
+void Monitor::TranslateLocation(ArtMethod* method, uint32_t dex_pc,
                                 const char** source_file, uint32_t* line_number) const {
   // If method is null, location is unknown
   if (method == nullptr) {