summaryrefslogtreecommitdiff
path: root/runtime/oat_file_assistant.h
diff options
context:
space:
mode:
author Shubham Ajmera <shubhamajmera@google.com> 2017-07-24 19:11:28 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2017-07-24 19:11:28 +0000
commit2ae4bc9f5b620bc768e4ae2ecab641a06a488a70 (patch)
tree071b002a76308f0a2830aa73c251970735ecb513 /runtime/oat_file_assistant.h
parent8bf4fece8a4cecc869f8684d52e91ade630f84df (diff)
parente4e812a917345a3cb9ac955c8a84f64dfc26b5d9 (diff)
Merge "Allow DexFile#getDexOptNeeded to check case when downgrading is required"
Diffstat (limited to 'runtime/oat_file_assistant.h')
-rw-r--r--runtime/oat_file_assistant.h28
1 files changed, 22 insertions, 6 deletions
diff --git a/runtime/oat_file_assistant.h b/runtime/oat_file_assistant.h
index 92d87eaeae..320aa4f860 100644
--- a/runtime/oat_file_assistant.h
+++ b/runtime/oat_file_assistant.h
@@ -147,13 +147,24 @@ class OatFileAssistant {
bool Lock(std::string* error_msg);
// Return what action needs to be taken to produce up-to-date code for this
- // dex location that is at least as good as an oat file generated with the
- // given compiler filter. profile_changed should be true to indicate the
- // profile has recently changed for this dex location.
+ // dex location. If "downgrade" is set to false, it verifies if the current
+ // compiler filter is at least as good as an oat file generated with the
+ // given compiler filter otherwise, if its set to true, it checks whether
+ // the oat file generated with the target filter will be downgraded as
+ // compared to the current state. For example, if the current compiler filter is
+ // quicken, and target filter is verify, it will recommend to dexopt, while
+ // if the target filter is speed profile, it will recommend to keep it in its
+ // current state.
+ // profile_changed should be true to indicate the profile has recently changed
+ // for this dex location.
+ // If the purpose of the dexopt is to downgrade the compiler filter,
+ // set downgrade to true.
// Returns a positive status code if the status refers to the oat file in
// the oat location. Returns a negative status code if the status refers to
// the oat file in the odex location.
- int GetDexOptNeeded(CompilerFilter::Filter target_compiler_filter, bool profile_changed = false);
+ int GetDexOptNeeded(CompilerFilter::Filter target_compiler_filter,
+ bool profile_changed = false,
+ bool downgrade = false);
// Returns true if there is up-to-date code for this dex location,
// irrespective of the compiler filter of the up-to-date code.
@@ -310,8 +321,11 @@ class OatFileAssistant {
// given target_compilation_filter.
// profile_changed should be true to indicate the profile has recently
// changed for this dex location.
+ // downgrade should be true if the purpose of dexopt is to downgrade the
+ // compiler filter.
DexOptNeeded GetDexOptNeeded(CompilerFilter::Filter target_compiler_filter,
- bool profile_changed);
+ bool profile_changed,
+ bool downgrade);
// Returns the loaded file.
// Loads the file if needed. Returns null if the file failed to load.
@@ -344,7 +358,9 @@ class OatFileAssistant {
// least as good as the given target filter. profile_changed should be
// true to indicate the profile has recently changed for this dex
// location.
- bool CompilerFilterIsOkay(CompilerFilter::Filter target, bool profile_changed);
+ // downgrade should be true if the purpose of dexopt is to downgrade the
+ // compiler filter.
+ bool CompilerFilterIsOkay(CompilerFilter::Filter target, bool profile_changed, bool downgrade);
// Release the loaded oat file.
// Returns null if the oat file hasn't been loaded.