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/monitor.cc b/src/monitor.cc
index 6b7fbf1..6a18a90 100644
--- a/src/monitor.cc
+++ b/src/monitor.cc
@@ -205,7 +205,7 @@
     uint64_t waitStart = 0;
     uint64_t waitEnd = 0;
     uint32_t wait_threshold = lock_profiling_threshold_;
-    const Method* current_locking_method = NULL;
+    const AbstractMethod* current_locking_method = NULL;
     uint32_t current_locking_dex_pc = 0;
     {
       ScopedThreadStateChange tsc(self, kBlocked);
@@ -461,7 +461,7 @@
   int prev_lock_count = lock_count_;
   lock_count_ = 0;
   owner_ = NULL;
-  const Method* saved_method = locking_method_;
+  const AbstractMethod* saved_method = locking_method_;
   locking_method_ = NULL;
   uintptr_t saved_dex_pc = locking_dex_pc_;
   locking_dex_pc_ = 0;
@@ -918,7 +918,7 @@
 }
 
 void Monitor::DescribeLocks(std::ostream& os, StackVisitor* stack_visitor) {
-  Method* m = stack_visitor->GetMethod();
+  AbstractMethod* m = stack_visitor->GetMethod();
   CHECK(m != NULL);
 
   // Native methods are an easy special case.
@@ -982,7 +982,7 @@
   }
 }
 
-void Monitor::TranslateLocation(const Method* method, uint32_t dex_pc,
+void Monitor::TranslateLocation(const AbstractMethod* method, uint32_t dex_pc,
                                 const char*& source_file, uint32_t& line_number) const {
   // If method is null, location is unknown
   if (method == NULL) {