summaryrefslogtreecommitdiff
path: root/compiler/oat_writer.h
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/oat_writer.h')
-rw-r--r--compiler/oat_writer.h39
1 files changed, 24 insertions, 15 deletions
diff --git a/compiler/oat_writer.h b/compiler/oat_writer.h
index 676d628450..c472000f37 100644
--- a/compiler/oat_writer.h
+++ b/compiler/oat_writer.h
@@ -21,6 +21,7 @@
#include <cstddef>
#include <memory>
+#include "linker/relative_patcher.h" // For linker::RelativePatcherTargetProvider.
#include "mem_map.h"
#include "method_reference.h"
#include "oat.h"
@@ -114,14 +115,18 @@ class OatWriter {
~OatWriter();
struct DebugInfo {
- DebugInfo(const std::string& method_name, const char* src_file_name,
- uint32_t low_pc, uint32_t high_pc, const uint8_t* dbgstream,
- CompiledMethod* compiled_method)
- : method_name_(method_name), src_file_name_(src_file_name),
- low_pc_(low_pc), high_pc_(high_pc), dbgstream_(dbgstream),
- compiled_method_(compiled_method) {
+ DebugInfo(const std::string& method_name, bool deduped,
+ const char* class_descriptor, const char* src_file_name,
+ uint32_t low_pc, uint32_t high_pc,
+ const uint8_t* dbgstream, CompiledMethod* compiled_method)
+ : method_name_(method_name), deduped_(deduped),
+ class_descriptor_(class_descriptor), src_file_name_(src_file_name),
+ low_pc_(low_pc), high_pc_(high_pc),
+ dbgstream_(dbgstream), compiled_method_(compiled_method) {
}
std::string method_name_; // Note: this name is a pretty-printed name.
+ bool deduped_;
+ const char* class_descriptor_;
const char* src_file_name_;
uint32_t low_pc_;
uint32_t high_pc_;
@@ -133,6 +138,10 @@ class OatWriter {
return method_info_;
}
+ const CompilerDriver* GetCompilerDriver() {
+ return compiler_driver_;
+ }
+
private:
// The DataAccess classes are helper classes that provide access to members related to
// a given map, i.e. GC map, mapping table or vmap table. By abstracting these away
@@ -327,19 +336,19 @@ class OatWriter {
uint32_t size_oat_class_method_bitmaps_;
uint32_t size_oat_class_method_offsets_;
- class RelativePatcher;
- class NoRelativePatcher;
- class X86RelativePatcher;
- class ArmBaseRelativePatcher;
- class Thumb2RelativePatcher;
- class Arm64RelativePatcher;
-
- std::unique_ptr<RelativePatcher> relative_patcher_;
+ std::unique_ptr<linker::RelativePatcher> relative_patcher_;
// The locations of absolute patches relative to the start of the executable section.
std::vector<uintptr_t> absolute_patch_locations_;
- SafeMap<MethodReference, uint32_t, MethodReferenceComparator> method_offset_map_;
+ // Map method reference to assigned offset.
+ // Wrap the map in a class implementing linker::RelativePatcherTargetProvider.
+ class MethodOffsetMap FINAL : public linker::RelativePatcherTargetProvider {
+ public:
+ std::pair<bool, uint32_t> FindMethodOffset(MethodReference ref) OVERRIDE;
+ SafeMap<MethodReference, uint32_t, MethodReferenceComparator> map;
+ };
+ MethodOffsetMap method_offset_map_;
DISALLOW_COPY_AND_ASSIGN(OatWriter);
};