diff options
| author | 2016-06-21 15:12:24 +0000 | |
|---|---|---|
| committer | 2016-06-21 15:12:24 +0000 | |
| commit | f6d4f6e0e61977777b7a9ca18b75bcd26e98e9f9 (patch) | |
| tree | b647b68165992bc4f26287f564a18f6ce68a8082 /compiler/compiled_method.h | |
| parent | 2150d94b5a399dd7d52e1309da2e3bf80d1a5517 (diff) | |
| parent | dbb7f5bef10138ade0fb202da1d61f562b2df649 (diff) | |
Merge "Improve HLoadClass code generation."
Diffstat (limited to 'compiler/compiled_method.h')
| -rw-r--r-- | compiler/compiled_method.h | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/compiler/compiled_method.h b/compiler/compiled_method.h index 9479ff38be..2a81804f64 100644 --- a/compiler/compiled_method.h +++ b/compiler/compiled_method.h @@ -174,6 +174,7 @@ class LinkerPatch { kCall, kCallRelative, // NOTE: Actual patching is instruction_set-dependent. kType, + kTypeRelative, // NOTE: Actual patching is instruction_set-dependent. kString, kStringRelative, // NOTE: Actual patching is instruction_set-dependent. kDexCacheArray, // NOTE: Actual patching is instruction_set-dependent. @@ -215,6 +216,16 @@ class LinkerPatch { return patch; } + static LinkerPatch RelativeTypePatch(size_t literal_offset, + const DexFile* target_dex_file, + uint32_t pc_insn_offset, + uint32_t target_type_idx) { + LinkerPatch patch(literal_offset, Type::kTypeRelative, target_dex_file); + patch.type_idx_ = target_type_idx; + patch.pc_insn_offset_ = pc_insn_offset; + return patch; + } + static LinkerPatch StringPatch(size_t literal_offset, const DexFile* target_dex_file, uint32_t target_string_idx) { @@ -258,6 +269,7 @@ class LinkerPatch { bool IsPcRelative() const { switch (GetType()) { case Type::kCallRelative: + case Type::kTypeRelative: case Type::kStringRelative: case Type::kDexCacheArray: return true; @@ -274,12 +286,12 @@ class LinkerPatch { } const DexFile* TargetTypeDexFile() const { - DCHECK(patch_type_ == Type::kType); + DCHECK(patch_type_ == Type::kType || patch_type_ == Type::kTypeRelative); return target_dex_file_; } uint32_t TargetTypeIndex() const { - DCHECK(patch_type_ == Type::kType); + DCHECK(patch_type_ == Type::kType || patch_type_ == Type::kTypeRelative); return type_idx_; } @@ -304,7 +316,9 @@ class LinkerPatch { } uint32_t PcInsnOffset() const { - DCHECK(patch_type_ == Type::kStringRelative || patch_type_ == Type::kDexCacheArray); + DCHECK(patch_type_ == Type::kTypeRelative || + patch_type_ == Type::kStringRelative || + patch_type_ == Type::kDexCacheArray); return pc_insn_offset_; } |