summaryrefslogtreecommitdiff
path: root/compiler/optimizing/nodes.cc
diff options
context:
space:
mode:
author Santiago Aboy Solanes <solanes@google.com> 2024-10-30 12:02:05 +0000
committer Santiago Aboy Solanes <solanes@google.com> 2024-10-30 14:53:00 +0000
commitbc3ae299266d177ef7e9d50c956cbc366454cf67 (patch)
tree9cfca5a5f79ad637b81a49049ff3e140bb087f6d /compiler/optimizing/nodes.cc
parentcbf82dafb9bfe0543a64a4a471765069516e9456 (diff)
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
Diffstat (limited to 'compiler/optimizing/nodes.cc')
-rw-r--r--compiler/optimizing/nodes.cc6
1 files changed, 2 insertions, 4 deletions
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);