Compiler: continuing refactoring
Moving the arena memory allocation mechanism into it's own class as
a prelude to cleaning up the MIR and LIR data structures.
Reworked bit vector as a class using placement new w/ the arena
allocator.
Reworked GrowableList as a class template using the new arena
allocator and renamed to GrowableArray.
Change-Id: I639c4c08abe068094cae2649e04f58c8addd0015
diff --git a/src/compiler/dex/dataflow_iterator.h b/src/compiler/dex/dataflow_iterator.h
index f3a2fca..7d32dfc 100644
--- a/src/compiler/dex/dataflow_iterator.h
+++ b/src/compiler/dex/dataflow_iterator.h
@@ -75,8 +75,7 @@
const int start_idx_;
const int end_idx_;
const bool reverse_;
- GrowableList* block_id_list_;
- GrowableListIterator all_nodes_iterator_;
+ GrowableArray<int>* block_id_list_;
int idx_;
bool changed_;
@@ -142,10 +141,18 @@
AllNodesIterator(MIRGraph* mir_graph, bool is_iterative)
: DataflowIterator(mir_graph, is_iterative, 0, 0, false) {
- GrowableListIteratorInit(mir_graph->GetBlockList(), &all_nodes_iterator_);
+ all_nodes_iterator_ =
+ new (mir_graph->GetArena()) GrowableArray<BasicBlock*>::Iterator (mir_graph->GetBlockList());
+ }
+
+ virtual void Reset() {
+ all_nodes_iterator_->Reset();
}
virtual BasicBlock* NextBody(bool had_change);
+
+ private:
+ GrowableArray<BasicBlock*>::Iterator* all_nodes_iterator_;
};
} // namespace art