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
diff --git a/src/compiler_llvm/elf_loader.h b/src/compiler_llvm/elf_loader.h
index 9e8137f..ea98f61 100644
--- a/src/compiler_llvm/elf_loader.h
+++ b/src/compiler_llvm/elf_loader.h
@@ -26,10 +26,6 @@
#include <vector>
namespace art {
- class Method;
-}
-
-namespace art {
namespace compiler_llvm {
class ElfLoader {
@@ -41,10 +37,11 @@
void RelocateExecutable();
- const void* GetMethodCodeAddr(size_t elf_idx, const Method* method) const;
+ const void* GetMethodCodeAddr(uint16_t elf_idx,
+ uint16_t elf_func_idx) const;
- const Method::InvokeStub* GetMethodInvokeStubAddr(size_t elf_idx,
- const Method* method) const;
+ const Method::InvokeStub* GetMethodInvokeStubAddr(uint16_t elf_idx,
+ uint16_t elf_func_idx) const;
private:
const void* GetAddr(size_t elf_idx, const char* sym_name) const;