From 69d310e0317e2fce97bf8c9c133c5c2c0332e61d Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Mon, 9 Oct 2017 14:12:23 +0100 Subject: Use ScopedArenaAllocator for building HGraph. Memory needed to compile the two most expensive methods for aosp_angler-userdebug boot image: BatteryStats.dumpCheckinLocked() : 21.1MiB -> 20.2MiB BatteryStats.dumpLocked(): 42.0MiB -> 40.3MiB This is because all the memory previously used by the graph builder is reused by later passes. And finish the "arena"->"allocator" renaming; make renamed allocator pointers that are members of classes const when appropriate (and make a few more members around them const). Test: m test-art-host-gtest Test: testrunner.py --host Bug: 64312607 Change-Id: Ia50aafc80c05941ae5b96984ba4f31ed4c78255e --- compiler/optimizing/nodes_test.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'compiler/optimizing/nodes_test.cc') diff --git a/compiler/optimizing/nodes_test.cc b/compiler/optimizing/nodes_test.cc index b2180d9f98..9bfd250ea4 100644 --- a/compiler/optimizing/nodes_test.cc +++ b/compiler/optimizing/nodes_test.cc @@ -129,10 +129,9 @@ TEST_F(NodeTest, ParentEnvironment) { HEnvironment* environment = new (GetAllocator()) HEnvironment( GetAllocator(), 1, graph->GetArtMethod(), 0, with_environment); - ArenaVector array(GetAllocator()->Adapter()); - array.push_back(parameter1); + HInstruction* const array[] = { parameter1 }; - environment->CopyFrom(array); + environment->CopyFrom(ArrayRef(array)); with_environment->SetRawEnvironment(environment); ASSERT_TRUE(parameter1->HasEnvironmentUses()); @@ -140,13 +139,13 @@ TEST_F(NodeTest, ParentEnvironment) { HEnvironment* parent1 = new (GetAllocator()) HEnvironment( GetAllocator(), 1, graph->GetArtMethod(), 0, nullptr); - parent1->CopyFrom(array); + parent1->CopyFrom(ArrayRef(array)); ASSERT_EQ(parameter1->GetEnvUses().SizeSlow(), 2u); HEnvironment* parent2 = new (GetAllocator()) HEnvironment( GetAllocator(), 1, graph->GetArtMethod(), 0, nullptr); - parent2->CopyFrom(array); + parent2->CopyFrom(ArrayRef(array)); parent1->SetAndCopyParentChain(GetAllocator(), parent2); // One use for parent2, and one other use for the new parent of parent1. -- cgit v1.2.3-59-g8ed1b