diff options
author | Nicolas Geoffray <ngeoffray@google.com> | 2019-06-19 10:00:00 +0100 |
---|---|---|
committer | Nicolas Geoffray <ngeoffray@google.com> | 2019-06-26 12:24:15 +0000 |
commit | 05f87217ddc9b4b9186710c0135b918f456c5aef (patch) | |
tree | 6e7bc0d2a3d8faa94c303d7d753319f3850fadcd /compiler/optimizing/instruction_builder.cc | |
parent | 8d335b61d637fa9b040eb9d559dbac98067467f1 (diff) |
Make the JIT zygote memory shared.
Test: boots
Bug: 119800099
Change-Id: I75ff8a58eea4de5cb833139641b4e15b8394d9b1
Diffstat (limited to 'compiler/optimizing/instruction_builder.cc')
-rw-r--r-- | compiler/optimizing/instruction_builder.cc | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/compiler/optimizing/instruction_builder.cc b/compiler/optimizing/instruction_builder.cc index 5e7b57523f..f8f813e3fd 100644 --- a/compiler/optimizing/instruction_builder.cc +++ b/compiler/optimizing/instruction_builder.cc @@ -29,6 +29,7 @@ #include "driver/dex_compilation_unit.h" #include "driver/compiler_options.h" #include "imtable-inl.h" +#include "jit/jit.h" #include "mirror/dex_cache.h" #include "oat_file.h" #include "optimizing_compiler_stats.h" @@ -1290,15 +1291,20 @@ bool HInstructionBuilder::IsInitialized(Handle<mirror::Class> cls) const { // Check if the class will be initialized at runtime. if (cls->IsInitialized()) { Runtime* runtime = Runtime::Current(); - if (!runtime->IsAotCompiler()) { + if (runtime->IsAotCompiler()) { + // Assume loaded only if klass is in the boot image. App classes cannot be assumed + // loaded because we don't even know what class loader will be used to load them. + if (IsInBootImage(cls.Get(), code_generator_->GetCompilerOptions())) { + return true; + } + } else { DCHECK(runtime->UseJitCompilation()); - // For JIT, the class cannot revert to an uninitialized state. - return true; - } - // Assume loaded only if klass is in the boot image. App classes cannot be assumed - // loaded because we don't even know what class loader will be used to load them. - if (IsInBootImage(cls.Get(), code_generator_->GetCompilerOptions())) { - return true; + if (Runtime::Current()->GetJit()->CanAssumeInitialized( + cls.Get(), + graph_->IsCompilingForSharedJitCode())) { + // For JIT, the class cannot revert to an uninitialized state. + return true; + } } } |