Change dex cache to be java object instead of array, add pointer to dex file in dex cache.

Generic clean up to facilitate having GDB macros for Pretty* helper functions.

Improved cleanliness of DexCache since having it as an object array was not the best solution.

Fixed a bug in InOrderWalk caused by ResolveType sometimes allocating classes.

Rename C++ Method to AbstractMethod and add two new classes Constructor, Method which both inherit from AbstractMethod.

Rename done to have the C++ code be closer to the java code.

Change-Id: I4995b4c5e47a3822192b08afa24a639d3b1f4da9
diff --git a/src/oatdump.cc b/src/oatdump.cc
index d3bebfd..88d6976 100644
--- a/src/oatdump.cc
+++ b/src/oatdump.cc
@@ -156,7 +156,7 @@
     return oat_file_.GetOatHeader().GetInstructionSet();
   }
 
-  const void* GetOatCode(Method* m) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
+  const void* GetOatCode(AbstractMethod* m) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
     MethodHelper mh(m);
     for (size_t i = 0; i < oat_dex_files_.size(); i++) {
       const OatFile::OatDexFile* oat_dex_file = oat_dex_files_[i];
@@ -611,7 +611,7 @@
       Field* field = value->AsField();
       StringAppendF(&summary, "%p   Field: %s\n", field, PrettyField(field).c_str());
     } else if (value->IsMethod()) {
-      Method* method = value->AsMethod();
+      AbstractMethod* method = value->AsMethod();
       StringAppendF(&summary, "%p   Method: %s\n", method, PrettyMethod(method).c_str());
     } else {
       StringAppendF(&summary, "%p   %s\n", value, PrettyDescriptor(type).c_str());
@@ -666,7 +666,7 @@
     return image_space_.Contains(object);
   }
 
-  const void* GetOatCodeBegin(Method* m)
+  const void* GetOatCodeBegin(AbstractMethod* m)
       SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
     Runtime* runtime = Runtime::Current();
     const void* code = m->GetCode();
@@ -679,7 +679,7 @@
     return code;
   }
 
-  uint32_t GetOatCodeSize(Method* m)
+  uint32_t GetOatCodeSize(AbstractMethod* m)
       SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
     const uint32_t* oat_code_begin = reinterpret_cast<const uint32_t*>(GetOatCodeBegin(m));
     if (oat_code_begin == NULL) {
@@ -688,7 +688,7 @@
     return oat_code_begin[-1];
   }
 
-  const void* GetOatCodeEnd(Method* m)
+  const void* GetOatCodeEnd(AbstractMethod* m)
       SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
     const uint8_t* oat_code_begin = reinterpret_cast<const uint8_t*>(GetOatCodeBegin(m));
     if (oat_code_begin == NULL) {
@@ -768,7 +768,7 @@
         }
       }
     } else if (obj->IsMethod()) {
-      Method* method = obj->AsMethod();
+      AbstractMethod* method = obj->AsMethod();
       if (method->IsNative()) {
         DCHECK(method->GetNativeGcMap() == NULL) << PrettyMethod(method);
         DCHECK(method->GetMappingTable() == NULL) << PrettyMethod(method);
@@ -895,7 +895,7 @@
 
     size_t dex_instruction_bytes;
 
-    std::vector<Method*> method_outlier;
+    std::vector<AbstractMethod*> method_outlier;
     std::vector<size_t> method_outlier_size;
     std::vector<double> method_outlier_expansion;
 
@@ -947,7 +947,7 @@
       return (static_cast<double>(size) / static_cast<double>(object_bytes)) * 100;
     }
 
-    void ComputeOutliers(size_t total_size, double expansion, Method* method) {
+    void ComputeOutliers(size_t total_size, double expansion, AbstractMethod* method) {
       method_outlier_size.push_back(total_size);
       method_outlier_expansion.push_back(expansion);
       method_outlier.push_back(method);