diff options
author | Razvan A Lupusoru <razvan.a.lupusoru@intel.com> | 2014-07-02 18:16:51 -0700 |
---|---|---|
committer | Ian Rogers <irogers@google.com> | 2014-08-26 17:24:59 -0700 |
commit | bd25d4bff69e4775b7844d48630618b5ad8d3343 (patch) | |
tree | b6837d257d9f292845c5a1d51a94e3be2f62e332 /dex2oat | |
parent | a9ffc181c61f5634753bf1039ed50bf22c800fde (diff) | |
download | art-bd25d4bff69e4775b7844d48630618b5ad8d3343.zip art-bd25d4bff69e4775b7844d48630618b5ad8d3343.tar.gz art-bd25d4bff69e4775b7844d48630618b5ad8d3343.tar.bz2 |
ART: Add capability for a pass to have options
This patch adds capability to have pass options. These are needed when a pass
has multiple flags that can be tweaked. The user is now allowed to pass those
options via command line.
Since passes are treated as singletons and they are immutable, the overridden
options provided by user are set on the compilation unit. Doing this way also
allows a selectivity system to tweak the option per compilation instead of
doing it globally (due to the single pass existing).
The following command line flags have been added:
--print-pass-options - This prints all passes that have options along with
their defaults.
--pass-options= - This is used to pass the overridden options in format of
PassName:PassOption:PassOptionSetting
Change-Id: Ib5156f5d2ff51a0c64c4ea0fa050bd2170663417
Signed-off-by: Razvan A Lupusoru <razvan.a.lupusoru@intel.com>
Signed-off-by: Jean Christophe Beyler <jean.christophe.beyler@intel.com>
Diffstat (limited to 'dex2oat')
-rw-r--r-- | dex2oat/dex2oat.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/dex2oat/dex2oat.cc b/dex2oat/dex2oat.cc index 19b37af..aef235b 100644 --- a/dex2oat/dex2oat.cc +++ b/dex2oat/dex2oat.cc @@ -226,6 +226,15 @@ static void Usage(const char* fmt, ...) { UsageError(" --disable-passes=<pass-names>: disable one or more passes separated by comma."); UsageError(" Example: --disable-passes=UseCount,BBOptimizations"); UsageError(""); + UsageError(" --print-pass-options: print a list of passes that have configurable options along " + "with the setting."); + UsageError(" Will print default if no overridden setting exists."); + UsageError(""); + UsageError(" --pass-options=Pass1Name:Pass1OptionName:Pass1Option#," + "Pass2Name:Pass2OptionName:Pass2Option#"); + UsageError(" Used to specify a pass specific option. The setting itself must be integer."); + UsageError(" Separator used between options is a comma."); + UsageError(""); std::cerr << "See log for usage error information\n"; exit(EXIT_FAILURE); } @@ -847,6 +856,7 @@ static int dex2oat(int argc, char** argv) { bool dump_stats = false; bool dump_timing = false; bool dump_passes = false; + bool print_pass_options = false; bool include_patch_information = CompilerOptions::kDefaultIncludePatchInformation; bool include_debug_symbols = kIsDebugBuild; bool dump_slow_timing = kIsDebugBuild; @@ -1033,6 +1043,11 @@ static int dex2oat(int argc, char** argv) { } else if (option.starts_with("--dump-cfg-passes=")) { std::string dump_passes = option.substr(strlen("--dump-cfg-passes=")).data(); PassDriverMEOpts::SetDumpPassList(dump_passes); + } else if (option == "--print-pass-options") { + print_pass_options = true; + } else if (option.starts_with("--pass-options=")) { + std::string options = option.substr(strlen("--pass-options=")).data(); + PassDriverMEOpts::SetOverriddenPassOptions(options); } else if (option == "--include-patch-information") { include_patch_information = true; } else if (option == "--no-include-patch-information") { @@ -1179,6 +1194,10 @@ static int dex2oat(int argc, char** argv) { break; } + if (print_pass_options) { + PassDriverMEOpts::PrintPassOptions(); + } + std::unique_ptr<CompilerOptions> compiler_options(new CompilerOptions(compiler_filter, huge_method_threshold, large_method_threshold, |