From 59eb30f96d87e3e72a060099a292ae14dd5fe1c8 Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Tue, 20 Feb 2018 11:52:34 +0000 Subject: 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 --- compiler/optimizing/code_generator.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'compiler/optimizing/code_generator.h') diff --git a/compiler/optimizing/code_generator.h b/compiler/optimizing/code_generator.h index 3c5a37f958..60de722285 100644 --- a/compiler/optimizing/code_generator.h +++ b/compiler/optimizing/code_generator.h @@ -618,14 +618,18 @@ class CodeGenerator : public DeletableArenaObject { 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 struct PatchInfo { - PatchInfo(const DexFile& target_dex_file, uint32_t target_index) - : dex_file(target_dex_file), index(target_index) { } - - const DexFile& dex_file; - uint32_t index; + PatchInfo(const DexFile* dex_file, uint32_t off_or_idx) + : target_dex_file(dex_file), offset_or_index(off_or_idx), label() { } + + // 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; }; -- cgit v1.2.3-59-g8ed1b