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>
diff --git a/compiler/dex/mir_graph.h b/compiler/dex/mir_graph.h
index ea2ca39..1914f69 100644
--- a/compiler/dex/mir_graph.h
+++ b/compiler/dex/mir_graph.h
@@ -613,9 +613,12 @@
return num_blocks_;
}
- size_t GetNumDalvikInsns() const {
- return cu_->code_item->insns_size_in_code_units_;
- }
+ /**
+ * @brief Provides the total size in code units of all instructions in MIRGraph.
+ * @details Includes the sizes of all methods in compilation unit.
+ * @return Returns the cumulative sum of all insn sizes (in code units).
+ */
+ size_t GetNumDalvikInsns() const;
ArenaBitVector* GetTryBlockAddr() const {
return try_block_addr_;
@@ -1222,7 +1225,6 @@
ArenaBitVector* live_in_v,
const MIR::DecodedInstruction& d_insn);
bool DoSSAConversion(BasicBlock* bb);
- bool InvokeUsesMethodStar(MIR* mir);
int ParseInsn(const uint16_t* code_ptr, MIR::DecodedInstruction* decoded_instruction);
bool ContentIsInsn(const uint16_t* code_ptr);
BasicBlock* SplitBlock(DexOffset code_offset, BasicBlock* orig_block,