diff options
author | 2017-10-10 13:21:15 +0100 | |
---|---|---|
committer | 2017-10-12 10:43:29 +0100 | |
commit | 009d166842195711eca4d5768c59a8f7404e6875 (patch) | |
tree | 297cbed4084e905767bd979d54697693fd0c7262 /compiler/optimizing/graph_checker.h | |
parent | 52d52f5dc3e005829926e68c656fb27e8b008ae9 (diff) |
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
Diffstat (limited to 'compiler/optimizing/graph_checker.h')
-rw-r--r-- | compiler/optimizing/graph_checker.h | 22 |
1 files changed, 10 insertions, 12 deletions
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 <ostream> +#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<HBasicBlock*> blocks_storage_; - ArenaBitVector visited_storage_; - DISALLOW_COPY_AND_ASSIGN(GraphChecker); }; |