diff options
author | 2020-05-19 14:42:02 +0100 | |
---|---|---|
committer | 2020-05-20 08:41:09 +0000 | |
commit | 695348f4b0541f4373b46eac5830cdd87f71c076 (patch) | |
tree | f2f6019f0c394f99aaaf9f2f7deec16bf6116b0f /compiler/optimizing/intrinsics.cc | |
parent | 1f5300a211202442a07607830c6550773ca50b50 (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/intrinsics.cc')
-rw-r--r-- | compiler/optimizing/intrinsics.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/compiler/optimizing/intrinsics.cc b/compiler/optimizing/intrinsics.cc index 1563a7e04b..653d92a020 100644 --- a/compiler/optimizing/intrinsics.cc +++ b/compiler/optimizing/intrinsics.cc @@ -215,12 +215,12 @@ void IntrinsicVisitor::ComputeIntegerValueOfLocations(HInvoke* invoke, if (cache == nullptr) { return; // No cache in the boot image. } - if (runtime->UseJitCompilation()) { + if (compiler_options.IsJitCompiler()) { if (!CheckIntegerCache(self, runtime->GetClassLinker(), boot_image_live_objects, cache)) { return; // The cache was somehow messed up, probably by using reflection. } } else { - DCHECK(runtime->IsAotCompiler()); + DCHECK(compiler_options.IsAotCompiler()); DCHECK(CheckIntegerCache(self, runtime->GetClassLinker(), boot_image_live_objects, cache)); if (invoke->InputAt(0)->IsIntConstant()) { int32_t value = invoke->InputAt(0)->AsIntConstant()->GetValue(); @@ -287,8 +287,7 @@ IntrinsicVisitor::IntegerValueOfInfo IntrinsicVisitor::ComputeIntegerValueOfInfo // we need to provide data that shall not lead to a crash even if the fields were // modified through reflection since ComputeIntegerValueOfLocations() when JITting. - Runtime* runtime = Runtime::Current(); - ClassLinker* class_linker = runtime->GetClassLinker(); + ClassLinker* class_linker = Runtime::Current()->GetClassLinker(); Thread* self = Thread::Current(); ScopedObjectAccess soa(self); @@ -328,7 +327,7 @@ IntrinsicVisitor::IntegerValueOfInfo IntrinsicVisitor::ComputeIntegerValueOfInfo ArtField* value_field = integer_class->FindDeclaredInstanceField(kValueFieldName, "I"); DCHECK(value_field != nullptr); info.value_offset = value_field->GetOffset().Uint32Value(); - if (runtime->UseJitCompilation()) { + if (compiler_options.IsJitCompiler()) { // Use the current `IntegerCache.low` for JIT to avoid truly surprising behavior if the // code messes up the `value` field in the lowest cached Integer using reflection. info.low = GetIntegerCacheLowFromIntegerCache(self, class_linker); |