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/compiler/codegen/GenCommon.cc b/src/compiler/codegen/GenCommon.cc
index 5593151..99a76da 100644
--- a/src/compiler/codegen/GenCommon.cc
+++ b/src/compiler/codegen/GenCommon.cc
@@ -698,7 +698,7 @@
       RegLocation rlMethod  = loadCurrMethod(cUnit);
       rBase = oatAllocTemp(cUnit);
       loadWordDisp(cUnit, rlMethod.lowReg,
-                   Method::DeclaringClassOffset().Int32Value(), rBase);
+                   AbstractMethod::DeclaringClassOffset().Int32Value(), rBase);
       if (oatIsTemp(cUnit, rlMethod.lowReg)) {
         oatFreeTemp(cUnit, rlMethod.lowReg);
       }
@@ -716,7 +716,7 @@
       rBase = rARG0;
       oatLockTemp(cUnit, rBase);
       loadWordDisp(cUnit, rMethod,
-                   Method::DexCacheInitializedStaticStorageOffset().Int32Value(),
+                   AbstractMethod::DexCacheInitializedStaticStorageOffset().Int32Value(),
                    rBase);
       loadWordDisp(cUnit, rBase,
                    Array::DataOffset(sizeof(Object*)).Int32Value() +
@@ -793,7 +793,7 @@
       RegLocation rlMethod  = loadCurrMethod(cUnit);
       rBase = oatAllocTemp(cUnit);
       loadWordDisp(cUnit, rlMethod.lowReg,
-                   Method::DeclaringClassOffset().Int32Value(), rBase);
+                   AbstractMethod::DeclaringClassOffset().Int32Value(), rBase);
     } else {
       // Medium path, static storage base in a different class which
       // requires checks that the other class is initialized
@@ -808,7 +808,7 @@
       rBase = rARG0;
       oatLockTemp(cUnit, rBase);
       loadWordDisp(cUnit, rMethod,
-                   Method::DexCacheInitializedStaticStorageOffset().Int32Value(),
+                   AbstractMethod::DexCacheInitializedStaticStorageOffset().Int32Value(),
                    rBase);
       loadWordDisp(cUnit, rBase,
                    Array::DataOffset(sizeof(Object*)).Int32Value() +
@@ -1142,7 +1142,7 @@
   } else {
     // We're don't need access checks, load type from dex cache
     int32_t dex_cache_offset =
-        Method::DexCacheResolvedTypesOffset().Int32Value();
+        AbstractMethod::DexCacheResolvedTypesOffset().Int32Value();
     loadWordDisp(cUnit, rlMethod.lowReg, dex_cache_offset, resReg);
     int32_t offset_of_type =
         Array::DataOffset(sizeof(Class*)).Int32Value() + (sizeof(Class*)
@@ -1197,7 +1197,7 @@
     oatLockCallTemps(cUnit); // Using explicit registers
     loadCurrMethodDirect(cUnit, rARG2);
     loadWordDisp(cUnit, rARG2,
-                 Method::DexCacheStringsOffset().Int32Value(), rARG0);
+                 AbstractMethod::DexCacheStringsOffset().Int32Value(), rARG0);
     // Might call out to helper, which will return resolved string in rRET0
 #if !defined(TARGET_X86)
     int rTgt = loadHelper(cUnit, ENTRYPOINT_OFFSET(pResolveStringFromCode));
@@ -1233,7 +1233,7 @@
     int resReg = oatAllocTemp(cUnit);
     RegLocation rlResult = oatEvalLoc(cUnit, rlDest, kCoreReg, true);
     loadWordDisp(cUnit, rlMethod.lowReg,
-                 Method::DexCacheStringsOffset().Int32Value(), resReg);
+                 AbstractMethod::DexCacheStringsOffset().Int32Value(), resReg);
     loadWordDisp(cUnit, resReg, offset_of_string, rlResult.lowReg);
     storeValue(cUnit, rlDest, rlResult);
   }
@@ -1287,7 +1287,7 @@
     // Load dex cache entry into classReg (rARG2)
     loadValueDirectFixed(cUnit, rlSrc, rARG0);  // rARG0 <= ref
     loadWordDisp(cUnit, rARG1,
-                 Method::DexCacheResolvedTypesOffset().Int32Value(), classReg);
+                 AbstractMethod::DexCacheResolvedTypesOffset().Int32Value(), classReg);
     int32_t offset_of_type =
         Array::DataOffset(sizeof(Class*)).Int32Value() + (sizeof(Class*)
         * type_idx);
@@ -1369,7 +1369,7 @@
   } else {
     // Load dex cache entry into classReg (rARG2)
     loadWordDisp(cUnit, rARG1,
-                 Method::DexCacheResolvedTypesOffset().Int32Value(), classReg);
+                 AbstractMethod::DexCacheResolvedTypesOffset().Int32Value(), classReg);
     int32_t offset_of_type =
         Array::DataOffset(sizeof(Class*)).Int32Value() +
         (sizeof(Class*) * type_idx);