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/compilation_unit.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/compiler_llvm/compilation_unit.h') diff --git a/src/compiler_llvm/compilation_unit.h b/src/compiler_llvm/compilation_unit.h index eb92ce445a..1db54fc413 100644 --- a/src/compiler_llvm/compilation_unit.h +++ b/src/compiler_llvm/compilation_unit.h @@ -73,6 +73,11 @@ class CompilationUnit { return ElfImage(elf_image_); } + uint16_t AcquireUniqueElfFuncIndex() { + CHECK(num_elf_funcs_ < UINT16_MAX); + return num_elf_funcs_++; + } + bool WriteBitcodeToFile(); bool Materialize(); @@ -101,6 +106,7 @@ class CompilationUnit { std::string bitcode_filename_; size_t mem_usage_; + uint16_t num_elf_funcs_; }; } // namespace compiler_llvm -- cgit v1.2.3-59-g8ed1b