summaryrefslogtreecommitdiff
path: root/compiler/optimizing/code_generator.h
diff options
context:
space:
mode:
authorVladimir Marko <vmarko@google.com>2016-09-30 17:04:49 +0000
committerVladimir Marko <vmarko@google.com>2016-09-30 18:08:09 +0100
commit5f926055cb88089d8ca27243f35a9dfd89d981f0 (patch)
tree8d87d400e36301eb648e19bcd225f13c469648ad /compiler/optimizing/code_generator.h
parent9e5739aaa690a8529c104f4c05035a657616c310 (diff)
Revert "Store resolved Strings for AOT code in .bss."
There are some issues with oat_test64 on host and aosp_mips-eng. Also reverts "compiler_driver: Fix build." Bug: 20323084 Bug: 30627598 This reverts commit 63dccbbefef3014c99c22748d18befcc7bcb3b41. This reverts commit 04a44135ace10123f059373691594ae0f270a8a4. Change-Id: I568ba3e58cf103987fdd63c8a21521010a9f27c4
Diffstat (limited to 'compiler/optimizing/code_generator.h')
-rw-r--r--compiler/optimizing/code_generator.h37
1 files changed, 31 insertions, 6 deletions
diff --git a/compiler/optimizing/code_generator.h b/compiler/optimizing/code_generator.h
index 49f4f18390..85002045a3 100644
--- a/compiler/optimizing/code_generator.h
+++ b/compiler/optimizing/code_generator.h
@@ -531,15 +531,40 @@ class CodeGenerator : public DeletableArenaObject<kArenaAllocCodeGenerator> {
uint32_t GetReferenceDisableFlagOffset() const;
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.
+ // Method patch info used for recording locations of required linker patches and
+ // target methods. The target method can be used for various purposes, whether for
+ // patching the address of the method or the code pointer or a PC-relative call.
template <typename LabelType>
- struct PatchInfo {
- PatchInfo(const DexFile& target_dex_file, uint32_t target_index)
- : dex_file(target_dex_file), index(target_index) { }
+ struct MethodPatchInfo {
+ explicit MethodPatchInfo(MethodReference m) : target_method(m), label() { }
+
+ MethodReference target_method;
+ LabelType label;
+ };
+
+ // String patch info used for recording locations of required linker patches and
+ // target strings. The actual string address can be absolute or PC-relative.
+ template <typename LabelType>
+ struct StringPatchInfo {
+ StringPatchInfo(const DexFile& df, uint32_t index)
+ : dex_file(df), string_index(index), label() { }
+
+ const DexFile& dex_file;
+ uint32_t string_index;
+ LabelType label;
+ };
+
+ // Type patch info used for recording locations of required linker patches and
+ // target types. The actual type address can be absolute or PC-relative.
+ // TODO: Consider merging with MethodPatchInfo and StringPatchInfo - all these
+ // classes contain the dex file, some index and the label.
+ template <typename LabelType>
+ struct TypePatchInfo {
+ TypePatchInfo(const DexFile& df, uint32_t index)
+ : dex_file(df), type_index(index), label() { }
const DexFile& dex_file;
- uint32_t index;
+ uint32_t type_index;
LabelType label;
};