summaryrefslogtreecommitdiffstats
path: root/runtime/runtime.cc
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2014-04-02 14:55:49 -0700
committerIan Rogers <irogers@google.com>2014-04-02 14:55:49 -0700
commit8afeb85d3def12b559b7565fb6d3956f81b55132 (patch)
tree60ac7c63d7adba0dc117ac88dd98cc97a879e0ca /runtime/runtime.cc
parent0807e7bbbafc4b4e8e7fb1d2d54fbcb011c05c82 (diff)
downloadart-8afeb85d3def12b559b7565fb6d3956f81b55132.zip
art-8afeb85d3def12b559b7565fb6d3956f81b55132.tar.gz
art-8afeb85d3def12b559b7565fb6d3956f81b55132.tar.bz2
Pass instruction-set from runtime through to spawned dex2oat.
Change-Id: I1727af7beb9f710c29124d4d6bc9175e4856f3cc
Diffstat (limited to 'runtime/runtime.cc')
-rw-r--r--runtime/runtime.cc55
1 files changed, 55 insertions, 0 deletions
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index a830018..b0a6584 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -79,6 +79,8 @@
namespace art {
static constexpr bool kEnableJavaStackTraceHandler = true;
+const char* Runtime::kDefaultInstructionSetFeatures =
+ STRINGIFY(ART_DEFAULT_INSTRUCTION_SET_FEATURES);
Runtime* Runtime::instance_ = NULL;
Runtime::Runtime()
@@ -1216,6 +1218,59 @@ void Runtime::SetFaultMessage(const std::string& message) {
fault_message_ = message;
}
+void Runtime::AddCurrentRuntimeFeaturesAsDex2OatArguments(std::vector<std::string>* argv)
+ const {
+ argv->push_back("--runtime-arg");
+ std::string checkstr = "-implicit-checks";
+
+ int nchecks = 0;
+ char checksep = ':';
+
+ if (!ExplicitNullChecks()) {
+ checkstr += checksep;
+ checksep = ',';
+ checkstr += "null";
+ ++nchecks;
+ }
+ if (!ExplicitSuspendChecks()) {
+ checkstr += checksep;
+ checksep = ',';
+ checkstr += "suspend";
+ ++nchecks;
+ }
+
+ if (!ExplicitStackOverflowChecks()) {
+ checkstr += checksep;
+ checksep = ',';
+ checkstr += "stack";
+ ++nchecks;
+ }
+
+ if (nchecks == 0) {
+ checkstr += ":none";
+ }
+ argv->push_back(checkstr);
+
+ // Make the dex2oat instruction set match that of the launching runtime. If we have multiple
+ // architecture support, dex2oat may be compiled as a different instruction-set than that
+ // currently being executed.
+#if defined(__arm__)
+ argv->push_back("--instruction-set=arm");
+#elif defined(__aarch64__)
+ argv->push_back("--instruction-set=arm64");
+#elif defined(__i386__)
+ argv->push_back("--instruction-set=x86");
+#elif defined(__x86_64__)
+ argv->push_back("--instruction-set=x86_64");
+#elif defined(__mips__)
+ argv->push_back("--instruction-set=mips");
+#endif
+
+ std::string features("--instruction-set-features=");
+ features += GetDefaultInstructionSetFeatures();
+ argv->push_back(features);
+}
+
void Runtime::UpdateProfilerState(int state) {
LOG(DEBUG) << "Profiler state updated to " << state;
}