Add ELF index to art::CompiledMethod.

(cherry picked from commit fd9514dbab8eaca357b6d712bb7e1b635617f92e)

Change-Id: I79bff6bf9d05ce6ffc25c3cef41d1acefc4d8d2a
diff --git a/src/compiler_llvm/jni_compiler.cc b/src/compiler_llvm/jni_compiler.cc
index 6cccbe1..ad730dc 100644
--- a/src/compiler_llvm/jni_compiler.cc
+++ b/src/compiler_llvm/jni_compiler.cc
@@ -253,7 +253,8 @@
   // Verify the generated bitcode
   llvm::verifyFunction(*func_, llvm::PrintMessageAction);
 
-  return new CompiledMethod(cunit_->GetInstructionSet(), func_);
+  return new CompiledMethod(cunit_->GetInstructionSet(),
+                            cunit_->GetElfIndex());
 }
 
 
diff --git a/src/compiler_llvm/method_compiler.cc b/src/compiler_llvm/method_compiler.cc
index 0c04bf1..2269be7 100644
--- a/src/compiler_llvm/method_compiler.cc
+++ b/src/compiler_llvm/method_compiler.cc
@@ -3580,7 +3580,8 @@
   // Dex file.  Besides, we have to convert the code unit into bytes.
   // Thus, we got our magic number 9.
 
-  return new CompiledMethod(cunit_->GetInstructionSet(), func_);
+  return new CompiledMethod(cunit_->GetInstructionSet(),
+                            cunit_->GetElfIndex());
 }
 
 
diff --git a/src/compiler_llvm/upcall_compiler.cc b/src/compiler_llvm/upcall_compiler.cc
index ec433c2..20bd94b 100644
--- a/src/compiler_llvm/upcall_compiler.cc
+++ b/src/compiler_llvm/upcall_compiler.cc
@@ -179,7 +179,7 @@
   // store ret_addr, and ret_void.  Beside, we guess that we have to use
   // 50 bytes to represent one LLVM instruction.
 
-  return new CompiledInvokeStub(func);
+  return new CompiledInvokeStub(cunit_->GetElfIndex());
 }