diff options
Diffstat (limited to 'compiler/optimizing')
-rw-r--r-- | compiler/optimizing/codegen_test_utils.h | 1 | ||||
-rw-r--r-- | compiler/optimizing/inliner.cc | 9 | ||||
-rw-r--r-- | compiler/optimizing/inliner.h | 2 | ||||
-rw-r--r-- | compiler/optimizing/reference_type_propagation.cc | 2 | ||||
-rw-r--r-- | compiler/optimizing/reference_type_propagation.h | 2 |
5 files changed, 8 insertions, 8 deletions
diff --git a/compiler/optimizing/codegen_test_utils.h b/compiler/optimizing/codegen_test_utils.h index 1b38acd8b0..cada2e679b 100644 --- a/compiler/optimizing/codegen_test_utils.h +++ b/compiler/optimizing/codegen_test_utils.h @@ -28,6 +28,7 @@ #include "arch/x86/instruction_set_features_x86.h" #include "arch/x86/registers_x86.h" #include "arch/x86_64/instruction_set_features_x86_64.h" +#include "code_simulator.h" #include "code_simulator_container.h" #include "common_compiler_test.h" #include "graph_checker.h" diff --git a/compiler/optimizing/inliner.cc b/compiler/optimizing/inliner.cc index 38a1a8c024..0141c26352 100644 --- a/compiler/optimizing/inliner.cc +++ b/compiler/optimizing/inliner.cc @@ -1948,7 +1948,7 @@ static bool IsReferenceTypeRefinement(ReferenceTypeInfo declared_rti, declared_rti.IsStrictSupertypeOf(actual_rti); } -ReferenceTypeInfo HInliner::GetClassRTI(mirror::Class* klass) { +ReferenceTypeInfo HInliner::GetClassRTI(ObjPtr<mirror::Class> klass) { return ReferenceTypePropagation::IsAdmissible(klass) ? ReferenceTypeInfo::Create(handles_->NewHandle(klass)) : graph_->GetInexactObjectRti(); @@ -1976,9 +1976,8 @@ bool HInliner::ArgumentTypesMoreSpecific(HInvoke* invoke_instruction, ArtMethod* ++param_idx, ++input_idx) { HInstruction* input = invoke_instruction->InputAt(input_idx); if (input->GetType() == Primitive::kPrimNot) { - mirror::Class* param_cls = resolved_method->GetClassFromTypeIndex( - param_list->GetTypeItem(param_idx).type_idx_, - /* resolve */ false); + ObjPtr<mirror::Class> param_cls = resolved_method->LookupResolvedClassFromTypeIndex( + param_list->GetTypeItem(param_idx).type_idx_); if (IsReferenceTypeRefinement(GetClassRTI(param_cls), /* declared_can_be_null */ true, input)) { @@ -2027,7 +2026,7 @@ void HInliner::FixUpReturnReferenceType(ArtMethod* resolved_method, // TODO: we could be more precise by merging the phi inputs but that requires // some functionality from the reference type propagation. DCHECK(return_replacement->IsPhi()); - mirror::Class* cls = resolved_method->GetReturnType(false /* resolve */); + ObjPtr<mirror::Class> cls = resolved_method->LookupResolvedReturnType(); return_replacement->SetReferenceTypeInfo(GetClassRTI(cls)); } } diff --git a/compiler/optimizing/inliner.h b/compiler/optimizing/inliner.h index 62c6713208..c4b3a32d91 100644 --- a/compiler/optimizing/inliner.h +++ b/compiler/optimizing/inliner.h @@ -207,7 +207,7 @@ class HInliner : public HOptimization { // Creates an instance of ReferenceTypeInfo from `klass` if `klass` is // admissible (see ReferenceTypePropagation::IsAdmissible for details). // Otherwise returns inexact Object RTI. - ReferenceTypeInfo GetClassRTI(mirror::Class* klass) REQUIRES_SHARED(Locks::mutator_lock_); + ReferenceTypeInfo GetClassRTI(ObjPtr<mirror::Class> klass) REQUIRES_SHARED(Locks::mutator_lock_); bool ArgumentTypesMoreSpecific(HInvoke* invoke_instruction, ArtMethod* resolved_method) REQUIRES_SHARED(Locks::mutator_lock_); diff --git a/compiler/optimizing/reference_type_propagation.cc b/compiler/optimizing/reference_type_propagation.cc index f172e16ff9..561c9eafa2 100644 --- a/compiler/optimizing/reference_type_propagation.cc +++ b/compiler/optimizing/reference_type_propagation.cc @@ -848,7 +848,7 @@ void ReferenceTypePropagation::RTPVisitor::VisitInvoke(HInvoke* instr) { ScopedObjectAccess soa(Thread::Current()); ArtMethod* method = instr->GetResolvedMethod(); - mirror::Class* klass = (method == nullptr) ? nullptr : method->GetReturnType(/* resolve */ false); + ObjPtr<mirror::Class> klass = (method == nullptr) ? nullptr : method->LookupResolvedReturnType(); SetClassAsTypeInfo(instr, klass, /* is_exact */ false); } diff --git a/compiler/optimizing/reference_type_propagation.h b/compiler/optimizing/reference_type_propagation.h index 215e96786b..b19f473e27 100644 --- a/compiler/optimizing/reference_type_propagation.h +++ b/compiler/optimizing/reference_type_propagation.h @@ -46,7 +46,7 @@ class ReferenceTypePropagation : public HOptimization { // Returns true if klass is admissible to the propagation: non-null and resolved. // For an array type, we also check if the component type is admissible. - static bool IsAdmissible(mirror::Class* klass) REQUIRES_SHARED(Locks::mutator_lock_) { + static bool IsAdmissible(ObjPtr<mirror::Class> klass) REQUIRES_SHARED(Locks::mutator_lock_) { return klass != nullptr && klass->IsResolved() && (!klass->IsArrayClass() || IsAdmissible(klass->GetComponentType())); |