summaryrefslogtreecommitdiffstats
path: root/runtime/runtime.cc
diff options
context:
space:
mode:
authorbuzbee <buzbee@google.com>2013-07-31 10:47:37 -0700
committerbuzbee <buzbee@google.com>2013-08-08 13:30:16 -0700
commita024a0686c3b0fea13f362bff70d65981e5febc5 (patch)
tree99b003e7524544156a4e94bcca7daa41ed4d4b77 /runtime/runtime.cc
parente0a53e99e2a01f8668d6616c3cec7e2f5a711286 (diff)
downloadart-a024a0686c3b0fea13f362bff70d65981e5febc5.zip
art-a024a0686c3b0fea13f362bff70d65981e5febc5.tar.gz
art-a024a0686c3b0fea13f362bff70d65981e5febc5.tar.bz2
Compilation filter
This CL introduces a static compilation filter mechanism intended to allow us to reduce compilation time and space requirements until we have a profiling mechanism in place. It supports 5 modes of filtering: o interpret-only (compile nothing) o deferred-compilation (compile only those methods believe to be compute-intensive) o space (optimized for space) o balanced (best return on space investment) o speed (compile everything) A future CL will allow the default filtering mode to be set via system property. For now, you can pass it in via command line as follows: dalvikvm -compiler-filter:[interpret-only|defer-compilation| space|balanced|speed] or dex2oat --runtime-arg -compiler-filter:[one of the above modes] Creating a file named art/SMALL_ART will force the filter default to interpret-only. Later on we'll move this capability to a persistent system property. or modify kDefaultCompilerFilter in runtime.h It also changes the compiler driver to allow the compilers to decline to compile a method by return NULL. Change-Id: Ic73411818f8bb845a4a19a05b0395c50902c534f
Diffstat (limited to 'runtime/runtime.cc')
-rw-r--r--runtime/runtime.cc44
1 files changed, 32 insertions, 12 deletions
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index 5298181..70d8816 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -355,9 +355,12 @@ Runtime::ParsedOptions* Runtime::ParsedOptions::Create(const Options& options, b
parsed->hook_exit_ = exit;
parsed->hook_abort_ = NULL; // We don't call abort(3) by default; see Runtime::Abort.
- parsed->small_mode_ = false;
- parsed->small_mode_method_threshold_ = Runtime::kDefaultSmallModeMethodThreshold;
- parsed->small_mode_method_dex_size_limit_ = Runtime::kDefaultSmallModeMethodDexSizeLimit;
+ parsed->compiler_filter_ = Runtime::kDefaultCompilerFilter;
+ parsed->huge_method_threshold_ = Runtime::kDefaultHugeMethodThreshold;
+ parsed->large_method_threshold_ = Runtime::kDefaultLargeMethodThreshold;
+ parsed->small_method_threshold_ = Runtime::kDefaultSmallMethodThreshold;
+ parsed->tiny_method_threshold_ = Runtime::kDefaultTinyMethodThreshold;
+ parsed->num_dex_methods_threshold_ = Runtime::kDefaultNumDexMethodsThreshold;
parsed->sea_ir_mode_ = false;
// gLogVerbosity.class_linker = true; // TODO: don't check this in!
@@ -572,14 +575,28 @@ Runtime::ParsedOptions* Runtime::ParsedOptions::Create(const Options& options, b
Trace::SetDefaultClockSource(kProfilerClockSourceWall);
} else if (option == "-Xprofile:dualclock") {
Trace::SetDefaultClockSource(kProfilerClockSourceDual);
- } else if (option == "-small") {
- parsed->small_mode_ = true;
+ } else if (option == "-compiler-filter:interpret-only") {
+ parsed->compiler_filter_ = kInterpretOnly;
+ } else if (option == "-compiler-filter:defer-compilation") {
+ parsed->compiler_filter_ = kDeferCompilation;
+ } else if (option == "-compiler-filter:space") {
+ parsed->compiler_filter_ = kSpace;
+ } else if (option == "-compiler-filter:balanced") {
+ parsed->compiler_filter_ = kBalanced;
+ } else if (option == "-compiler-filter:speed") {
+ parsed->compiler_filter_ = kSpeed;
} else if (option == "-sea_ir") {
parsed->sea_ir_mode_ = true;
- } else if (StartsWith(option, "-small-mode-methods-max:")) {
- parsed->small_mode_method_threshold_ = ParseIntegerOrDie(option);
- } else if (StartsWith(option, "-small-mode-methods-size-max:")) {
- parsed->small_mode_method_dex_size_limit_ = ParseIntegerOrDie(option);
+ } else if (StartsWith(option, "-huge-method-max:")) {
+ parsed->huge_method_threshold_ = ParseIntegerOrDie(option);
+ } else if (StartsWith(option, "-large-method-max:")) {
+ parsed->large_method_threshold_ = ParseIntegerOrDie(option);
+ } else if (StartsWith(option, "-small-method-max:")) {
+ parsed->small_method_threshold_ = ParseIntegerOrDie(option);
+ } else if (StartsWith(option, "-tiny-method-max:")) {
+ parsed->tiny_method_threshold_ = ParseIntegerOrDie(option);
+ } else if (StartsWith(option, "-num-dex-methods-max:")) {
+ parsed->num_dex_methods_threshold_ = ParseIntegerOrDie(option);
} else {
if (!ignore_unrecognized) {
// TODO: print usage via vfprintf
@@ -809,9 +826,12 @@ bool Runtime::Init(const Options& raw_options, bool ignore_unrecognized) {
is_zygote_ = options->is_zygote_;
is_concurrent_gc_enabled_ = options->is_concurrent_gc_enabled_;
- small_mode_ = options->small_mode_;
- small_mode_method_threshold_ = options->small_mode_method_threshold_;
- small_mode_method_dex_size_limit_ = options->small_mode_method_dex_size_limit_;
+ compiler_filter_ = options->compiler_filter_;
+ huge_method_threshold_ = options->huge_method_threshold_;
+ large_method_threshold_ = options->large_method_threshold_;
+ small_method_threshold_ = options->small_method_threshold_;
+ tiny_method_threshold_ = options->tiny_method_threshold_;
+ num_dex_methods_threshold_ = options->num_dex_methods_threshold_;
sea_ir_mode_ = options->sea_ir_mode_;
vfprintf_ = options->hook_vfprintf_;