summaryrefslogtreecommitdiff
path: root/compiler/linker
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2024-04-16 16:17:24 +0000
committer VladimĂ­r Marko <vmarko@google.com> 2024-04-17 08:17:04 +0000
commitc66a8e55574d3d83f20ba7d0705f52ce34eb3dca (patch)
tree173ae58e618975a7f12580d2ff99f071015c2421 /compiler/linker
parentde8e6689cb3f829b73e921d843cfa38bbfe996bf (diff)
Clean up target retrieval from `LinkerPatch`.
Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 38313278 Change-Id: I637680589ba6f483b746bce567870f6d896d9fde
Diffstat (limited to 'compiler/linker')
-rw-r--r--compiler/linker/linker_patch.h34
1 files changed, 9 insertions, 25 deletions
diff --git a/compiler/linker/linker_patch.h b/compiler/linker/linker_patch.h
index 6e09ea8954..19ee0e640c 100644
--- a/compiler/linker/linker_patch.h
+++ b/compiler/linker/linker_patch.h
@@ -25,6 +25,9 @@
#include "base/bit_utils.h"
#include "base/macros.h"
#include "dex/method_reference.h"
+#include "dex/proto_reference.h"
+#include "dex/string_reference.h"
+#include "dex/type_reference.h"
namespace art HIDDEN {
@@ -236,42 +239,23 @@ class LinkerPatch {
return MethodReference(target_dex_file_, method_idx_);
}
- const DexFile* TargetTypeDexFile() const {
+ TypeReference TargetType() const {
DCHECK(patch_type_ == Type::kTypeRelative ||
patch_type_ == Type::kTypeBssEntry ||
patch_type_ == Type::kPublicTypeBssEntry ||
patch_type_ == Type::kPackageTypeBssEntry);
- return target_dex_file_;
+ return TypeReference(target_dex_file_, dex::TypeIndex(type_idx_));
}
- dex::TypeIndex TargetTypeIndex() const {
- DCHECK(patch_type_ == Type::kTypeRelative ||
- patch_type_ == Type::kTypeBssEntry ||
- patch_type_ == Type::kPublicTypeBssEntry ||
- patch_type_ == Type::kPackageTypeBssEntry);
- return dex::TypeIndex(type_idx_);
- }
-
- const DexFile* TargetStringDexFile() const {
+ StringReference TargetString() const {
DCHECK(patch_type_ == Type::kStringRelative ||
patch_type_ == Type::kStringBssEntry);
- return target_dex_file_;
- }
-
- dex::StringIndex TargetStringIndex() const {
- DCHECK(patch_type_ == Type::kStringRelative ||
- patch_type_ == Type::kStringBssEntry);
- return dex::StringIndex(string_idx_);
- }
-
- const DexFile* TargetProtoDexFile() const {
- DCHECK(patch_type_ == Type::kMethodTypeBssEntry);
- return target_dex_file_;
+ return StringReference(target_dex_file_, dex::StringIndex(string_idx_));
}
- dex::ProtoIndex TargetProtoIndex() const {
+ ProtoReference TargetProto() const {
DCHECK(patch_type_ == Type::kMethodTypeBssEntry);
- return dex::ProtoIndex(proto_idx_);
+ return ProtoReference(target_dex_file_, dex::ProtoIndex(proto_idx_));
}
uint32_t PcInsnOffset() const {