From 17826bfcdfbb27ebc13f01ffc5859b390f78e4e0 Mon Sep 17 00:00:00 2001 From: TDYa127 Date: Tue, 24 Apr 2012 01:15:10 -0700 Subject: Just use getPtrEquiveInt to load method. Change-Id: I8cbf155a0bfc4ea0f0d61dbf981e0ace43ef2c2b --- src/compiler_llvm/method_compiler.cc | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) (limited to 'src/compiler_llvm/method_compiler.cc') diff --git a/src/compiler_llvm/method_compiler.cc b/src/compiler_llvm/method_compiler.cc index 8d6b251ada..b6711b6913 100644 --- a/src/compiler_llvm/method_compiler.cc +++ b/src/compiler_llvm/method_compiler.cc @@ -36,12 +36,9 @@ #include #include -#include #include #include #include -#include -#include namespace art { namespace compiler_llvm { @@ -2840,8 +2837,8 @@ void MethodCompiler::EmitInsn_Invoke(uint32_t dex_pc, if (direct_method != 0u && direct_method != static_cast(-1)) { callee_method_object_addr = - EmitLoadSDCalleeDirectMethodObjectAddr(callee_method_idx, - direct_method); + irb_.CreateIntToPtr(irb_.getPtrEquivInt(direct_method), + irb_.getJObjectTy()); } else { callee_method_object_addr = EmitLoadSDCalleeMethodObjectAddr(callee_method_idx); @@ -2991,27 +2988,6 @@ void MethodCompiler::EmitInsn_Invoke(uint32_t dex_pc, } -llvm::Value* MethodCompiler:: -EmitLoadSDCalleeDirectMethodObjectAddr(uint32_t callee_method_idx, - uintptr_t direct_method) { - std::string direct_method_name( - StringPrintf("ArtMethodObject_%08lx", - static_cast(direct_method))); - - llvm::GlobalVariable* direct_method_addr = - module_->getGlobalVariable(direct_method_name); - - if (direct_method_addr == NULL) { - direct_method_addr = - new llvm::GlobalVariable(*module_, irb_.getJObjectTy()->getElementType(), - false, llvm::GlobalVariable::ExternalLinkage, - NULL, direct_method_name); - } - - return direct_method_addr; -} - - llvm::Value* MethodCompiler:: EmitLoadSDCalleeMethodObjectAddr(uint32_t callee_method_idx) { llvm::Value* callee_method_object_field_addr = -- cgit v1.2.3-59-g8ed1b