From e82d04b37415974cfd85be881f50656610890daf Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Mon, 17 Feb 2025 08:55:37 +0000 Subject: Optimizing: Speed up `HInstruction::Add{,Env}UseAt()`. Avoid three dependent loads to fetch the allocator on the hot paths. Inline the `FixupUserRecordsAfter*UseInsertion()` loop and use the fact that it's known to execute exactly one or two iterations. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 181943478 Change-Id: I7fd4d48caebc6aeb13fb9a9f8146a06129c72b2e --- compiler/optimizing/nodes_test.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'compiler/optimizing/nodes_test.cc') diff --git a/compiler/optimizing/nodes_test.cc b/compiler/optimizing/nodes_test.cc index 5f71d053c6..97f74cb7b9 100644 --- a/compiler/optimizing/nodes_test.cc +++ b/compiler/optimizing/nodes_test.cc @@ -248,7 +248,7 @@ TEST_F(NodeTest, ParentEnvironment) { graph->GetArtMethod(), /*dex_pc=*/ 0, /*holder=*/ nullptr); - parent1->CopyFrom(ArrayRef(¶meter1, 1u)); + parent1->CopyFrom(GetAllocator(), ArrayRef(¶meter1, 1u)); ASSERT_EQ(parameter1->GetEnvUses().SizeSlow(), 2u); @@ -258,7 +258,7 @@ TEST_F(NodeTest, ParentEnvironment) { graph->GetArtMethod(), /*dex_pc=*/ 0, /*holder=*/ nullptr); - parent2->CopyFrom(ArrayRef(¶meter1, 1u)); + parent2->CopyFrom(GetAllocator(), ArrayRef(¶meter1, 1u)); parent1->SetAndCopyParentChain(GetAllocator(), parent2); // One use for parent2, and one other use for the new parent of parent1. -- cgit v1.2.3-59-g8ed1b