ART: Clean up patching data in codegens.
Reuse PatchInfo<> for additional architectures and make the
naming more consistent across architectures. Change the
DexFile reference to pointer in preparation for patching
references to the upcoming .data.bimg.rel.ro section.
Update obsolete comments; instead of referencing dex cache
arrays which were used in the past, reference the .bss and
the .data.bimg.rel.ro which shall be used in upcoming CLs.
Test: Rely on TreeHugger.
Change-Id: I03be4c4118918189e55c62105bb594500c6a42c1
diff --git a/compiler/optimizing/code_generator.h b/compiler/optimizing/code_generator.h
index 3c5a37f..60de722 100644
--- a/compiler/optimizing/code_generator.h
+++ b/compiler/optimizing/code_generator.h
@@ -618,14 +618,18 @@
protected:
// Patch info used for recording locations of required linker patches and their targets,
- // i.e. target method, string, type or code identified by their dex file and index.
+ // i.e. target method, string, type or code identified by their dex file and index,
+ // or .data.bimg.rel.ro entries identified by the boot image offset.
template <typename LabelType>
struct PatchInfo {
- PatchInfo(const DexFile& target_dex_file, uint32_t target_index)
- : dex_file(target_dex_file), index(target_index) { }
+ PatchInfo(const DexFile* dex_file, uint32_t off_or_idx)
+ : target_dex_file(dex_file), offset_or_index(off_or_idx), label() { }
- const DexFile& dex_file;
- uint32_t index;
+ // Target dex file or null for .data.bmig.rel.ro patches.
+ const DexFile* target_dex_file;
+ // Either the boot image offset (to write to .data.bmig.rel.ro) or string/type/method index.
+ uint32_t offset_or_index;
+ // Label for the instruction to patch.
LabelType label;
};