summaryrefslogtreecommitdiffstats
path: root/runtime/native/dalvik_system_ZygoteHooks.cc
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/native/dalvik_system_ZygoteHooks.cc')
-rw-r--r--runtime/native/dalvik_system_ZygoteHooks.cc20
1 files changed, 17 insertions, 3 deletions
diff --git a/runtime/native/dalvik_system_ZygoteHooks.cc b/runtime/native/dalvik_system_ZygoteHooks.cc
index c056adc82e..8395150fb6 100644
--- a/runtime/native/dalvik_system_ZygoteHooks.cc
+++ b/runtime/native/dalvik_system_ZygoteHooks.cc
@@ -59,10 +59,11 @@ static void EnableDebugFeatures(uint32_t debug_flags) {
DEBUG_ENABLE_ASSERT = 1 << 2,
DEBUG_ENABLE_SAFEMODE = 1 << 3,
DEBUG_ENABLE_JNI_LOGGING = 1 << 4,
+ DEBUG_ENABLE_JIT = 1 << 5,
};
+ Runtime* const runtime = Runtime::Current();
if ((debug_flags & DEBUG_ENABLE_CHECKJNI) != 0) {
- Runtime* runtime = Runtime::Current();
JavaVMExt* vm = runtime->GetJavaVM();
if (!vm->IsCheckJniEnabled()) {
LOG(INFO) << "Late-enabling -Xcheck:jni";
@@ -86,13 +87,26 @@ static void EnableDebugFeatures(uint32_t debug_flags) {
}
debug_flags &= ~DEBUG_ENABLE_DEBUGGER;
- if ((debug_flags & DEBUG_ENABLE_SAFEMODE) != 0) {
+ const bool safe_mode = (debug_flags & DEBUG_ENABLE_SAFEMODE) != 0;
+ if (safe_mode) {
// Ensure that any (secondary) oat files will be interpreted.
- Runtime* runtime = Runtime::Current();
runtime->AddCompilerOption("--compiler-filter=interpret-only");
debug_flags &= ~DEBUG_ENABLE_SAFEMODE;
}
+ if ((debug_flags & DEBUG_ENABLE_JIT) != 0) {
+ if (safe_mode) {
+ LOG(INFO) << "Not enabling JIT due to VM safe mode";
+ } else {
+ if (runtime->GetJit() == nullptr) {
+ runtime->CreateJit();
+ } else {
+ LOG(INFO) << "Not late-enabling JIT (already on)";
+ }
+ }
+ debug_flags &= ~DEBUG_ENABLE_JIT;
+ }
+
// This is for backwards compatibility with Dalvik.
debug_flags &= ~DEBUG_ENABLE_ASSERT;