Enable JIT in zygote.
bug: 119800099
Test: boot test
Change-Id: I92dc59adeaf1202a984d363b1420ef26e53ebe84
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index 84526f3..58e8b48 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -601,9 +601,18 @@
}
void Runtime::PreZygoteFork() {
+ if (GetJit() != nullptr) {
+ GetJit()->PreZygoteFork();
+ }
heap_->PreZygoteFork();
}
+void Runtime::PostZygoteFork() {
+ if (GetJit() != nullptr) {
+ GetJit()->PostZygoteFork();
+ }
+}
+
void Runtime::CallExitHook(jint status) {
if (exit_ != nullptr) {
ScopedThreadStateChange tsc(Thread::Current(), kNative);
@@ -917,10 +926,6 @@
}
}
- if (jit_ != nullptr) {
- jit_->CreateThreadPool();
- }
-
if (thread_pool_ == nullptr) {
constexpr size_t kStackSize = 64 * KB;
constexpr size_t kMaxRuntimeWorkers = 4u;
@@ -2430,6 +2435,8 @@
LOG(WARNING) << "Failed to allocate JIT";
// Release JIT code cache resources (several MB of memory).
jit_code_cache_.reset();
+ } else {
+ jit->CreateThreadPool();
}
}