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
diff --git a/compiler/optimizing/inliner.cc b/compiler/optimizing/inliner.cc
index efd4fcf..12fd1c3 100644
--- a/compiler/optimizing/inliner.cc
+++ b/compiler/optimizing/inliner.cc
@@ -48,16 +48,17 @@
// doing some logic in the runtime to discover if a method could have been inlined.
return;
}
- const GrowableArray<HBasicBlock*>& blocks = graph_->GetReversePostOrder();
- HBasicBlock* next_block = blocks.Get(0);
- for (size_t i = 0; i < blocks.Size(); ++i) {
+ const ArenaVector<HBasicBlock*>& blocks = graph_->GetReversePostOrder();
+ DCHECK(!blocks.empty());
+ HBasicBlock* next_block = blocks[0];
+ for (size_t i = 0; i < blocks.size(); ++i) {
// Because we are changing the graph when inlining, we need to remember the next block.
// This avoids doing the inlining work again on the inlined blocks.
- if (blocks.Get(i) != next_block) {
+ if (blocks[i] != next_block) {
continue;
}
HBasicBlock* block = next_block;
- next_block = (i == blocks.Size() - 1) ? nullptr : blocks.Get(i + 1);
+ next_block = (i == blocks.size() - 1) ? nullptr : blocks[i + 1];
for (HInstruction* instruction = block->GetFirstInstruction(); instruction != nullptr;) {
HInstruction* next = instruction->GetNext();
HInvoke* call = instruction->AsInvoke();