Make oatdump see the new vmap table generated by dextodex.

Change-Id: I48f3fb7320e39c864f8fbc478f970b18358408ec
diff --git a/oatdump/oatdump.cc b/oatdump/oatdump.cc
index 82452ba..e0d7708 100644
--- a/oatdump/oatdump.cc
+++ b/oatdump/oatdump.cc
@@ -1036,6 +1036,11 @@
         ScopedIndentation indent1(vios);
         DumpCodeInfo(vios, code_info, oat_method, *code_item);
       }
+    } else if (IsMethodGeneratedByDexToDexCompiler(oat_method, code_item)) {
+      // We don't encode the size in the table, so just emit that we have quickened
+      // information.
+      ScopedIndentation indent(vios);
+      vios->Stream() << "quickened data\n";
     } else {
       // Otherwise, display the vmap table.
       const uint8_t* raw_table = oat_method.GetVmapTable();
@@ -1345,7 +1350,21 @@
     // If the native GC map is null and the Dex `code_item` is not
     // null, then this method has been compiled with the optimizing
     // compiler.
-    return oat_method.GetGcMap() == nullptr && code_item != nullptr;
+    return oat_method.GetQuickCode() != nullptr &&
+           oat_method.GetGcMap() == nullptr &&
+           code_item != nullptr;
+  }
+
+  // Has `oat_method` -- corresponding to the Dex `code_item` -- been compiled by
+  // the dextodex compiler?
+  static bool IsMethodGeneratedByDexToDexCompiler(const OatFile::OatMethod& oat_method,
+                                                  const DexFile::CodeItem* code_item) {
+    // If the quick code is null, the Dex `code_item` is not
+    // null, and the vmap table is not null, then this method has been compiled
+    // with the dextodex compiler.
+    return oat_method.GetQuickCode() == nullptr &&
+           oat_method.GetVmapTable() != nullptr &&
+           code_item != nullptr;
   }
 
   void DumpDexRegisterMapAtOffset(VariableIndentationOutputStream* vios,
diff --git a/runtime/oat_file-inl.h b/runtime/oat_file-inl.h
index 37d025a..5df6525 100644
--- a/runtime/oat_file-inl.h
+++ b/runtime/oat_file-inl.h
@@ -22,7 +22,7 @@
 namespace art {
 
 inline const OatQuickMethodHeader* OatFile::OatMethod::GetOatQuickMethodHeader() const {
-  const void* code = ArtMethod::EntryPointToCodePointer(GetQuickCode());
+  const void* code = ArtMethod::EntryPointToCodePointer(GetOatPointer<const void*>(code_offset_));
   if (code == nullptr) {
     return nullptr;
   }
@@ -71,7 +71,7 @@
 }
 
 inline const uint8_t* OatFile::OatMethod::GetGcMap() const {
-  const void* code = ArtMethod::EntryPointToCodePointer(GetQuickCode());
+  const void* code = ArtMethod::EntryPointToCodePointer(GetOatPointer<const void*>(code_offset_));
   if (code == nullptr) {
     return nullptr;
   }
@@ -122,7 +122,7 @@
 }
 
 inline const uint8_t* OatFile::OatMethod::GetMappingTable() const {
-  const void* code = ArtMethod::EntryPointToCodePointer(GetQuickCode());
+  const void* code = ArtMethod::EntryPointToCodePointer(GetOatPointer<const void*>(code_offset_));
   if (code == nullptr) {
     return nullptr;
   }
@@ -134,7 +134,7 @@
 }
 
 inline const uint8_t* OatFile::OatMethod::GetVmapTable() const {
-  const void* code = ArtMethod::EntryPointToCodePointer(GetQuickCode());
+  const void* code = ArtMethod::EntryPointToCodePointer(GetOatPointer<const void*>(code_offset_));
   if (code == nullptr) {
     return nullptr;
   }