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/oat.cc b/src/oat.cc
index a7b57e6..bf05f71 100644
--- a/src/oat.cc
+++ b/src/oat.cc
@@ -157,8 +157,10 @@
     gc_map_offset_(0),
     invoke_stub_offset_(0)
 #if defined(ART_USE_LLVM_COMPILER)
-  , code_elf_idx_(-1u),
-    invoke_stub_elf_idx_(-1u)
+  , code_elf_idx_(static_cast<uint16_t>(-1u)),
+    code_elf_func_idx_(static_cast<uint16_t>(-1u)),
+    invoke_stub_elf_idx_(static_cast<uint16_t>(-1u)),
+    invoke_stub_elf_func_idx_(static_cast<uint16_t>(-1u))
 #endif
 {}
 
@@ -171,8 +173,10 @@
                                    uint32_t gc_map_offset,
                                    uint32_t invoke_stub_offset
 #if defined(ART_USE_LLVM_COMPILER)
-                                 , uint32_t code_elf_idx,
-                                   uint32_t invoke_stub_elf_idx
+                                 , uint16_t code_elf_idx,
+                                   uint16_t code_elf_func_idx,
+                                   uint16_t invoke_stub_elf_idx,
+                                   uint16_t invoke_stub_elf_func_idx
 #endif
                                    )
   : code_offset_(code_offset),
@@ -185,7 +189,9 @@
     invoke_stub_offset_(invoke_stub_offset)
 #if defined(ART_USE_LLVM_COMPILER)
   , code_elf_idx_(code_elf_idx),
-    invoke_stub_elf_idx_(invoke_stub_elf_idx)
+    code_elf_func_idx_(code_elf_func_idx),
+    invoke_stub_elf_idx_(invoke_stub_elf_idx),
+    invoke_stub_elf_func_idx_(invoke_stub_elf_func_idx)
 #endif
 {}