Optimizing: Tag basic block allocations with their source.
Replace GrowableArray with ArenaVector in HBasicBlock and,
to track the source of allocations, assign one new and two
Quick's arena allocation types to these vectors. Rename
kArenaAllocSuccessor to kArenaAllocSuccessors.
Bug: 23736311
Change-Id: Ib52e51698890675bde61f007fe6039338cf1a025
diff --git a/compiler/optimizing/dead_code_elimination.cc b/compiler/optimizing/dead_code_elimination.cc
index 50cbf5c..509478c 100644
--- a/compiler/optimizing/dead_code_elimination.cc
+++ b/compiler/optimizing/dead_code_elimination.cc
@@ -42,8 +42,8 @@
MarkReachableBlocks(if_instruction->IfFalseSuccessor(), visited);
}
} else {
- for (size_t i = 0, e = block->GetSuccessors().Size(); i < e; ++i) {
- MarkReachableBlocks(block->GetSuccessors().Get(i), visited);
+ for (HBasicBlock* successor : block->GetSuccessors()) {
+ MarkReachableBlocks(successor, visited);
}
}
}
@@ -99,12 +99,12 @@
// Connect successive blocks created by dead branches. Order does not matter.
for (HReversePostOrderIterator it(*graph_); !it.Done();) {
HBasicBlock* block = it.Current();
- if (block->IsEntryBlock() || block->GetSuccessors().Size() != 1u) {
+ if (block->IsEntryBlock() || block->GetSuccessors().size() != 1u) {
it.Advance();
continue;
}
- HBasicBlock* successor = block->GetSuccessors().Get(0);
- if (successor->IsExitBlock() || successor->GetPredecessors().Size() != 1u) {
+ HBasicBlock* successor = block->GetSuccessor(0);
+ if (successor->IsExitBlock() || successor->GetPredecessors().size() != 1u) {
it.Advance();
continue;
}