Remove fix stub hack.
Change-Id: I6c870f40b3283826b0bd1149a08a4577d6e89e2d
diff --git a/src/class_linker.cc b/src/class_linker.cc
index 3c0c345..f78090b 100644
--- a/src/class_linker.cc
+++ b/src/class_linker.cc
@@ -2295,11 +2295,6 @@
ObjectArray<Method>* proxy_direct_methods = proxy_class->GetDirectMethods();
CHECK_EQ(proxy_direct_methods->GetLength(), 15);
Method* proxy_constructor = proxy_direct_methods->Get(2);
-#if defined(ART_USE_LLVM_COMPILER)
- // Ensure link.
- // TODO: Remove this after fixing the link problem by in-place linking.
- art_fix_stub_from_code(proxy_constructor);
-#endif
// Clone the existing constructor of Proxy (our constructor would just invoke it so steal its
// code_ too)
Method* constructor = down_cast<Method*>(proxy_constructor->Clone());
diff --git a/src/compiler_llvm/method_compiler.cc b/src/compiler_llvm/method_compiler.cc
index da8f91a..6c3bdb0 100644
--- a/src/compiler_llvm/method_compiler.cc
+++ b/src/compiler_llvm/method_compiler.cc
@@ -2726,17 +2726,6 @@
<< PrettyMethod(callee_method_idx, *dex_file_);
}
-llvm::Value* MethodCompiler::EmitFixStub(llvm::Value* callee_method_object_addr,
- uint32_t method_idx,
- bool is_static) {
- // TODO: Remove this after we solve the link and trampoline related problems.
- llvm::Value* code_addr = irb_.CreateCall(irb_.GetRuntime(FixStub), callee_method_object_addr);
-
- llvm::FunctionType* method_type = GetFunctionType(method_idx, is_static);
-
- return irb_.CreatePointerCast(code_addr, method_type->getPointerTo());
-}
-
void MethodCompiler::EmitInsn_Invoke(uint32_t dex_pc,
Instruction const* insn,
@@ -2851,7 +2840,6 @@
GetFunctionType(callee_method_idx, is_static)->getPointerTo(),
kTBAAJRuntime);
-#if 0
// Invoke callee
EmitUpdateDexPC(dex_pc);
llvm::Value* retval = irb_.CreateCall(code_addr, args);
@@ -2865,54 +2853,6 @@
if (ret_shorty != 'V') {
EmitStoreDalvikRetValReg(ret_shorty, kAccurate, retval);
}
-#else
- uint32_t callee_access_flags = is_static ? kAccStatic : 0;
- UniquePtr<OatCompilationUnit> callee_oat_compilation_unit(
- oat_compilation_unit_->GetCallee(callee_method_idx, callee_access_flags));
-
- char ret_shorty = callee_oat_compilation_unit->GetShorty()[0];
-
-
- EmitUpdateDexPC(dex_pc);
-
-
- llvm::BasicBlock* block_normal = CreateBasicBlockWithDexPC(dex_pc, "normal");
- llvm::BasicBlock* block_stub = CreateBasicBlockWithDexPC(dex_pc, "stub");
- llvm::BasicBlock* block_continue = CreateBasicBlockWithDexPC(dex_pc, "cont");
-
- irb_.CreateCondBr(irb_.CreateIsNull(code_addr), block_stub, block_normal, kUnlikely);
-
-
- irb_.SetInsertPoint(block_normal);
- {
- // Invoke callee
- llvm::Value* retval = irb_.CreateCall(code_addr, args);
- if (ret_shorty != 'V') {
- EmitStoreDalvikRetValReg(ret_shorty, kAccurate, retval);
- }
- }
- irb_.CreateBr(block_continue);
-
-
- irb_.SetInsertPoint(block_stub);
- { // lazy link
- // TODO: Remove this after we solve the link problem.
- code_addr = EmitFixStub(callee_method_object_addr, callee_method_idx, is_static);
-
- EmitGuard_ExceptionLandingPad(dex_pc, false);
-
- llvm::Value* retval = irb_.CreateCall(code_addr, args);
- if (ret_shorty != 'V') {
- EmitStoreDalvikRetValReg(ret_shorty, kAccurate, retval);
- }
- }
- irb_.CreateBr(block_continue);
-
-
- irb_.SetInsertPoint(block_continue);
-
- EmitGuard_ExceptionLandingPad(dex_pc, true);
-#endif
irb_.CreateBr(GetNextBasicBlock(dex_pc));
}
diff --git a/src/compiler_llvm/stub_compiler.cc b/src/compiler_llvm/stub_compiler.cc
index af05e52..7539532 100644
--- a/src/compiler_llvm/stub_compiler.cc
+++ b/src/compiler_llvm/stub_compiler.cc
@@ -141,8 +141,6 @@
}
// Invoke managed method now!
- // TODO: If we solve the trampoline related problems, we can just get the code address and call.
-#if 0
llvm::Value* code_field_offset_value =
irb_.getPtrEquivInt(Method::GetCodeOffset().Int32Value());
@@ -151,21 +149,6 @@
accurate_func_type->getPointerTo()->getPointerTo());
llvm::Value* code_addr = irb_.CreateLoad(code_field_addr, kTBAAJRuntime);
-#else
- llvm::Value* result = irb_.CreateCall(irb_.GetRuntime(FixStub), method_object_addr);
- llvm::Value* code_addr = irb_.CreatePointerCast(result, accurate_func_type->getPointerTo());
-
- // Exception unwind.
- llvm::Value* exception_pending = irb_.Runtime().EmitIsExceptionPending();
- llvm::BasicBlock* block_unwind = llvm::BasicBlock::Create(*context_, "exception_unwind", func);
- llvm::BasicBlock* block_cont = llvm::BasicBlock::Create(*context_, "cont", func);
- irb_.CreateCondBr(exception_pending, block_unwind, block_cont);
- irb_.SetInsertPoint(block_unwind);
- // Restore thread register
- irb_.Runtime().EmitSetCurrentThread(old_thread_register);
- irb_.CreateRetVoid();
- irb_.SetInsertPoint(block_cont);
-#endif
llvm::Value* retval = irb_.CreateCall(code_addr, args);