summaryrefslogtreecommitdiff
path: root/compiler/optimizing/instruction_builder.cc
diff options
context:
space:
mode:
authorVladimir Marko <vmarko@google.com>2020-05-19 14:42:02 +0100
committerVladimir Marko <vmarko@google.com>2020-05-20 08:41:09 +0000
commit695348f4b0541f4373b46eac5830cdd87f71c076 (patch)
treef2f6019f0c394f99aaaf9f2f7deec16bf6116b0f /compiler/optimizing/instruction_builder.cc
parent1f5300a211202442a07607830c6550773ca50b50 (diff)
Add compiler type to CompilerOptions.
Let CompilerOptions hold the information whether it is AOT or JIT compilation, or Zygote JIT for shared code. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing --jit Test: aosp_taimen-userdebug boots. Change-Id: Id9200572406f8e43d99b8b61ef0e3edf43b52fff
Diffstat (limited to 'compiler/optimizing/instruction_builder.cc')
-rw-r--r--compiler/optimizing/instruction_builder.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/optimizing/instruction_builder.cc b/compiler/optimizing/instruction_builder.cc
index 69f67780f1..df236c17c1 100644
--- a/compiler/optimizing/instruction_builder.cc
+++ b/compiler/optimizing/instruction_builder.cc
@@ -1352,18 +1352,18 @@ bool HInstructionBuilder::IsInitialized(ObjPtr<mirror::Class> cls) const {
// Check if the class will be initialized at runtime.
if (cls->IsInitialized()) {
- Runtime* runtime = Runtime::Current();
- if (runtime->IsAotCompiler()) {
+ const CompilerOptions& compiler_options = code_generator_->GetCompilerOptions();
+ if (compiler_options.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, code_generator_->GetCompilerOptions())) {
+ if (IsInBootImage(cls, compiler_options)) {
return true;
}
} else {
- DCHECK(runtime->UseJitCompilation());
+ DCHECK(compiler_options.IsJitCompiler());
if (Runtime::Current()->GetJit()->CanAssumeInitialized(
cls,
- graph_->IsCompilingForSharedJitCode())) {
+ compiler_options.IsJitCompilerForSharedCode())) {
// For JIT, the class cannot revert to an uninitialized state.
return true;
}