summaryrefslogtreecommitdiffstats
path: root/runtime/oat.h
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/oat.h')
-rw-r--r--runtime/oat.h42
1 files changed, 30 insertions, 12 deletions
diff --git a/runtime/oat.h b/runtime/oat.h
index 7be768c..fbed596 100644
--- a/runtime/oat.h
+++ b/runtime/oat.h
@@ -23,6 +23,7 @@
#include "dex_file.h"
#include "instruction_set.h"
#include "quick/quick_method_frame_info.h"
+#include "safe_map.h"
namespace art {
@@ -31,13 +32,16 @@ class PACKED(4) OatHeader {
static const uint8_t kOatMagic[4];
static const uint8_t kOatVersion[4];
- OatHeader();
- OatHeader(InstructionSet instruction_set,
- const InstructionSetFeatures& instruction_set_features,
- const std::vector<const DexFile*>* dex_files,
- uint32_t image_file_location_oat_checksum,
- uint32_t image_file_location_oat_data_begin,
- const std::string& image_file_location);
+ static constexpr const char* kImageLocationKey = "image-location";
+ static constexpr const char* kDex2OatCmdLineKey = "dex2oat-cmdline";
+ static constexpr const char* kDex2OatHostKey = "dex2oat-host";
+
+ static OatHeader* Create(InstructionSet instruction_set,
+ const InstructionSetFeatures& instruction_set_features,
+ const std::vector<const DexFile*>* dex_files,
+ uint32_t image_file_location_oat_checksum,
+ uint32_t image_file_location_oat_data_begin,
+ const SafeMap<std::string, std::string>* variable_data);
bool IsValid() const;
const char* GetMagic() const;
@@ -88,11 +92,24 @@ class PACKED(4) OatHeader {
const InstructionSetFeatures& GetInstructionSetFeatures() const;
uint32_t GetImageFileLocationOatChecksum() const;
uint32_t GetImageFileLocationOatDataBegin() const;
- uint32_t GetImageFileLocationSize() const;
- const uint8_t* GetImageFileLocationData() const;
- std::string GetImageFileLocation() const;
+
+ uint32_t GetKeyValueStoreSize() const;
+ const uint8_t* GetKeyValueStore() const;
+ const char* GetStoreValueByKey(const char* key) const;
+ bool GetStoreKeyValuePairByIndex(size_t index, const char** key, const char** value) const;
+
+ size_t GetHeaderSize() const;
private:
+ OatHeader(InstructionSet instruction_set,
+ const InstructionSetFeatures& instruction_set_features,
+ const std::vector<const DexFile*>* dex_files,
+ uint32_t image_file_location_oat_checksum,
+ uint32_t image_file_location_oat_data_begin,
+ const SafeMap<std::string, std::string>* variable_data);
+
+ void Flatten(const SafeMap<std::string, std::string>* variable_data);
+
uint8_t magic_[4];
uint8_t version_[4];
uint32_t adler32_checksum_;
@@ -114,8 +131,9 @@ class PACKED(4) OatHeader {
uint32_t image_file_location_oat_checksum_;
uint32_t image_file_location_oat_data_begin_;
- uint32_t image_file_location_size_;
- uint8_t image_file_location_data_[0]; // note variable width data at end
+
+ uint32_t key_value_store_size_;
+ uint8_t key_value_store_[0]; // note variable width data at end
DISALLOW_COPY_AND_ASSIGN(OatHeader);
};