summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2014-12-20 07:25:59 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-12-20 07:26:00 +0000
commit094368ae2fa7a4eeaafb44f6018e498c1054af60 (patch)
tree660d6f3881fd0df7754547ba213839c98a73fbfa /runtime
parent48e7f3374eb6f042c12cd540ce73c7cddc366bb4 (diff)
parentd2abbc9829ea0f657557c247a7c48c825dacfccd (diff)
downloadart-094368ae2fa7a4eeaafb44f6018e498c1054af60.zip
art-094368ae2fa7a4eeaafb44f6018e498c1054af60.tar.gz
art-094368ae2fa7a4eeaafb44f6018e498c1054af60.tar.bz2
Merge "ART: Use interpret-only for vmSafeMode"
Diffstat (limited to 'runtime')
-rw-r--r--runtime/native/dalvik_system_ZygoteHooks.cc10
-rw-r--r--runtime/runtime.h4
2 files changed, 12 insertions, 2 deletions
diff --git a/runtime/native/dalvik_system_ZygoteHooks.cc b/runtime/native/dalvik_system_ZygoteHooks.cc
index f1a04cb..5f68d60 100644
--- a/runtime/native/dalvik_system_ZygoteHooks.cc
+++ b/runtime/native/dalvik_system_ZygoteHooks.cc
@@ -86,9 +86,15 @@ static void EnableDebugFeatures(uint32_t debug_flags) {
}
debug_flags &= ~DEBUG_ENABLE_DEBUGGER;
- // These two are for backwards compatibility with Dalvik.
+ if ((debug_flags & DEBUG_ENABLE_SAFEMODE) != 0) {
+ // Ensure that any (secondary) oat files will be interpreted.
+ Runtime* runtime = Runtime::Current();
+ runtime->AddCompilerOption("--compiler-filter=interpret-only");
+ debug_flags &= ~DEBUG_ENABLE_SAFEMODE;
+ }
+
+ // This is for backwards compatibility with Dalvik.
debug_flags &= ~DEBUG_ENABLE_ASSERT;
- debug_flags &= ~DEBUG_ENABLE_SAFEMODE;
if (debug_flags != 0) {
LOG(ERROR) << StringPrintf("Unknown bits set in debug_flags: %#x", debug_flags);
diff --git a/runtime/runtime.h b/runtime/runtime.h
index 39fd910..e319963 100644
--- a/runtime/runtime.h
+++ b/runtime/runtime.h
@@ -133,6 +133,10 @@ class Runtime {
return compiler_options_;
}
+ void AddCompilerOption(std::string option) {
+ compiler_options_.push_back(option);
+ }
+
const std::vector<std::string>& GetImageCompilerOptions() const {
return image_compiler_options_;
}