summaryrefslogtreecommitdiff
path: root/src/compiler_llvm/elf_loader.cc
diff options
context:
space:
mode:
author Logan Chien <loganchien@google.com> 2012-04-02 02:37:37 +0800
committer Shih-wei Liao <sliao@google.com> 2012-04-06 17:04:56 -0700
commit937105a220983351695bf4c8924171ba5d17a68c (patch)
tree4e259853c80e0d28e12ecf54c6e0ffa178797497 /src/compiler_llvm/elf_loader.cc
parent0c717dd1c56bd29cf860d0feda8e629dab2cadb3 (diff)
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
Diffstat (limited to 'src/compiler_llvm/elf_loader.cc')
-rw-r--r--src/compiler_llvm/elf_loader.cc12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/compiler_llvm/elf_loader.cc b/src/compiler_llvm/elf_loader.cc
index adea85d73f..8f8eff9014 100644
--- a/src/compiler_llvm/elf_loader.cc
+++ b/src/compiler_llvm/elf_loader.cc
@@ -84,20 +84,18 @@ void ElfLoader::RelocateExecutable() {
}
-const void* ElfLoader::GetMethodCodeAddr(size_t elf_idx,
- const Method* method) const {
+const void* ElfLoader::GetMethodCodeAddr(uint16_t elf_idx,
+ uint16_t elf_func_idx) const {
CHECK_LT(elf_idx, executables_.size());
- CHECK(method != NULL);
- return GetAddr(elf_idx, LLVMLongName(method).c_str());
+ return GetAddr(elf_idx, ElfFuncName(elf_func_idx).c_str());
}
const Method::InvokeStub* ElfLoader::
-GetMethodInvokeStubAddr(size_t elf_idx, const Method* method) const {
+GetMethodInvokeStubAddr(uint16_t elf_idx, uint16_t elf_func_idx) const {
CHECK_LT(elf_idx, executables_.size());
- CHECK(method != NULL);
return reinterpret_cast<const Method::InvokeStub*>(
- GetAddr(elf_idx, LLVMStubName(method).c_str()));
+ GetAddr(elf_idx, ElfFuncName(elf_func_idx).c_str()));
}