Move two members out of MIRGraph::temp_::ssa.
It turns out they are used outside the SSA transformation
by the x86 back-end.
This is a partial revert of
https://android-review.googlesource.com/120571
Change-Id: Ia5cb2988ab0625d8519901124bd4fc184d5f0886
diff --git a/compiler/dex/mir_dataflow.cc b/compiler/dex/mir_dataflow.cc
index ae29ae7..6704112 100644
--- a/compiler/dex/mir_dataflow.cc
+++ b/compiler/dex/mir_dataflow.cc
@@ -1052,7 +1052,7 @@
}
int MIRGraph::AddNewSReg(int v_reg) {
- int subscript = ++temp_.ssa.ssa_last_defs_[v_reg];
+ int subscript = ++ssa_last_defs_[v_reg];
uint32_t ssa_reg = GetNumSSARegs();
SetNumSSARegs(ssa_reg + 1);
ssa_base_vregs_.push_back(v_reg);
@@ -1070,14 +1070,14 @@
/* Find out the latest SSA register for a given Dalvik register */
void MIRGraph::HandleSSAUse(int* uses, int dalvik_reg, int reg_index) {
DCHECK((dalvik_reg >= 0) && (dalvik_reg < static_cast<int>(GetNumOfCodeAndTempVRs())));
- uses[reg_index] = temp_.ssa.vreg_to_ssa_map_[dalvik_reg];
+ uses[reg_index] = vreg_to_ssa_map_[dalvik_reg];
}
/* Setup a new SSA register for a given Dalvik register */
void MIRGraph::HandleSSADef(int* defs, int dalvik_reg, int reg_index) {
DCHECK((dalvik_reg >= 0) && (dalvik_reg < static_cast<int>(GetNumOfCodeAndTempVRs())));
int ssa_reg = AddNewSReg(dalvik_reg);
- temp_.ssa.vreg_to_ssa_map_[dalvik_reg] = ssa_reg;
+ vreg_to_ssa_map_[dalvik_reg] = ssa_reg;
defs[reg_index] = ssa_reg;
}
@@ -1319,7 +1319,7 @@
static_cast<int*>(arena_->Alloc(sizeof(int) * GetNumOfCodeAndTempVRs(),
kArenaAllocDFInfo));
- memcpy(bb->data_flow_info->vreg_to_ssa_map_exit, temp_.ssa.vreg_to_ssa_map_,
+ memcpy(bb->data_flow_info->vreg_to_ssa_map_exit, vreg_to_ssa_map_,
sizeof(int) * GetNumOfCodeAndTempVRs());
return true;
}
@@ -1369,15 +1369,17 @@
* Initialize the DalvikToSSAMap map. There is one entry for each
* Dalvik register, and the SSA names for those are the same.
*/
- temp_.ssa.vreg_to_ssa_map_ =
- reinterpret_cast<int*>(temp_scoped_alloc_->Alloc(sizeof(int) * num_reg, kArenaAllocDFInfo));
+ vreg_to_ssa_map_ =
+ static_cast<int*>(arena_->Alloc(sizeof(int) * num_reg,
+ kArenaAllocDFInfo));
/* Keep track of the higest def for each dalvik reg */
- temp_.ssa.ssa_last_defs_ =
- reinterpret_cast<int*>(temp_scoped_alloc_->Alloc(sizeof(int) * num_reg, kArenaAllocDFInfo));
+ ssa_last_defs_ =
+ static_cast<int*>(arena_->Alloc(sizeof(int) * num_reg,
+ kArenaAllocDFInfo));
for (unsigned int i = 0; i < num_reg; i++) {
- temp_.ssa.vreg_to_ssa_map_[i] = i;
- temp_.ssa.ssa_last_defs_[i] = 0;
+ vreg_to_ssa_map_[i] = i;
+ ssa_last_defs_[i] = 0;
}
// Create a compiler temporary for Method*. This is done after SSA initialization.