From 92a62ec92ef7ea0f047f5be569388608136b4803 Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Fri, 4 Oct 2024 06:39:30 +0000 Subject: Reduce memory used by `HEnvironment`. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 181943478 Change-Id: Ie05d4001e411a669e11b8edda375414e5da52ae2 --- compiler/optimizing/nodes_test.cc | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'compiler/optimizing/nodes_test.cc') 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(¶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(¶meter1, 1u)); parent1->SetAndCopyParentChain(GetAllocator(), parent2); -- cgit v1.2.3-59-g8ed1b