Add an abstraction over a compiled code.

That's just step 1, moving code-related functions of ArtMethod to
another class. That class is only a wrapper on an ArtMethod, but will
be changed to be a wrapper around compiled code.

Change-Id: I6f35fc06d37220558dff61691e51ae20066b0dd6
diff --git a/runtime/utils.cc b/runtime/utils.cc
index 27dacea..40cd6d3 100644
--- a/runtime/utils.cc
+++ b/runtime/utils.cc
@@ -25,6 +25,7 @@
 #include <unistd.h>
 #include <memory>
 
+#include "art_code.h"
 #include "art_field-inl.h"
 #include "art_method-inl.h"
 #include "base/stl_util.h"
@@ -1092,7 +1093,7 @@
 #endif
 
 void DumpNativeStack(std::ostream& os, pid_t tid, const char* prefix,
-    ArtMethod* current_method, void* ucontext_ptr) {
+    ArtMethod* current_method, ArtCode* current_code, void* ucontext_ptr) {
 #if __linux__
   // b/18119146
   if (RUNNING_ON_MEMORY_TOOL != 0) {
@@ -1148,8 +1149,8 @@
         try_addr2line = true;
       } else if (
           current_method != nullptr && Locks::mutator_lock_->IsSharedHeld(Thread::Current()) &&
-          current_method->PcIsWithinQuickCode(it->pc)) {
-        const void* start_of_code = current_method->GetEntryPointFromQuickCompiledCode();
+          current_code->PcIsWithinQuickCode(it->pc)) {
+        const void* start_of_code = current_code->GetQuickOatEntryPoint(sizeof(void*));
         os << JniLongName(current_method) << "+"
            << (it->pc - reinterpret_cast<uintptr_t>(start_of_code));
       } else {
@@ -1163,7 +1164,7 @@
     }
   }
 #else
-  UNUSED(os, tid, prefix, current_method, ucontext_ptr);
+  UNUSED(os, tid, prefix, current_method, current_code, ucontext_ptr);
 #endif
 }