From 009d166842195711eca4d5768c59a8f7404e6875 Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Tue, 10 Oct 2017 13:21:15 +0100 Subject: Use ScopedArenaAllocator in BCE, DCE, LSE, ... ... ReferenceTypePropagation and GraphChecker. Define and use a new allocation kind for LoadStoreAnalysis. Memory needed to compile the two most expensive methods for aosp_angler-userdebug boot image: BatteryStats.dumpCheckinLocked() : 19.7MiB -> 19.6MiB (-79KiB) BatteryStats.dumpLocked(): 39.4MiB -> 39.3MiB (-120KiB) Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 64312607 Change-Id: Ib0cf074ac21ab67d8f8f2efabbdfb84cce9cae8e --- compiler/optimizing/graph_checker.h | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'compiler/optimizing/graph_checker.h') diff --git a/compiler/optimizing/graph_checker.h b/compiler/optimizing/graph_checker.h index 6af7b429f7..0f0b49d240 100644 --- a/compiler/optimizing/graph_checker.h +++ b/compiler/optimizing/graph_checker.h @@ -17,10 +17,13 @@ #ifndef ART_COMPILER_OPTIMIZING_GRAPH_CHECKER_H_ #define ART_COMPILER_OPTIMIZING_GRAPH_CHECKER_H_ -#include "nodes.h" - #include +#include "base/arena_bit_vector.h" +#include "base/bit_vector-inl.h" +#include "base/scoped_arena_allocator.h" +#include "nodes.h" + namespace art { // A control-flow graph visitor performing various checks. @@ -30,12 +33,10 @@ class GraphChecker : public HGraphDelegateVisitor { : HGraphDelegateVisitor(graph), errors_(graph->GetAllocator()->Adapter(kArenaAllocGraphChecker)), dump_prefix_(dump_prefix), - seen_ids_(graph->GetAllocator(), - graph->GetCurrentInstructionId(), - false, - kArenaAllocGraphChecker), - blocks_storage_(graph->GetAllocator()->Adapter(kArenaAllocGraphChecker)), - visited_storage_(graph->GetAllocator(), 0u, true, kArenaAllocGraphChecker) {} + allocator_(graph->GetArenaStack()), + seen_ids_(&allocator_, graph->GetCurrentInstructionId(), false, kArenaAllocGraphChecker) { + seen_ids_.ClearAllBits(); + } // Check the whole graph (in reverse post-order). void Run() { @@ -104,12 +105,9 @@ class GraphChecker : public HGraphDelegateVisitor { private: // String displayed before dumped errors. const char* const dump_prefix_; + ScopedArenaAllocator allocator_; ArenaBitVector seen_ids_; - // To reduce the total arena memory allocation, we reuse the same storage. - ArenaVector blocks_storage_; - ArenaBitVector visited_storage_; - DISALLOW_COPY_AND_ASSIGN(GraphChecker); }; -- cgit v1.2.3-59-g8ed1b