diff options
author | 2017-10-12 11:19:47 +0000 | |
---|---|---|
committer | 2017-10-12 11:19:47 +0000 | |
commit | 387c28110e562a11cc27448472f2031251a9ded4 (patch) | |
tree | 9dc69f88cf59703d24537fe8d23ef89373c76bfd /compiler/optimizing/graph_checker.h | |
parent | 0284f43d625f0776ee0586a7cc321e11f5405e8c (diff) | |
parent | 009d166842195711eca4d5768c59a8f7404e6875 (diff) |
Merge "Use ScopedArenaAllocator in BCE, DCE, LSE, ..."
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); }; |