diff options
author | 2015-09-15 10:15:55 +0100 | |
---|---|---|
committer | 2015-09-16 13:21:33 +0100 | |
commit | fa6b93c4b69e6d7ddfa2a4ed0aff01b0608c5a3a (patch) | |
tree | 3528c88e104dac8e58ae5370ab066b8b1dd0218f /compiler/optimizing/ssa_liveness_analysis.cc | |
parent | e295be4a95d7861f6ec179edf6565f58cad747cc (diff) |
Optimizing: Tag arena allocations in HGraph.
Replace GrowableArray with ArenaVector in HGraph and related
classes HEnvironment, HLoopInformation, HInvoke and HPhi,
and tag allocations with new arena allocation types.
Change-Id: I3d79897af405b9a1a5b98bfc372e70fe0b3bc40d
Diffstat (limited to 'compiler/optimizing/ssa_liveness_analysis.cc')
-rw-r--r-- | compiler/optimizing/ssa_liveness_analysis.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/optimizing/ssa_liveness_analysis.cc b/compiler/optimizing/ssa_liveness_analysis.cc index 63635f3127..1e9a813be9 100644 --- a/compiler/optimizing/ssa_liveness_analysis.cc +++ b/compiler/optimizing/ssa_liveness_analysis.cc @@ -69,8 +69,8 @@ void SsaLivenessAnalysis::LinearizeGraph() { // current reverse post order in the graph, but it would require making // order queries to a GrowableArray, which is not the best data structure // for it. - GrowableArray<uint32_t> forward_predecessors(graph_->GetArena(), graph_->GetBlocks().Size()); - forward_predecessors.SetSize(graph_->GetBlocks().Size()); + GrowableArray<uint32_t> forward_predecessors(graph_->GetArena(), graph_->GetBlocks().size()); + forward_predecessors.SetSize(graph_->GetBlocks().size()); for (HReversePostOrderIterator it(*graph_); !it.Done(); it.Advance()) { HBasicBlock* block = it.Current(); size_t number_of_forward_predecessors = block->GetPredecessors().size(); @@ -84,11 +84,12 @@ void SsaLivenessAnalysis::LinearizeGraph() { // iterate over the successors. When all non-back edge predecessors of a // successor block are visited, the successor block is added in the worklist // following an order that satisfies the requirements to build our linear graph. + graph_->linear_order_.reserve(graph_->GetReversePostOrder().size()); GrowableArray<HBasicBlock*> worklist(graph_->GetArena(), 1); worklist.Add(graph_->GetEntryBlock()); do { HBasicBlock* current = worklist.Pop(); - graph_->linear_order_.Add(current); + graph_->linear_order_.push_back(current); for (HBasicBlock* successor : current->GetSuccessors()) { int block_id = successor->GetBlockId(); size_t number_of_remaining_predecessors = forward_predecessors.Get(block_id); |