summaryrefslogtreecommitdiff
path: root/libdexfile/dex/method_reference.h
diff options
context:
space:
mode:
author Andreas Gampe <agampe@google.com> 2018-12-28 09:39:56 -0800
committer Andreas Gampe <agampe@google.com> 2019-01-02 10:32:25 -0800
commit3f1dcd39e134d994ac88dcc4f30ec8cabcd8decf (patch)
tree365d20ad6b68ff1dbd4903764b63880324136e4d /libdexfile/dex/method_reference.h
parent0f0a4e40667c87fbd4ae5480eddbfd701bfabfa2 (diff)
ART: Move dex structs into own header
Separating out the structs from DexFile allows them to be forward- declared, which reduces the need to include the dex_file header. Bug: 119869270 Test: m Change-Id: I32dde5a632884bca7435cd584b4a81883de2e7b4
Diffstat (limited to 'libdexfile/dex/method_reference.h')
-rw-r--r--libdexfile/dex/method_reference.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/libdexfile/dex/method_reference.h b/libdexfile/dex/method_reference.h
index 266582b059..f66ac30c53 100644
--- a/libdexfile/dex/method_reference.h
+++ b/libdexfile/dex/method_reference.h
@@ -31,7 +31,7 @@ class MethodReference : public DexFileReference {
std::string PrettyMethod(bool with_signature = true) const {
return dex_file->PrettyMethod(index, with_signature);
}
- const DexFile::MethodId& GetMethodId() const {
+ const dex::MethodId& GetMethodId() const {
return dex_file->GetMethodId(index);
}
};
@@ -50,8 +50,8 @@ struct MethodReferenceValueComparator {
bool SlowCompare(MethodReference mr1, MethodReference mr2) const {
// The order is the same as for method ids in a single dex file.
// Compare the class descriptors first.
- const DexFile::MethodId& mid1 = mr1.GetMethodId();
- const DexFile::MethodId& mid2 = mr2.GetMethodId();
+ const dex::MethodId& mid1 = mr1.GetMethodId();
+ const dex::MethodId& mid2 = mr2.GetMethodId();
int descriptor_diff = strcmp(mr1.dex_file->StringByTypeIdx(mid1.class_idx_),
mr2.dex_file->StringByTypeIdx(mid2.class_idx_));
if (descriptor_diff != 0) {
@@ -63,17 +63,17 @@ struct MethodReferenceValueComparator {
return name_diff < 0;
}
// And then compare proto ids, starting with return type comparison.
- const DexFile::ProtoId& prid1 = mr1.dex_file->GetProtoId(mid1.proto_idx_);
- const DexFile::ProtoId& prid2 = mr2.dex_file->GetProtoId(mid2.proto_idx_);
+ const dex::ProtoId& prid1 = mr1.dex_file->GetProtoId(mid1.proto_idx_);
+ const dex::ProtoId& prid2 = mr2.dex_file->GetProtoId(mid2.proto_idx_);
int return_type_diff = strcmp(mr1.dex_file->StringByTypeIdx(prid1.return_type_idx_),
mr2.dex_file->StringByTypeIdx(prid2.return_type_idx_));
if (return_type_diff != 0) {
return return_type_diff < 0;
}
// And finishing with lexicographical parameter comparison.
- const DexFile::TypeList* params1 = mr1.dex_file->GetProtoParameters(prid1);
+ const dex::TypeList* params1 = mr1.dex_file->GetProtoParameters(prid1);
size_t param1_size = (params1 != nullptr) ? params1->Size() : 0u;
- const DexFile::TypeList* params2 = mr2.dex_file->GetProtoParameters(prid2);
+ const dex::TypeList* params2 = mr2.dex_file->GetProtoParameters(prid2);
size_t param2_size = (params2 != nullptr) ? params2->Size() : 0u;
for (size_t i = 0, num = std::min(param1_size, param2_size); i != num; ++i) {
int param_diff = strcmp(mr1.dex_file->StringByTypeIdx(params1->GetTypeItem(i).type_idx_),