diff options
author | Dan Pasanen <dan.pasanen@gmail.com> | 2017-04-05 07:23:10 -0500 |
---|---|---|
committer | Dan Pasanen <dan.pasanen@gmail.com> | 2017-04-05 07:23:10 -0500 |
commit | 3442967571bacf5fee6631ebb4eb268b8b610696 (patch) | |
tree | e03cabead71b9f06da22d595453cc058bd373182 /runtime/runtime.cc | |
parent | 773e16b98cb8ca2000eaeaf49f239f39ac51d562 (diff) | |
parent | f9e3754e8a2f6244e037362c03db32d4244ecb2d (diff) | |
download | art-3442967571bacf5fee6631ebb4eb268b8b610696.tar.gz art-3442967571bacf5fee6631ebb4eb268b8b610696.tar.bz2 art-3442967571bacf5fee6631ebb4eb268b8b610696.zip |
Merge tag 'android-7.1.2_r2' into cm-14.1staging/cm-14.1_android-7.1.2_r2
Android 7.1.2 Release 2 (N2G47E)
# gpg: Signature made Mon 03 Apr 2017 01:41:41 AM CDT
# gpg: using DSA key E8AD3F819AB10E78
# gpg: Can't check signature: No public key
Diffstat (limited to 'runtime/runtime.cc')
-rw-r--r-- | runtime/runtime.cc | 41 |
1 files changed, 23 insertions, 18 deletions
diff --git a/runtime/runtime.cc b/runtime/runtime.cc index f4c28b9a53..6d0d6ed7fc 100644 --- a/runtime/runtime.cc +++ b/runtime/runtime.cc @@ -583,24 +583,6 @@ bool Runtime::Start() { started_ = true; - // Create the JIT either if we have to use JIT compilation or save profiling info. - // TODO(calin): We use the JIT class as a proxy for JIT compilation and for - // recoding profiles. Maybe we should consider changing the name to be more clear it's - // not only about compiling. b/28295073. - if (jit_options_->UseJitCompilation() || jit_options_->GetSaveProfilingInfo()) { - std::string error_msg; - if (!IsZygote()) { - // If we are the zygote then we need to wait until after forking to create the code cache - // due to SELinux restrictions on r/w/x memory regions. - CreateJit(); - } else if (jit_options_->UseJitCompilation()) { - if (!jit::Jit::LoadCompilerLibrary(&error_msg)) { - // Try to load compiler pre zygote to reduce PSS. b/27744947 - LOG(WARNING) << "Failed to load JIT compiler with error " << error_msg; - } - } - } - if (!IsImageDex2OatEnabled() || !GetHeap()->HasBootImageSpace()) { ScopedObjectAccess soa(self); StackHandleScope<2> hs(soa.Self()); @@ -625,6 +607,27 @@ bool Runtime::Start() { Thread::FinishStartup(); + // Create the JIT either if we have to use JIT compilation or save profiling info. This is + // done after FinishStartup as the JIT pool needs Java thread peers, which require the main + // ThreadGroup to exist. + // + // TODO(calin): We use the JIT class as a proxy for JIT compilation and for + // recoding profiles. Maybe we should consider changing the name to be more clear it's + // not only about compiling. b/28295073. + if (jit_options_->UseJitCompilation() || jit_options_->GetSaveProfilingInfo()) { + std::string error_msg; + if (!IsZygote()) { + // If we are the zygote then we need to wait until after forking to create the code cache + // due to SELinux restrictions on r/w/x memory regions. + CreateJit(); + } else if (jit_options_->UseJitCompilation()) { + if (!jit::Jit::LoadCompilerLibrary(&error_msg)) { + // Try to load compiler pre zygote to reduce PSS. b/27744947 + LOG(WARNING) << "Failed to load JIT compiler with error " << error_msg; + } + } + } + system_class_loader_ = CreateSystemClassLoader(this); if (is_zygote_) { @@ -1146,6 +1149,8 @@ bool Runtime::Init(RuntimeArgumentMap&& runtime_options_in) { CHECK_EQ(self->GetThreadId(), ThreadList::kMainThreadId); CHECK(self != nullptr); + self->SetCanCallIntoJava(!IsAotCompiler()); + // Set us to runnable so tools using a runtime can allocate and GC by default self->TransitionFromSuspendedToRunnable(); |