summaryrefslogtreecommitdiffstats
path: root/compiler/dex/quick/ralloc_util.cc
diff options
context:
space:
mode:
authorRazvan A Lupusoru <razvan.a.lupusoru@intel.com>2014-09-11 15:24:59 -0700
committerRazvan A Lupusoru <razvan.a.lupusoru@intel.com>2014-09-29 17:49:59 +0000
commit750359753444498d509a756fa9a042e9f3c432df (patch)
tree4261bdcbe1fcd6a1163eda372b6ef4796731017c /compiler/dex/quick/ralloc_util.cc
parentc70535b4f9f1ff3e3da451734bb7d9601012ccc1 (diff)
downloadart-750359753444498d509a756fa9a042e9f3c432df.tar.gz
art-750359753444498d509a756fa9a042e9f3c432df.tar.bz2
art-750359753444498d509a756fa9a042e9f3c432df.zip
ART: Deprecate CompilationUnit's code_item
The code_item field is tracked in both the CompilationUnit and the MIRGraph. However, the existence of this field in CompilationUnit promotes bad practice because it creates assumption only a single code_item can be part of method. This patch deprecates this field and updates MIRGraph methods to make it easy to get same information as before. Part of this is the update to interface GetNumDalvikInsn which ensures to count all code_items in MIRGraph. Some dead code was also removed because it was not friendly to these updates. Change-Id: Ie979be73cc56350321506cfea58f06d688a7fe99 Signed-off-by: Razvan A Lupusoru <razvan.a.lupusoru@intel.com>
Diffstat (limited to 'compiler/dex/quick/ralloc_util.cc')
-rw-r--r--compiler/dex/quick/ralloc_util.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/dex/quick/ralloc_util.cc b/compiler/dex/quick/ralloc_util.cc
index b171c78ed9..6305b22ded 100644
--- a/compiler/dex/quick/ralloc_util.cc
+++ b/compiler/dex/quick/ralloc_util.cc
@@ -1323,7 +1323,8 @@ void Mir2Lir::DoPromotion() {
/* Returns sp-relative offset in bytes for a VReg */
int Mir2Lir::VRegOffset(int v_reg) {
- return StackVisitor::GetVRegOffset(cu_->code_item, core_spill_mask_,
+ const DexFile::CodeItem* code_item = mir_graph_->GetCurrentDexCompilationUnit()->GetCodeItem();
+ return StackVisitor::GetVRegOffset(code_item, core_spill_mask_,
fp_spill_mask_, frame_size_, v_reg,
cu_->instruction_set);
}