summaryrefslogtreecommitdiffstats
path: root/runtime/runtime.cc
diff options
context:
space:
mode:
authorVladimir Marko <vmarko@google.com>2013-12-13 13:59:30 +0000
committerVladimir Marko <vmarko@google.com>2013-12-17 11:03:53 +0000
commit2b5eaa2b49f7489bafdadc4b4463ae27e4261817 (patch)
treeada8b60989919068d562e3fcee01aa5b7c5cfc61 /runtime/runtime.cc
parent0bf1f266869776c2dd21b3242599d74ac80855f0 (diff)
downloadart-2b5eaa2b49f7489bafdadc4b4463ae27e4261817.zip
art-2b5eaa2b49f7489bafdadc4b4463ae27e4261817.tar.gz
art-2b5eaa2b49f7489bafdadc4b4463ae27e4261817.tar.bz2
Move compiler code out of method verifier.
We want to detect small methods for inlining at the end of the method verification. Instead of adding more compiler code to the runtime, we create a callback from the runtime into the compiler, so that we can keep the code there. Additionally, we move the compiler-related code that was already in the method verifier to the compiler since it doesn't really belong to the runtime in the first place. Change-Id: I708ca13227c809e07917ff3879a89722017e83a9
Diffstat (limited to 'runtime/runtime.cc')
-rw-r--r--runtime/runtime.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index ff7b8f5..25623a1 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -70,7 +70,7 @@ namespace art {
Runtime* Runtime::instance_ = NULL;
Runtime::Runtime()
- : is_compiler_(false),
+ : compiler_callbacks_(nullptr),
is_zygote_(false),
is_concurrent_gc_enabled_(true),
is_explicit_gc_disabled_(false),
@@ -367,7 +367,7 @@ Runtime::ParsedOptions* Runtime::ParsedOptions::Create(const Options& options, b
parsed->low_memory_mode_ = false;
parsed->use_tlab_ = false;
- parsed->is_compiler_ = false;
+ parsed->compiler_callbacks_ = nullptr;
parsed->is_zygote_ = false;
parsed->interpreter_only_ = false;
parsed->is_explicit_gc_disabled_ = false;
@@ -547,8 +547,9 @@ Runtime::ParsedOptions* Runtime::ParsedOptions::Create(const Options& options, b
parsed->properties_.push_back(option.substr(strlen("-D")));
} else if (StartsWith(option, "-Xjnitrace:")) {
parsed->jni_trace_ = option.substr(strlen("-Xjnitrace:"));
- } else if (option == "compiler") {
- parsed->is_compiler_ = true;
+ } else if (option == "compilercallbacks") {
+ parsed->compiler_callbacks_ =
+ reinterpret_cast<CompilerCallbacks*>(const_cast<void*>(options[i].second));
} else if (option == "-Xzygote") {
parsed->is_zygote_ = true;
} else if (option == "-Xint") {
@@ -672,7 +673,7 @@ Runtime::ParsedOptions* Runtime::ParsedOptions::Create(const Options& options, b
parsed->boot_class_path_string_.replace(core_jar_pos, core_jar.size(), "/core-libart.jar");
}
- if (!parsed->is_compiler_ && parsed->image_.empty()) {
+ if (parsed->compiler_callbacks_ == nullptr && parsed->image_.empty()) {
parsed->image_ += GetAndroidRoot();
parsed->image_ += "/framework/boot.art";
}
@@ -885,7 +886,7 @@ bool Runtime::Init(const Options& raw_options, bool ignore_unrecognized) {
class_path_string_ = options->class_path_string_;
properties_ = options->properties_;
- is_compiler_ = options->is_compiler_;
+ compiler_callbacks_ = options->compiler_callbacks_;
is_zygote_ = options->is_zygote_;
is_explicit_gc_disabled_ = options->is_explicit_gc_disabled_;