From 937105a220983351695bf4c8924171ba5d17a68c Mon Sep 17 00:00:00 2001 From: Logan Chien Date: Mon, 2 Apr 2012 02:37:37 +0800 Subject: Use ELF function index to distinguish generated functions. We replaced LLVMLongName and LLVMStubName with ElfFuncName, and we are using the simple name: Art0, Art1, ..., ArtN, as the function name of every generated functions. This gives us 3 benefits: 1. We can avoid the ambiguous function name returned by LLVMLongName() in some special situation. 2. We don't need to have the art::Method object during the executable linking procedure. Besides, this will make bootstrapping easier. 3. Reduce the size of the ELF executable, since we don't have to save a long function name, which usually contains more than 30 characters. Change-Id: Ib698062b272458e847ad5545d7acf33a4dc9eb85 --- src/compiler_llvm/compiler_llvm.cc | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src/compiler_llvm/compiler_llvm.cc') diff --git a/src/compiler_llvm/compiler_llvm.cc b/src/compiler_llvm/compiler_llvm.cc index 2b1890342a..f9af139d52 100644 --- a/src/compiler_llvm/compiler_llvm.cc +++ b/src/compiler_llvm/compiler_llvm.cc @@ -213,15 +213,16 @@ void CompilerLLVM::LoadElfFromCompilationUnit(const CompilationUnit* cunit) { } -const void* CompilerLLVM::GetMethodCodeAddr(const CompiledMethod* cm, - const Method* method) const { - return elf_loader_->GetMethodCodeAddr(cm->GetElfIndex(), method); +const void* CompilerLLVM::GetMethodCodeAddr(const CompiledMethod* cm) const { + return elf_loader_->GetMethodCodeAddr(cm->GetElfIndex(), + cm->GetElfFuncIndex()); } const Method::InvokeStub* CompilerLLVM:: -GetMethodInvokeStubAddr(const CompiledInvokeStub* cm, const Method* method) const { - return elf_loader_->GetMethodInvokeStubAddr(cm->GetElfIndex(), method); +GetMethodInvokeStubAddr(const CompiledInvokeStub* cm) const { + return elf_loader_->GetMethodInvokeStubAddr(cm->GetElfIndex(), + cm->GetElfFuncIndex()); } @@ -353,18 +354,18 @@ extern "C" void compilerLLVMEnableAutoElfLoading(art::Compiler& compiler) { extern "C" const void* compilerLLVMGetMethodCodeAddr(const art::Compiler& compiler, const art::CompiledMethod* cm, - const art::Method* method) { + const art::Method*) { const art::compiler_llvm::CompilerLLVM* compiler_llvm = reinterpret_cast(compiler.GetCompilerContext()); - return compiler_llvm->GetMethodCodeAddr(cm, method); + return compiler_llvm->GetMethodCodeAddr(cm); } extern "C" const art::Method::InvokeStub* compilerLLVMGetMethodInvokeStubAddr(const art::Compiler& compiler, const art::CompiledInvokeStub* cm, - const art::Method* method) { + const art::Method*) { const art::compiler_llvm::CompilerLLVM* compiler_llvm = reinterpret_cast(compiler.GetCompilerContext()); - return compiler_llvm->GetMethodInvokeStubAddr(cm, method); + return compiler_llvm->GetMethodInvokeStubAddr(cm); } extern "C" std::vector compilerLLVMGetElfImages(const art::Compiler& compiler) { -- cgit v1.2.3-59-g8ed1b