Revert "Revert "ART: Key-Value Store in Oat header""
This reverts commit 452bee5da9811f62123978e142bd67b385e9ff82.
Heap-allocate a couple of objects in dex2oat to avoid large frame
size.
Includes fixes originally in 100596 and 100605.
Change-Id: Id51a44198c973c91f0a3f87b9d992a5dc110c6f8
diff --git a/oatdump/oatdump.cc b/oatdump/oatdump.cc
index 12970fc..631d538 100644
--- a/oatdump/oatdump.cc
+++ b/oatdump/oatdump.cc
@@ -171,10 +171,18 @@
os << "IMAGE FILE LOCATION OAT BEGIN:\n";
os << StringPrintf("0x%08x\n\n", oat_header.GetImageFileLocationOatDataBegin());
- os << "IMAGE FILE LOCATION:\n";
- const std::string image_file_location(oat_header.GetImageFileLocation());
- os << image_file_location;
- os << "\n\n";
+ // Print the key-value store.
+ {
+ os << "KEY VALUE STORE:\n";
+ size_t index = 0;
+ const char* key;
+ const char* value;
+ while (oat_header.GetStoreKeyValuePairByIndex(index, &key, &value)) {
+ os << key << " = " << value << "\n";
+ index++;
+ }
+ os << "\n";
+ }
os << "BEGIN:\n";
os << reinterpret_cast<const void*>(oat_file_.Begin()) << "\n\n";