summaryrefslogtreecommitdiffstats
path: root/runtime/runtime.cc
diff options
context:
space:
mode:
authorBrian Carlstrom <bdc@google.com>2014-02-10 23:48:36 -0800
committerBrian Carlstrom <bdc@google.com>2014-02-24 14:24:12 -0800
commit6449c62e40ef3a9bb75f664f922555affb532ee4 (patch)
tree2f1b2120bd648c95dea32b68c8e168e42c8e24fd /runtime/runtime.cc
parent3fcf18e25241253f23efbeebe77b2a4c4a7c54d3 (diff)
downloadart-6449c62e40ef3a9bb75f664f922555affb532ee4.zip
art-6449c62e40ef3a9bb75f664f922555affb532ee4.tar.gz
art-6449c62e40ef3a9bb75f664f922555affb532ee4.tar.bz2
Create CompilerOptions
Package up most compiler related options in CompilerOptions. Details include: - Includes compiler filter, method thresholds, SEA IR mode. - Excludes those needed during Runtime::Init such as CompilerCallbacks and VerificationResults. - Pass CompilerOptions to CompilerDriver. - Remove CompilerOptions from Runtime. - Add ability to pass options for app and image dex2oat to runtime via -Xcompiler-option and -Ximage-compiler-option respectively. Other - Replace 2x CompilerCallbacks implementations with one. - Factor out execv code for use by both image and oat generation. - More OatFile error_msg reporting. - DCHECK for SuspendAll found trying to run valgrind. Change-Id: Iecb57da907be0c856d00c3cd634b5042a229e620
Diffstat (limited to 'runtime/runtime.cc')
-rw-r--r--runtime/runtime.cc61
1 files changed, 16 insertions, 45 deletions
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index 3ccea36..1ef15f7 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -77,13 +77,6 @@ Runtime::Runtime()
is_zygote_(false),
is_concurrent_gc_enabled_(true),
is_explicit_gc_disabled_(false),
- compiler_filter_(kSpeed),
- huge_method_threshold_(0),
- large_method_threshold_(0),
- small_method_threshold_(0),
- tiny_method_threshold_(0),
- num_dex_methods_threshold_(0),
- sea_ir_mode_(false),
default_stack_size_(0),
heap_(nullptr),
max_spins_before_thin_lock_inflation_(Monitor::kDefaultMaxSpinsBeforeThinLockInflation),
@@ -452,14 +445,6 @@ 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->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!
// gLogVerbosity.compiler = true; // TODO: don't check this in!
// gLogVerbosity.verifier = true; // TODO: don't check this in!
@@ -721,28 +706,22 @@ Runtime::ParsedOptions* Runtime::ParsedOptions::Create(const Options& options, b
} else if (StartsWith(option, "-Xprofile-backoff:")) {
parsed->profile_backoff_coefficient_ = ParseDoubleOrDie(
option, ':', 1.0, 10.0, ignore_unrecognized, parsed->profile_backoff_coefficient_);
- } else if (option == "-compiler-filter:interpret-only") {
- parsed->compiler_filter_ = kInterpretOnly;
- } 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 == "-compiler-filter:everything") {
- parsed->compiler_filter_ = kEverything;
- } else if (option == "-sea_ir") {
- parsed->sea_ir_mode_ = true;
- } 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 (option == "-Xcompiler-option") {
+ i++;
+ if (i == options.size()) {
+ // TODO: usage
+ LOG(FATAL) << "Missing required compiler option for " << option;
+ return NULL;
+ }
+ parsed->compiler_options_.push_back(options[i].first);
+ } else if (option == "-Ximage-compiler-option") {
+ i++;
+ if (i == options.size()) {
+ // TODO: usage
+ LOG(FATAL) << "Missing required compiler option for " << option;
+ return NULL;
+ }
+ parsed->image_compiler_options_.push_back(options[i].first);
} else {
if (!ignore_unrecognized) {
// TODO: print usage via vfprintf
@@ -988,14 +967,6 @@ bool Runtime::Init(const Options& raw_options, bool ignore_unrecognized) {
is_zygote_ = options->is_zygote_;
is_explicit_gc_disabled_ = options->is_explicit_gc_disabled_;
- 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_;
exit_ = options->hook_exit_;
abort_ = options->hook_abort_;