Don't need to resolve method on slow path.
Also, add exception landding pad to fix test 088.
Change-Id: I095ddb9aea59733f805d01e9d5f5a654de4fdb13
diff --git a/src/compiler_llvm/method_compiler.cc b/src/compiler_llvm/method_compiler.cc
index 49717fc..52a4456 100644
--- a/src/compiler_llvm/method_compiler.cc
+++ b/src/compiler_llvm/method_compiler.cc
@@ -2826,23 +2826,23 @@
}
// Load the method object
- llvm::Value* callee_method_object_addr_ = NULL;
+ llvm::Value* callee_method_object_addr = NULL;
if (!is_fast_path) {
- callee_method_object_addr_ =
+ callee_method_object_addr =
EmitCallRuntimeForCalleeMethodObjectAddr(callee_method_idx, invoke_type,
this_addr, dex_pc, is_fast_path);
} else {
switch (invoke_type) {
case kStatic:
case kDirect:
- callee_method_object_addr_ =
+ callee_method_object_addr =
EmitLoadSDCalleeMethodObjectAddr(callee_method_idx);
break;
case kVirtual:
DCHECK(vtable_idx != -1);
- callee_method_object_addr_ =
+ callee_method_object_addr =
EmitLoadVirtualCalleeMethodObjectAddr(vtable_idx, this_addr);
break;
@@ -2852,29 +2852,29 @@
break;
case kInterface:
- callee_method_object_addr_ =
+ callee_method_object_addr =
EmitCallRuntimeForCalleeMethodObjectAddr(callee_method_idx,
invoke_type, this_addr,
dex_pc, is_fast_path);
break;
}
+
+ // Ensure the callee method object is resolved.
+ bool is_virtual = (dec_insn.opcode == Instruction::INVOKE_VIRTUAL) ||
+ (dec_insn.opcode == Instruction::INVOKE_VIRTUAL_RANGE) ||
+ (dec_insn.opcode == Instruction::INVOKE_SUPER) ||
+ (dec_insn.opcode == Instruction::INVOKE_SUPER_RANGE);
+
+ llvm::Value* caller_method_object_addr = EmitLoadMethodObjectAddr();
+
+ callee_method_object_addr = EmitEnsureResolved(callee_method_object_addr,
+ caller_method_object_addr,
+ callee_method_idx,
+ is_virtual);
+
+ EmitGuard_ExceptionLandingPad(dex_pc);
}
- // Ensure the callee method object is resolved, linked, and its declaring
- // class is initialized.
- bool is_virtual = (dec_insn.opcode == Instruction::INVOKE_VIRTUAL) ||
- (dec_insn.opcode == Instruction::INVOKE_VIRTUAL_RANGE) ||
- (dec_insn.opcode == Instruction::INVOKE_SUPER) ||
- (dec_insn.opcode == Instruction::INVOKE_SUPER_RANGE);
-
- llvm::Value* caller_method_object_addr = EmitLoadMethodObjectAddr();
-
- llvm::Value* callee_method_object_addr =
- EmitEnsureResolved(callee_method_object_addr_,
- caller_method_object_addr,
- callee_method_idx,
- is_virtual);
-
#if 0
llvm::Value* code_field_offset_value =
irb_.getPtrEquivInt(Method::GetCodeOffset().Int32Value());