From ca6fff898afcb62491458ae8bcd428bfb3043da1 Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Tue, 3 Oct 2017 14:49:14 +0100 Subject: ART: Use ScopedArenaAllocator for pass-local data. Passes using local ArenaAllocator were hiding their memory usage from the allocation counting, making it difficult to track down where memory was used. Using ScopedArenaAllocator reveals the memory usage. This changes the HGraph constructor which requires a lot of changes in tests. Refactor these tests to limit the amount of work needed the next time we change that constructor. Test: m test-art-host-gtest Test: testrunner.py --host Test: Build with kArenaAllocatorCountAllocations = true. Bug: 64312607 Change-Id: I34939e4086b500d6e827ff3ef2211d1a421ac91a --- compiler/optimizing/liveness_test.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'compiler/optimizing/liveness_test.cc') diff --git a/compiler/optimizing/liveness_test.cc b/compiler/optimizing/liveness_test.cc index 37b58ded59..7793965148 100644 --- a/compiler/optimizing/liveness_test.cc +++ b/compiler/optimizing/liveness_test.cc @@ -29,7 +29,10 @@ namespace art { -class LivenessTest : public CommonCompilerTest {}; +class LivenessTest : public OptimizingUnitTest { + protected: + void TestCode(const uint16_t* data, const char* expected); +}; static void DumpBitVector(BitVector* vector, std::ostream& buffer, @@ -43,10 +46,8 @@ static void DumpBitVector(BitVector* vector, buffer << ")\n"; } -static void TestCode(const uint16_t* data, const char* expected) { - ArenaPool pool; - ArenaAllocator allocator(&pool); - HGraph* graph = CreateCFG(&allocator, data); +void LivenessTest::TestCode(const uint16_t* data, const char* expected) { + HGraph* graph = CreateCFG(data); // `Inline` conditions into ifs. PrepareForRegisterAllocation(graph).Run(); std::unique_ptr features_x86( -- cgit v1.2.3-59-g8ed1b