diff options
author | Calin Juravle <calin@google.com> | 2016-03-09 11:57:36 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2016-03-09 11:57:36 +0000 |
commit | c421907d0df229e96390932503fda4bfbaf3e4d4 (patch) | |
tree | fe8fb6f16eb0c53af51c670dfded97dd7ca8d316 /dex2oat/dex2oat.cc | |
parent | 87aa99c261a7921e28fbe6136197bb640ddef4a4 (diff) | |
parent | b077e15d2d11b7c81aacbcd4a46c2b1e9c9ba20d (diff) | |
download | android_art-c421907d0df229e96390932503fda4bfbaf3e4d4.tar.gz android_art-c421907d0df229e96390932503fda4bfbaf3e4d4.tar.bz2 android_art-c421907d0df229e96390932503fda4bfbaf3e4d4.zip |
Merge "Update GetDexOptNeeded to handle different levels of compilation"
Diffstat (limited to 'dex2oat/dex2oat.cc')
-rw-r--r-- | dex2oat/dex2oat.cc | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/dex2oat/dex2oat.cc b/dex2oat/dex2oat.cc index 374d0d37a1..44e7fc9017 100644 --- a/dex2oat/dex2oat.cc +++ b/dex2oat/dex2oat.cc @@ -1034,9 +1034,11 @@ class Dex2Oat FINAL { key_value_store_->Put( OatHeader::kDebuggableKey, compiler_options_->debuggable_ ? OatHeader::kTrueValue : OatHeader::kFalseValue); - key_value_store_->Put( - OatHeader::kExtractOnlyKey, - compiler_options_->IsExtractOnly() ? OatHeader::kTrueValue : OatHeader::kFalseValue); + if (compiler_options_->IsExtractOnly()) { + key_value_store_->Put(OatHeader::kCompilationType, OatHeader::kExtractOnlyValue); + } else if (UseProfileGuidedCompilation()) { + key_value_store_->Put(OatHeader::kCompilationType, OatHeader::kProfileGuideCompiledValue); + } } // Parse the arguments from the command line. In case of an unrecognized option or impossible @@ -1891,13 +1893,6 @@ class Dex2Oat FINAL { return success; } - bool ShouldCompileBasedOnProfiles() const { - DCHECK(UseProfileGuidedCompilation()); - // If we are given a profile, compile only if we have some data in it. - return (profile_compilation_info_ != nullptr) && - (profile_compilation_info_->GetNumberOfMethods() != 0); - } - private: template <typename T> static std::vector<T*> MakeNonOwningPointerVector(const std::vector<std::unique_ptr<T>>& src) { @@ -2595,16 +2590,11 @@ static int dex2oat(int argc, char** argv) { // Parse arguments. Argument mistakes will lead to exit(EXIT_FAILURE) in UsageError. dex2oat->ParseArgs(argc, argv); - // Process profile information and assess if we need to do a profile guided compilation. + // If needed, process profile information for profile guided compilation. // This operation involves I/O. if (dex2oat->UseProfileGuidedCompilation()) { - if (dex2oat->LoadProfile()) { - if (!dex2oat->ShouldCompileBasedOnProfiles()) { - LOG(INFO) << "Skipped compilation because of insignificant profile delta"; - return EXIT_SUCCESS; - } - } else { - LOG(WARNING) << "Failed to process profile files"; + if (!dex2oat->LoadProfile()) { + LOG(ERROR) << "Failed to process profile file"; return EXIT_FAILURE; } } |