summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compiler/dex/mir_dataflow.cc30
-rw-r--r--compiler/dex/mir_graph.h3
2 files changed, 19 insertions, 14 deletions
diff --git a/compiler/dex/mir_dataflow.cc b/compiler/dex/mir_dataflow.cc
index e71c80638a..246ae44d14 100644
--- a/compiler/dex/mir_dataflow.cc
+++ b/compiler/dex/mir_dataflow.cc
@@ -1272,6 +1272,22 @@ bool MIRGraph::DoSSAConversion(BasicBlock* bb) {
return true;
}
+void MIRGraph::InitializeBasicBlockDataFlow() {
+ /*
+ * Allocate the BasicBlockDataFlow structure for the entry and code blocks.
+ */
+ for (BasicBlock* bb : block_list_) {
+ if (bb->hidden == true) continue;
+ if (bb->block_type == kDalvikByteCode ||
+ bb->block_type == kEntryBlock ||
+ bb->block_type == kExitBlock) {
+ bb->data_flow_info =
+ static_cast<BasicBlockDataFlow*>(arena_->Alloc(sizeof(BasicBlockDataFlow),
+ kArenaAllocDFInfo));
+ }
+ }
+}
+
/* Setup the basic data structures for SSA conversion */
void MIRGraph::CompilerInitializeSSAConversion() {
size_t num_reg = GetNumOfCodeAndTempVRs();
@@ -1319,19 +1335,7 @@ void MIRGraph::CompilerInitializeSSAConversion() {
// The MIR graph keeps track of the sreg for method pointer specially, so record that now.
method_sreg_ = method_temp->s_reg_low;
- /*
- * Allocate the BasicBlockDataFlow structure for the entry and code blocks
- */
- for (BasicBlock* bb : block_list_) {
- if (bb->hidden == true) continue;
- if (bb->block_type == kDalvikByteCode ||
- bb->block_type == kEntryBlock ||
- bb->block_type == kExitBlock) {
- bb->data_flow_info =
- static_cast<BasicBlockDataFlow*>(arena_->Alloc(sizeof(BasicBlockDataFlow),
- kArenaAllocDFInfo));
- }
- }
+ InitializeBasicBlockDataFlow();
}
/*
diff --git a/compiler/dex/mir_graph.h b/compiler/dex/mir_graph.h
index f53ec892f6..f14b1876e8 100644
--- a/compiler/dex/mir_graph.h
+++ b/compiler/dex/mir_graph.h
@@ -525,7 +525,7 @@ const RegLocation bad_loc = {kLocDalvikFrame, 0, 0, 0, 0, 0, 0, 0, 0, RegStorage
class MIRGraph {
public:
MIRGraph(CompilationUnit* cu, ArenaAllocator* arena);
- ~MIRGraph();
+ virtual ~MIRGraph();
/*
* Examine the graph to determine whether it's worthwile to spend the time compiling
@@ -1147,6 +1147,7 @@ class MIRGraph {
void ComputeDefBlockMatrix();
void ComputeDominators();
void CompilerInitializeSSAConversion();
+ virtual void InitializeBasicBlockDataFlow();
void InsertPhiNodes();
void DoDFSPreOrderSSARename(BasicBlock* block);