summaryrefslogtreecommitdiff
path: root/runtime/runtime.cc
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/runtime.cc')
-rw-r--r--runtime/runtime.cc24
1 files changed, 7 insertions, 17 deletions
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index f016e874ca..d69a2a9230 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -801,6 +801,8 @@ bool Runtime::Start() {
if (!jit::Jit::LoadCompilerLibrary(&error_msg)) {
LOG(WARNING) << "Failed to load JIT compiler with error " << error_msg;
}
+ CreateJitCodeCache(/*rwx_memory_allowed=*/true);
+ CreateJit();
}
// Send the start phase event. We have to wait till here as this is when the main thread peer
@@ -904,15 +906,8 @@ void Runtime::InitNonZygoteOrPostFork(
}
}
- if (jit_ == nullptr) {
- // The system server's code cache was initialized specially. For other zygote forks or
- // processes create it now.
- if (!is_system_server) {
- CreateJitCodeCache(/*rwx_memory_allowed=*/true);
- }
- // Note that when running ART standalone (not zygote, nor zygote fork),
- // the jit may have already been created.
- CreateJit();
+ if (jit_ != nullptr) {
+ jit_->CreateThreadPool();
}
// Create the thread pools.
@@ -2503,16 +2498,11 @@ void Runtime::CreateJitCodeCache(bool rwx_memory_allowed) {
return;
}
- // SystemServer has execmem blocked by SELinux so can not use RWX page permissions after the
- // cache initialized.
- jit_options_->SetRWXMemoryAllowed(rwx_memory_allowed);
-
std::string error_msg;
bool profiling_only = !jit_options_->UseJitCompilation();
- jit_code_cache_.reset(jit::JitCodeCache::Create(jit_options_->GetCodeCacheInitialCapacity(),
- jit_options_->GetCodeCacheMaxCapacity(),
- profiling_only,
- jit_options_->RWXMemoryAllowed(),
+ jit_code_cache_.reset(jit::JitCodeCache::Create(profiling_only,
+ rwx_memory_allowed,
+ IsZygote(),
&error_msg));
if (jit_code_cache_.get() == nullptr) {
LOG(WARNING) << "Failed to create JIT Code Cache: " << error_msg;