summaryrefslogtreecommitdiff
path: root/compiler/optimizing/instruction_builder.cc
diff options
context:
space:
mode:
authorNicolas Geoffray <ngeoffray@google.com>2019-06-26 05:54:52 -0700
committerandroid-build-merger <android-build-merger@google.com>2019-06-26 05:54:52 -0700
commit48ccd7907fa15886e3a357fa7940d1e58bb71b44 (patch)
tree6e7bc0d2a3d8faa94c303d7d753319f3850fadcd /compiler/optimizing/instruction_builder.cc
parent3d16a394d8693c6a84c419a6c314293a41a2a47d (diff)
parent20a1449297a61a60ade6efca88081187403e2e0f (diff)
Make the JIT zygote memory shared. am: 05f87217dd am: ce31240100
am: 20a1449297 Change-Id: Ida8e5cde02a8a8346d1b37dadd0149a4faa9e593
Diffstat (limited to 'compiler/optimizing/instruction_builder.cc')
-rw-r--r--compiler/optimizing/instruction_builder.cc22
1 files changed, 14 insertions, 8 deletions
diff --git a/compiler/optimizing/instruction_builder.cc b/compiler/optimizing/instruction_builder.cc
index 5e7b57523f2..f8f813e3fd5 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;
+ }
}
}