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/stack.cc b/src/stack.cc
index c13aaf4..2567c50 100644
--- a/src/stack.cc
+++ b/src/stack.cc
@@ -80,7 +80,7 @@
 }
 
 
-uint32_t StackVisitor::GetVReg(Method* m, int vreg) const {
+uint32_t StackVisitor::GetVReg(AbstractMethod* m, int vreg) const {
   if (cur_quick_frame_ != NULL) {
     DCHECK(context_ != NULL); // You can't reliably read registers without a context.
     DCHECK(m == GetMethod());
@@ -115,7 +115,7 @@
   }
 }
 
-void StackVisitor::SetVReg(Method* m, int vreg, uint32_t new_value) {
+void StackVisitor::SetVReg(AbstractMethod* m, int vreg, uint32_t new_value) {
   if (cur_quick_frame_ != NULL) {
     DCHECK(context_ != NULL); // You can't reliably write registers without a context.
     DCHECK(m == GetMethod());
@@ -144,14 +144,14 @@
 }
 
 uintptr_t StackVisitor::GetReturnPc() const {
-  Method** sp = GetCurrentQuickFrame();
+  AbstractMethod** sp = GetCurrentQuickFrame();
   CHECK(sp != NULL);
   byte* pc_addr = reinterpret_cast<byte*>(sp) + GetMethod()->GetReturnPcOffsetInBytes();
   return *reinterpret_cast<uintptr_t*>(pc_addr);
 }
 
 void StackVisitor::SetReturnPc(uintptr_t new_ret_pc) {
-  Method** sp = GetCurrentQuickFrame();
+  AbstractMethod** sp = GetCurrentQuickFrame();
   CHECK(sp != NULL);
   byte* pc_addr = reinterpret_cast<byte*>(sp) + GetMethod()->GetReturnPcOffsetInBytes();
   *reinterpret_cast<uintptr_t*>(pc_addr) = new_ret_pc;
@@ -178,9 +178,9 @@
 
 void StackVisitor::SanityCheckFrame() const {
 #ifndef NDEBUG
-  Method* method = GetMethod();
-  CHECK(method->GetClass() == Method::GetMethodClass() ||
-        method->GetClass() == Method::GetConstructorClass());
+  AbstractMethod* method = GetMethod();
+  CHECK(method->GetClass() == AbstractMethod::GetMethodClass() ||
+        method->GetClass() == AbstractMethod::GetConstructorClass());
   if (cur_quick_frame_ != NULL) {
     method->AssertPcIsWithinCode(cur_quick_frame_pc_);
     // Frame sanity.
@@ -204,7 +204,7 @@
     if (cur_quick_frame_ != NULL) {  // Handle quick stack frames.
       // Can't be both a shadow and a quick fragment.
       DCHECK(current_fragment->GetTopShadowFrame() == NULL);
-      Method* method = *cur_quick_frame_;
+      AbstractMethod* method = *cur_quick_frame_;
       do {
         SanityCheckFrame();
         bool should_continue = VisitFrame();
@@ -234,7 +234,7 @@
         }
         cur_quick_frame_pc_ = return_pc;
         byte* next_frame = reinterpret_cast<byte*>(cur_quick_frame_) + frame_size;
-        cur_quick_frame_ = reinterpret_cast<Method**>(next_frame);
+        cur_quick_frame_ = reinterpret_cast<AbstractMethod**>(next_frame);
         cur_depth_++;
         method = *cur_quick_frame_;
       } while (method != NULL);