summaryrefslogtreecommitdiff
path: root/compiler/optimizing/graph_checker.h
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2016-03-25 15:31:35 +0000
committer Vladimir Marko <vmarko@google.com> 2016-03-25 16:29:46 +0000
commit947eb700bec9e214a72d4747864398dc238da60c (patch)
treef447fb4ce6d19ed014d1096990dc28e011f32ef2 /compiler/optimizing/graph_checker.h
parent5d87b29339c5301bea0bf2c3f47e520e3d7b0d16 (diff)
Optimizing: Reduce arena memory used by GraphChecker.
Use member variables to reuse the storage instead of repeatedly allocating new storage for local variables. Bug: 27690481 Change-Id: I614db9b8614d585653cfbff62e9cf7d7f0c58810
Diffstat (limited to 'compiler/optimizing/graph_checker.h')
-rw-r--r--compiler/optimizing/graph_checker.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler/optimizing/graph_checker.h b/compiler/optimizing/graph_checker.h
index 27d5621887..a536b30fcd 100644
--- a/compiler/optimizing/graph_checker.h
+++ b/compiler/optimizing/graph_checker.h
@@ -33,7 +33,9 @@ class GraphChecker : public HGraphDelegateVisitor {
seen_ids_(graph->GetArena(),
graph->GetCurrentInstructionId(),
false,
- kArenaAllocGraphChecker) {}
+ kArenaAllocGraphChecker),
+ blocks_storage_(graph->GetArena()->Adapter(kArenaAllocGraphChecker)),
+ visited_storage_(graph->GetArena(), 0u, true, kArenaAllocGraphChecker) {}
// Check the whole graph (in reverse post-order).
void Run() {
@@ -102,6 +104,10 @@ class GraphChecker : public HGraphDelegateVisitor {
const char* const dump_prefix_;
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);
};