From bc3ae299266d177ef7e9d50c956cbc366454cf67 Mon Sep 17 00:00:00 2001 From: Santiago Aboy Solanes Date: Wed, 30 Oct 2024 12:02:05 +0000 Subject: cleanup FixUpInstructionType It was expecting to have an HSelect as an input, so we might as well encode that with the C++ types. Rename it to FixUpSelectType. Also move the instructions around so that the ScopedObjectAccess scope is smaller. As a drive-by, move ScopedObjectAccess to CheckAgainstUpperBound so that we only call it in a subset of cases. Test: art/test/testrunner/testrunner.py --host --64 -b --optimizing Change-Id: Id6f179e68e0a460577d5e42b8c431f3d035405a4 --- compiler/optimizing/nodes.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'compiler/optimizing/nodes.cc') diff --git a/compiler/optimizing/nodes.cc b/compiler/optimizing/nodes.cc index 9c41aef8b6..e7aabb223a 100644 --- a/compiler/optimizing/nodes.cc +++ b/compiler/optimizing/nodes.cc @@ -3131,9 +3131,9 @@ HBasicBlock* HGraph::TransformLoopForVectorization(HBasicBlock* header, return new_pre_header; } -static void CheckAgainstUpperBound(ReferenceTypeInfo rti, ReferenceTypeInfo upper_bound_rti) - REQUIRES_SHARED(Locks::mutator_lock_) { +static void CheckAgainstUpperBound(ReferenceTypeInfo rti, ReferenceTypeInfo upper_bound_rti) { if (rti.IsValid()) { + ScopedObjectAccess soa(Thread::Current()); DCHECK(upper_bound_rti.IsSupertypeOf(rti)) << " upper_bound_rti: " << upper_bound_rti << " rti: " << rti; @@ -3146,7 +3146,6 @@ static void CheckAgainstUpperBound(ReferenceTypeInfo rti, ReferenceTypeInfo uppe void HInstruction::SetReferenceTypeInfo(ReferenceTypeInfo rti) { if (kIsDebugBuild) { DCHECK_EQ(GetType(), DataType::Type::kReference); - ScopedObjectAccess soa(Thread::Current()); DCHECK(rti.IsValid()) << "Invalid RTI for " << DebugName(); if (IsBoundType()) { // Having the test here spares us from making the method virtual just for @@ -3174,7 +3173,6 @@ bool HBoundType::InstructionDataEquals(const HInstruction* other) const { void HBoundType::SetUpperBound(const ReferenceTypeInfo& upper_bound, bool can_be_null) { if (kIsDebugBuild) { - ScopedObjectAccess soa(Thread::Current()); DCHECK(upper_bound.IsValid()); DCHECK(!upper_bound_.IsValid()) << "Upper bound should only be set once."; CheckAgainstUpperBound(GetReferenceTypeInfo(), upper_bound); -- cgit v1.2.3-59-g8ed1b