Revert "Revert "Add JIT""
Added missing EntryPointToCodePointer.
This reverts commit a5ca888d715cd0c6c421313211caa1928be3e399.
Change-Id: Ia74df0ef3a7babbdcb0466fd24da28e304e3f5af
diff --git a/compiler/dex/mir_graph.cc b/compiler/dex/mir_graph.cc
index 76b5e44..f354a49 100644
--- a/compiler/dex/mir_graph.cc
+++ b/compiler/dex/mir_graph.cc
@@ -1673,12 +1673,6 @@
}
}
-const char* MIRGraph::GetShortyFromTargetIdx(int target_idx) {
- // TODO: for inlining support, use current code unit.
- const DexFile::MethodId& method_id = cu_->dex_file->GetMethodId(target_idx);
- return cu_->dex_file->GetShorty(method_id.proto_idx_);
-}
-
const char* MIRGraph::GetShortyFromMethodReference(const MethodReference& target_method) {
const DexFile::MethodId& method_id =
target_method.dex_file->GetMethodId(target_method.dex_method_index);
@@ -1724,8 +1718,7 @@
* high-word loc for wide arguments. Also pull up any following
* MOVE_RESULT and incorporate it into the invoke.
*/
-CallInfo* MIRGraph::NewMemCallInfo(BasicBlock* bb, MIR* mir, InvokeType type,
- bool is_range) {
+CallInfo* MIRGraph::NewMemCallInfo(BasicBlock* bb, MIR* mir, InvokeType type, bool is_range) {
CallInfo* info = static_cast<CallInfo*>(arena_->Alloc(sizeof(CallInfo),
kArenaAllocMisc));
MIR* move_result_mir = FindMoveResult(bb, mir);
@@ -1744,6 +1737,13 @@
info->opt_flags = mir->optimization_flags;
info->type = type;
info->is_range = is_range;
+ if (IsInstructionQuickInvoke(mir->dalvikInsn.opcode)) {
+ const auto& method_info = GetMethodLoweringInfo(mir);
+ info->method_ref = method_info.GetTargetMethod();
+ } else {
+ info->method_ref = MethodReference(GetCurrentDexCompilationUnit()->GetDexFile(),
+ mir->dalvikInsn.vB);
+ }
info->index = mir->dalvikInsn.vB;
info->offset = mir->offset;
info->mir = mir;