diff options
author | 2024-10-04 06:39:30 +0000 | |
---|---|---|
committer | 2024-10-04 14:04:37 +0000 | |
commit | 92a62ec92ef7ea0f047f5be569388608136b4803 (patch) | |
tree | b9ab473da3bff19055c9468b63513ca4e36e3175 /compiler/optimizing/nodes_test.cc | |
parent | c7f1c1039a7eb4abdfd3800c1b876d546c3059f8 (diff) |
Reduce memory used by `HEnvironment`.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Bug: 181943478
Change-Id: Ie05d4001e411a669e11b8edda375414e5da52ae2
Diffstat (limited to 'compiler/optimizing/nodes_test.cc')
-rw-r--r-- | compiler/optimizing/nodes_test.cc | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/compiler/optimizing/nodes_test.cc b/compiler/optimizing/nodes_test.cc index 1a1d9ac7da..0302298b9c 100644 --- a/compiler/optimizing/nodes_test.cc +++ b/compiler/optimizing/nodes_test.cc @@ -212,14 +212,22 @@ TEST_F(NodeTest, ParentEnvironment) { ASSERT_TRUE(parameter1->HasEnvironmentUses()); ASSERT_TRUE(parameter1->GetEnvUses().HasExactlyOneElement()); - HEnvironment* parent1 = new (GetAllocator()) HEnvironment( - GetAllocator(), 1, graph->GetArtMethod(), 0, nullptr); + HEnvironment* parent1 = HEnvironment::Create( + GetAllocator(), + /*number_of_vregs=*/ 1, + graph->GetArtMethod(), + /*dex_pc=*/ 0, + /*holder=*/ nullptr); parent1->CopyFrom(ArrayRef<HInstruction* const>(¶meter1, 1u)); ASSERT_EQ(parameter1->GetEnvUses().SizeSlow(), 2u); - HEnvironment* parent2 = new (GetAllocator()) HEnvironment( - GetAllocator(), 1, graph->GetArtMethod(), 0, nullptr); + HEnvironment* parent2 = HEnvironment::Create( + GetAllocator(), + /*number_of_vregs=*/ 1, + graph->GetArtMethod(), + /*dex_pc=*/ 0, + /*holder=*/ nullptr); parent2->CopyFrom(ArrayRef<HInstruction* const>(¶meter1, 1u)); parent1->SetAndCopyParentChain(GetAllocator(), parent2); |