summaryrefslogtreecommitdiffstats
path: root/compiler/compiled_method.h
diff options
context:
space:
mode:
authorDave Allison <dallison@google.com>2014-04-08 23:08:12 +0000
committerDave Allison <dallison@google.com>2014-04-09 13:18:07 -0700
commitf9487c039efb4112616d438593a2ab02792e0304 (patch)
tree95f88645bec774d3e8df170bd0f40e4cd0911a34 /compiler/compiled_method.h
parentb24b0e2bb128532945b31ea62715776d7751f84d (diff)
downloadandroid_art-f9487c039efb4112616d438593a2ab02792e0304.tar.gz
android_art-f9487c039efb4112616d438593a2ab02792e0304.tar.bz2
android_art-f9487c039efb4112616d438593a2ab02792e0304.zip
Revert "Revert "Use trampolines for calls to helpers""
This reverts commit 081f73e888b3c246cf7635db37b7f1105cf1a2ff. Change-Id: Ibd777f8ce73cf8ed6c4cb81d50bf6437ac28cb61 Conflicts: compiler/dex/quick/mir_to_lir.h
Diffstat (limited to 'compiler/compiled_method.h')
-rw-r--r--compiler/compiled_method.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/compiler/compiled_method.h b/compiler/compiled_method.h
index 90ae6eeae8..d9edc6bd55 100644
--- a/compiler/compiled_method.h
+++ b/compiler/compiled_method.h
@@ -23,6 +23,7 @@
#include "instruction_set.h"
#include "utils.h"
#include "UniquePtr.h"
+#include "final_relocations.h"
namespace llvm {
class Function;
@@ -31,12 +32,14 @@ namespace llvm {
namespace art {
class CompilerDriver;
+class OatWriter;
class CompiledCode {
public:
// For Quick to supply an code blob
CompiledCode(CompilerDriver* compiler_driver, InstructionSet instruction_set,
- const std::vector<uint8_t>& quick_code);
+ const std::vector<uint8_t>& quick_code,
+ const FinalRelocations* relocations);
// For Portable to supply an ELF object
CompiledCode(CompilerDriver* compiler_driver, InstructionSet instruction_set,
@@ -78,6 +81,13 @@ class CompiledCode {
const std::vector<uint32_t>& GetOatdataOffsetsToCompliledCodeOffset() const;
void AddOatdataOffsetToCompliledCodeOffset(uint32_t offset);
+ // Apply all the final relocations to the quick code sequence.
+ void ApplyFinalRelocations(const OatWriter *writer, uint32_t address) {
+ if (final_relocations_.get() != nullptr) {
+ final_relocations_->Apply(&(*quick_code_)[0], writer, address);
+ }
+ }
+
private:
CompilerDriver* const compiler_driver_;
@@ -97,6 +107,10 @@ class CompiledCode {
// OatWriter and then used by the ElfWriter to add relocations so
// that MCLinker can update the values to the location in the linked .so.
std::vector<uint32_t> oatdata_offsets_to_compiled_code_offset_;
+
+ // Set of relocations to apply as the final pass. This happens
+ // only when the the final oat file addresses are known.
+ UniquePtr<const FinalRelocations> final_relocations_;
};
class CompiledMethod : public CompiledCode {
@@ -111,7 +125,8 @@ class CompiledMethod : public CompiledCode {
const std::vector<uint8_t>& mapping_table,
const std::vector<uint8_t>& vmap_table,
const std::vector<uint8_t>& native_gc_map,
- const std::vector<uint8_t>* cfi_info);
+ const std::vector<uint8_t>* cfi_info,
+ const FinalRelocations* relocations);
// Constructs a CompiledMethod for the QuickJniCompiler.
CompiledMethod(CompilerDriver& driver,