diff options
author | Andreas Gampe <agampe@google.com> | 2014-12-19 09:53:27 -0800 |
---|---|---|
committer | Andreas Gampe <agampe@google.com> | 2014-12-19 23:13:40 -0800 |
commit | d2abbc9829ea0f657557c247a7c48c825dacfccd (patch) | |
tree | 210fd9c022f990eb87463781f67fb6bdd6a220c4 | |
parent | 6d1a047b4b3f9707d4ee1cc19e99717ee021ef48 (diff) | |
download | android_art-d2abbc9829ea0f657557c247a7c48c825dacfccd.tar.gz android_art-d2abbc9829ea0f657557c247a7c48c825dacfccd.tar.bz2 android_art-d2abbc9829ea0f657557c247a7c48c825dacfccd.zip |
ART: Use interpret-only for vmSafeMode
Set the compiler filter when the zygote tells us that the app is
in vmSafeMode. This ensures that secondary dex files will also be
compiled interpret-only.
Bug: 18812762
(cherry picked from commit 44893692bfb25ceb5c7c5b2e5c606948fbdea298)
Change-Id: Idb61870beebe2eeb5b11554f95ea6a725c77f16a
-rw-r--r-- | runtime/native/dalvik_system_ZygoteHooks.cc | 10 | ||||
-rw-r--r-- | runtime/runtime.h | 4 |
2 files changed, 12 insertions, 2 deletions
diff --git a/runtime/native/dalvik_system_ZygoteHooks.cc b/runtime/native/dalvik_system_ZygoteHooks.cc index f1a04cb35d..5f68d6000a 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 39fd910893..e31996338d 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_; } |