summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Geoffray <ngeoffray@google.com>2021-07-07 08:27:45 +0100
committerNicolas Geoffray <ngeoffray@google.com>2021-07-07 12:12:38 +0000
commitf5f12babd02f4ea8e0d221932038bec914968345 (patch)
tree4d458b50dbba0011c3c01a2056bca2b19ad2bd4f
parent17ee07127d4f253afab32cae72c35127cbc30722 (diff)
downloadart-f5f12babd02f4ea8e0d221932038bec914968345.tar.gz
Set compilation reason in vdex-only OatFile.
Test: test.py Bug: 192408935 Merged-In: Ib87ea546876bfb4c6bf87b60f5a4f8aa306bd186 (cherry picked from commit b17c908047a2df675ecb4bd0aa2b21114376bbae) Change-Id: I81ea447c12250c24fa88205dac9c1289b15faba8
-rw-r--r--runtime/oat_file.cc5
-rw-r--r--runtime/oat_file_assistant_test.cc4
2 files changed, 4 insertions, 5 deletions
diff --git a/runtime/oat_file.cc b/runtime/oat_file.cc
index 49d5e61013..8f653c2282 100644
--- a/runtime/oat_file.cc
+++ b/runtime/oat_file.cc
@@ -1665,13 +1665,12 @@ class OatFileBackedByVdex final : public OatFileBase {
void SetupHeader(size_t number_of_dex_files) {
DCHECK(!IsExecutable());
- // Create a fake OatHeader with a key store containing only the compiler
- // filter (it helps debugging and is required by
- // OatHeader::GetCompilerFilter).
+ // Create a fake OatHeader with a key store to help debugging.
std::unique_ptr<const InstructionSetFeatures> isa_features =
InstructionSetFeatures::FromCppDefines();
SafeMap<std::string, std::string> store;
store.Put(OatHeader::kCompilerFilter, CompilerFilter::NameOfFilter(CompilerFilter::kVerify));
+ store.Put(OatHeader::kCompilationReasonKey, "vdex");
store.Put(OatHeader::kConcurrentCopying,
kUseReadBarrier ? OatHeader::kTrueValue : OatHeader::kFalseValue);
oat_header_.reset(OatHeader::Create(kRuntimeISA,
diff --git a/runtime/oat_file_assistant_test.cc b/runtime/oat_file_assistant_test.cc
index 376088568a..68ae83da6f 100644
--- a/runtime/oat_file_assistant_test.cc
+++ b/runtime/oat_file_assistant_test.cc
@@ -615,7 +615,7 @@ TEST_F(OatFileAssistantTest, VdexUpToDateNoOdex) {
&oat_file_assistant,
dex_location,
"verify",
- "unknown",
+ "vdex",
"up-to-date");
}
@@ -889,7 +889,7 @@ TEST_F(OatFileAssistantTest, OatImageOutOfDate) {
&oat_file_assistant,
dex_location,
"verify",
- "unknown",
+ "vdex",
"up-to-date");
}