Add ELF index to art::CompiledMethod.
(cherry picked from commit fd9514dbab8eaca357b6d712bb7e1b635617f92e)
Change-Id: I79bff6bf9d05ce6ffc25c3cef41d1acefc4d8d2a
diff --git a/src/compiled_method.cc b/src/compiled_method.cc
index 3328ab0..e85809c 100644
--- a/src/compiled_method.cc
+++ b/src/compiled_method.cc
@@ -18,13 +18,6 @@
namespace art {
-#if defined(ART_USE_LLVM_COMPILER)
-CompiledMethod::CompiledMethod(art::InstructionSet instruction_set,
- llvm::Function *func)
- : instruction_set_(instruction_set), func_(func), frame_size_in_bytes_(0),
- core_spill_mask_(0), fp_spill_mask_(0) {
-}
-#endif
CompiledMethod::CompiledMethod(InstructionSet instruction_set,
const std::vector<uint8_t>& code,
const size_t frame_size_in_bytes,
@@ -33,7 +26,9 @@
const std::vector<uint32_t>& mapping_table,
const std::vector<uint16_t>& vmap_table)
: instruction_set_(instruction_set), frame_size_in_bytes_(frame_size_in_bytes),
- core_spill_mask_(core_spill_mask), fp_spill_mask_(fp_spill_mask) {
+ core_spill_mask_(core_spill_mask), fp_spill_mask_(fp_spill_mask),
+ elf_idx_(-1)
+{
CHECK_NE(code.size(), 0U);
DCHECK_EQ(vmap_table.size(),
static_cast<uint32_t>(__builtin_popcount(core_spill_mask)
@@ -82,10 +77,17 @@
const uint32_t core_spill_mask,
const uint32_t fp_spill_mask)
: instruction_set_(instruction_set), code_(code), frame_size_in_bytes_(frame_size_in_bytes),
- core_spill_mask_(core_spill_mask), fp_spill_mask_(fp_spill_mask) {
+ core_spill_mask_(core_spill_mask), fp_spill_mask_(fp_spill_mask),
+ elf_idx_(-1)
+{
CHECK_NE(code.size(), 0U);
}
+CompiledMethod::CompiledMethod(InstructionSet instruction_set, size_t elf_idx)
+ : instruction_set_(instruction_set), frame_size_in_bytes_(0),
+ core_spill_mask_(0), fp_spill_mask_(0), elf_idx_(elf_idx) {
+}
+
CompiledMethod::~CompiledMethod() {}
InstructionSet CompiledMethod::GetInstructionSet() const {
@@ -171,11 +173,12 @@
}
#if defined(ART_USE_LLVM_COMPILER)
-CompiledInvokeStub::CompiledInvokeStub(llvm::Function* func) : func_(func) {
- CHECK_NE(func, static_cast<llvm::Function*>(NULL));
+CompiledInvokeStub::CompiledInvokeStub(size_t elf_idx) : elf_idx_(elf_idx) {
}
#endif
-CompiledInvokeStub::CompiledInvokeStub(std::vector<uint8_t>& code) {
+
+CompiledInvokeStub::CompiledInvokeStub(std::vector<uint8_t>& code)
+ : elf_idx_(-1) {
CHECK_NE(code.size(), 0U);
code_ = code;
}