diff options
| 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 |
| commit | 3f1dcd39e134d994ac88dcc4f30ec8cabcd8decf (patch) | |
| tree | 365d20ad6b68ff1dbd4903764b63880324136e4d /runtime/hidden_api.cc | |
| parent | 0f0a4e40667c87fbd4ae5480eddbfd701bfabfa2 (diff) | |
| download | art-3f1dcd39e134d994ac88dcc4f30ec8cabcd8decf.tar.gz art-3f1dcd39e134d994ac88dcc4f30ec8cabcd8decf.tar.bz2 art-3f1dcd39e134d994ac88dcc4f30ec8cabcd8decf.zip | |
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 'runtime/hidden_api.cc')
| -rw-r--r-- | runtime/hidden_api.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/runtime/hidden_api.cc b/runtime/hidden_api.cc index e0939ddbdb..c146daa809 100644 --- a/runtime/hidden_api.cc +++ b/runtime/hidden_api.cc @@ -98,7 +98,7 @@ MemberSignature::MemberSignature(ArtMethod* method) { MemberSignature::MemberSignature(const ClassAccessor::Field& field) { const DexFile& dex_file = field.GetDexFile(); - const DexFile::FieldId& field_id = dex_file.GetFieldId(field.GetIndex()); + const dex::FieldId& field_id = dex_file.GetFieldId(field.GetIndex()); class_name_ = dex_file.GetFieldDeclaringClassDescriptor(field_id); member_name_ = dex_file.GetFieldName(field_id); type_signature_ = dex_file.GetFieldTypeDescriptor(field_id); @@ -107,7 +107,7 @@ MemberSignature::MemberSignature(const ClassAccessor::Field& field) { MemberSignature::MemberSignature(const ClassAccessor::Method& method) { const DexFile& dex_file = method.GetDexFile(); - const DexFile::MethodId& method_id = dex_file.GetMethodId(method.GetIndex()); + const dex::MethodId& method_id = dex_file.GetMethodId(method.GetIndex()); class_name_ = dex_file.GetMethodDeclaringClassDescriptor(method_id); member_name_ = dex_file.GetMethodName(method_id); type_signature_ = dex_file.GetMethodSignature(method_id).ToString(); @@ -282,14 +282,14 @@ static ALWAYS_INLINE uint32_t GetMemberDexIndex(ArtMethod* method) } static void VisitMembers(const DexFile& dex_file, - const DexFile::ClassDef& class_def, + const dex::ClassDef& class_def, const std::function<void(const ClassAccessor::Field&)>& fn_visit) { ClassAccessor accessor(dex_file, class_def, /* parse_hiddenapi_class_data= */ true); accessor.VisitFields(fn_visit, fn_visit); } static void VisitMembers(const DexFile& dex_file, - const DexFile::ClassDef& class_def, + const dex::ClassDef& class_def, const std::function<void(const ClassAccessor::Method&)>& fn_visit) { ClassAccessor accessor(dex_file, class_def, /* parse_hiddenapi_class_data= */ true); accessor.VisitMethods(fn_visit, fn_visit); @@ -317,7 +317,7 @@ uint32_t GetDexFlags(T* member) REQUIRES_SHARED(Locks::mutator_lock_) { if (LIKELY(original_dex == nullptr)) { // Class is not redefined. Find the class def, iterate over its members and // find the entry corresponding to this `member`. - const DexFile::ClassDef* class_def = declaring_class->GetClassDef(); + const dex::ClassDef* class_def = declaring_class->GetClassDef(); if (class_def == nullptr) { flags = kNoDexFlags; } else { @@ -338,7 +338,7 @@ uint32_t GetDexFlags(T* member) REQUIRES_SHARED(Locks::mutator_lock_) { // to access a hidden member of a JVMTI-redefined class. uint16_t class_def_idx = ext->GetPreRedefineClassDefIndex(); DCHECK_NE(class_def_idx, DexFile::kDexNoIndex16); - const DexFile::ClassDef& original_class_def = original_dex->GetClassDef(class_def_idx); + const dex::ClassDef& original_class_def = original_dex->GetClassDef(class_def_idx); MemberSignature member_signature(member); auto fn_visit = [&](const AccessorType& dex_member) { MemberSignature cur_signature(dex_member); |
