ART: Key-Value Store in Oat header
Allows the storage of string-string pairs in the oat header. The
first significant use of this is storing the implicit-check flags,
so that an oat file can be rejected if it doesn't agree with the
current runtime.
Bump the oat version as the header structure changes.
Change-Id: I15a1c16886e6b8fa7b881c918c19c1efa5c7c00f
diff --git a/compiler/image_test.cc b/compiler/image_test.cc
index d52ec0a..406d9d2 100644
--- a/compiler/image_test.cc
+++ b/compiler/image_test.cc
@@ -25,6 +25,7 @@
#include "compiler/image_writer.h"
#include "compiler/oat_writer.h"
#include "gc/space/image_space.h"
+#include "implicit_check_options.h"
#include "lock_word.h"
#include "mirror/object-inl.h"
#include "signal_catcher.h"
@@ -77,8 +78,11 @@
t.NewTiming("WriteElf");
ScopedObjectAccess soa(Thread::Current());
- OatWriter oat_writer(class_linker->GetBootClassPath(),
- 0, 0, "", compiler_driver_.get(), &timings);
+ SafeMap<std::string, std::string> key_value_store;
+ key_value_store.Put(ImplicitCheckOptions::kImplicitChecksOatHeaderKey,
+ ImplicitCheckOptions::Serialize(true, true, true));
+ OatWriter oat_writer(class_linker->GetBootClassPath(), 0, 0, compiler_driver_.get(), &timings,
+ &key_value_store);
bool success = compiler_driver_->WriteElf(GetTestAndroidRoot(),
!kIsTargetBuild,
class_linker->GetBootClassPath(),