Lines Matching refs:dex_file
41 for (const DexFile* dex_file : dex_files) { in VerifierDeps() local
42 DCHECK(GetDexFileDeps(*dex_file) == nullptr); in VerifierDeps()
43 std::unique_ptr<DexFileDeps> deps(new DexFileDeps(dex_file->NumClassDefs())); in VerifierDeps()
44 dex_deps_.emplace(dex_file, std::move(deps)); in VerifierDeps()
67 for (const DexFile* dex_file : dex_files) { in MergeWith() local
68 DexFileDeps* my_deps = GetDexFileDeps(*dex_file); in MergeWith()
69 DexFileDeps& other_deps = *other->GetDexFileDeps(*dex_file); in MergeWith()
83 VerifierDeps::DexFileDeps* VerifierDeps::GetDexFileDeps(const DexFile& dex_file) { in GetDexFileDeps() argument
84 auto it = dex_deps_.find(&dex_file); in GetDexFileDeps()
88 const VerifierDeps::DexFileDeps* VerifierDeps::GetDexFileDeps(const DexFile& dex_file) const { in GetDexFileDeps()
89 auto it = dex_deps_.find(&dex_file); in GetDexFileDeps()
109 dex::StringIndex VerifierDeps::GetClassDescriptorStringId(const DexFile& dex_file, in GetClassDescriptorStringId() argument
116 if (dex_cache->GetDexFile() == &dex_file) { in GetClassDescriptorStringId()
120 const dex::TypeId& type_id = dex_file.GetTypeId(class_def->class_idx_); in GetClassDescriptorStringId()
123 CHECK_EQ(GetIdFromString(dex_file, klass->GetDescriptor(&temp)), type_id.descriptor_idx_); in GetClassDescriptorStringId()
129 return GetIdFromString(dex_file, klass->GetDescriptor(&temp)); in GetClassDescriptorStringId()
133 static dex::StringIndex TryGetClassDescriptorStringId(const DexFile& dex_file, in TryGetClassDescriptorStringId() argument
138 const dex::TypeId& type_id = dex_file.GetTypeId(type_idx); in TryGetClassDescriptorStringId()
141 if (strcmp(dex_file.GetTypeDescriptor(type_id), in TryGetClassDescriptorStringId()
149 dex::StringIndex VerifierDeps::GetMethodDeclaringClassStringId(const DexFile& dex_file, in GetMethodDeclaringClassStringId() argument
157 dex_file, in GetMethodDeclaringClassStringId()
158 dex_file.GetMethodId(dex_method_index).class_idx_, in GetMethodDeclaringClassStringId()
162 DCHECK_EQ(GetClassDescriptorStringId(dex_file, method->GetDeclaringClass()), string_id); in GetMethodDeclaringClassStringId()
165 return GetClassDescriptorStringId(dex_file, method->GetDeclaringClass()); in GetMethodDeclaringClassStringId()
168 dex::StringIndex VerifierDeps::GetFieldDeclaringClassStringId(const DexFile& dex_file, in GetFieldDeclaringClassStringId() argument
176 dex_file, in GetFieldDeclaringClassStringId()
177 dex_file.GetFieldId(dex_field_idx).class_idx_, in GetFieldDeclaringClassStringId()
181 DCHECK_EQ(GetClassDescriptorStringId(dex_file, field->GetDeclaringClass()), string_id); in GetFieldDeclaringClassStringId()
184 return GetClassDescriptorStringId(dex_file, field->GetDeclaringClass()); in GetFieldDeclaringClassStringId()
219 dex::StringIndex VerifierDeps::GetIdFromString(const DexFile& dex_file, const std::string& str) { in GetIdFromString() argument
220 const dex::StringId* string_id = dex_file.FindStringId(str.c_str()); in GetIdFromString()
223 return dex_file.GetIndexForStringId(*string_id); in GetIdFromString()
232 DexFileDeps* deps = singleton->GetDexFileDeps(dex_file); in GetIdFromString()
235 uint32_t num_ids_in_dex = dex_file.NumStringIds(); in GetIdFromString()
252 DCHECK_EQ(str, singleton->GetStringFromId(dex_file, new_id)); in GetIdFromString()
257 std::string VerifierDeps::GetStringFromId(const DexFile& dex_file, dex::StringIndex string_id) in GetStringFromId() argument
259 uint32_t num_ids_in_dex = dex_file.NumStringIds(); in GetStringFromId()
261 return std::string(dex_file.StringDataByIdx(string_id)); in GetStringFromId()
263 const DexFileDeps* deps = GetDexFileDeps(dex_file); in GetStringFromId()
286 const DexFile* dex_file = dex_cache->GetDexFile(); in IsInClassPath() local
287 DCHECK(dex_file != nullptr); in IsInClassPath()
292 return (GetDexFileDeps(*dex_file) == nullptr); in IsInClassPath()
295 void VerifierDeps::AddClassResolution(const DexFile& dex_file, in AddClassResolution() argument
298 DexFileDeps* dex_deps = GetDexFileDeps(dex_file); in AddClassResolution()
313 void VerifierDeps::AddFieldResolution(const DexFile& dex_file, in AddFieldResolution() argument
316 DexFileDeps* dex_deps = GetDexFileDeps(dex_file); in AddFieldResolution()
330 GetFieldDeclaringClassStringId(dex_file, in AddFieldResolution()
335 void VerifierDeps::AddMethodResolution(const DexFile& dex_file, in AddMethodResolution() argument
338 DexFileDeps* dex_deps = GetDexFileDeps(dex_file); in AddMethodResolution()
352 GetMethodDeclaringClassStringId(dex_file, method_idx, method)); in AddMethodResolution()
411 void VerifierDeps::AddAssignability(const DexFile& dex_file, in AddAssignability() argument
456 AddAssignability(dex_file, in AddAssignability()
469 DexFileDeps* dex_deps = GetDexFileDeps(dex_file); in AddAssignability()
505 dex::StringIndex destination_id = GetClassDescriptorStringId(dex_file, destination); in AddAssignability()
506 dex::StringIndex source_id = GetClassDescriptorStringId(dex_file, source); in AddAssignability()
515 void VerifierDeps::MaybeRecordClassRedefinition(const DexFile& dex_file, in MaybeRecordClassRedefinition() argument
519 DexFileDeps* dex_deps = thread_deps->GetDexFileDeps(dex_file); in MaybeRecordClassRedefinition()
520 DCHECK_EQ(dex_deps->redefined_classes_.size(), dex_file.NumClassDefs()); in MaybeRecordClassRedefinition()
521 dex_deps->redefined_classes_[dex_file.GetIndexForClassDef(class_def)] = true; in MaybeRecordClassRedefinition()
525 void VerifierDeps::MaybeRecordVerificationStatus(const DexFile& dex_file, in MaybeRecordVerificationStatus() argument
533 thread_deps->RecordClassVerified(dex_file, class_def); in MaybeRecordVerificationStatus()
538 void VerifierDeps::RecordClassVerified(const DexFile& dex_file, const dex::ClassDef& class_def) { in RecordClassVerified() argument
539 DexFileDeps* dex_deps = GetDexFileDeps(dex_file); in RecordClassVerified()
540 DCHECK_EQ(dex_deps->verified_classes_.size(), dex_file.NumClassDefs()); in RecordClassVerified()
541 dex_deps->verified_classes_[dex_file.GetIndexForClassDef(class_def)] = true; in RecordClassVerified()
544 void VerifierDeps::MaybeRecordClassResolution(const DexFile& dex_file, in MaybeRecordClassResolution() argument
549 thread_deps->AddClassResolution(dex_file, type_idx, klass); in MaybeRecordClassResolution()
553 void VerifierDeps::MaybeRecordFieldResolution(const DexFile& dex_file, in MaybeRecordFieldResolution() argument
558 thread_deps->AddFieldResolution(dex_file, field_idx, field); in MaybeRecordFieldResolution()
562 void VerifierDeps::MaybeRecordMethodResolution(const DexFile& dex_file, in MaybeRecordMethodResolution() argument
567 thread_deps->AddMethodResolution(dex_file, method_idx, method); in MaybeRecordMethodResolution()
571 void VerifierDeps::MaybeRecordAssignability(const DexFile& dex_file, in MaybeRecordAssignability() argument
578 thread_deps->AddAssignability(dex_file, destination, source, is_strict, is_assignable); in MaybeRecordAssignability()
727 for (const DexFile* dex_file : dex_files) { in Encode() local
728 const DexFileDeps& deps = *GetDexFileDeps(*dex_file); in Encode()
770 for (const DexFile* dex_file : dex_files) { in VerifierDeps() local
771 DexFileDeps* deps = GetDexFileDeps(*dex_file); in VerifierDeps()
788 for (const DexFile* dex_file : dex_files) { in ParseVerifiedClasses() local
789 DexFileDeps deps(dex_file->NumClassDefs()); in ParseVerifiedClasses()
834 const DexFile& dex_file = *dep.first; in Dump() local
837 << dex_file.GetLocation() in Dump()
848 << GetStringFromId(dex_file, entry.GetSource()) in Dump()
850 << GetStringFromId(dex_file, entry.GetDestination()) in Dump()
856 << GetStringFromId(dex_file, entry.GetSource()) in Dump()
858 << GetStringFromId(dex_file, entry.GetDestination()) in Dump()
864 << dex_file.StringByTypeIdx(entry.GetDexTypeIndex()) in Dump()
871 const dex::FieldId& field_id = dex_file.GetFieldId(entry.GetDexFieldIndex()); in Dump()
873 << dex_file.GetFieldDeclaringClassDescriptor(field_id) << "->" in Dump()
874 << dex_file.GetFieldName(field_id) << ":" in Dump()
875 << dex_file.GetFieldTypeDescriptor(field_id) in Dump()
882 << GetStringFromId(dex_file, entry.GetDeclaringClassIndex()) in Dump()
889 const dex::MethodId& method_id = dex_file.GetMethodId(method.GetDexMethodIndex()); in Dump()
891 << dex_file.GetMethodDeclaringClassDescriptor(method_id) << "->" in Dump()
892 << dex_file.GetMethodName(method_id) in Dump()
893 << dex_file.GetMethodSignature(method_id).ToString() in Dump()
900 << GetStringFromId(dex_file, method.GetDeclaringClassIndex()) in Dump()
909 << dex_file.GetClassDescriptor(dex_file.GetClassDef(idx)) in Dump()
944 const DexFile& dex_file, in VerifyAssignability() argument
955 const std::string& destination_desc = GetStringFromId(dex_file, entry.GetDestination()); in VerifyAssignability()
958 const std::string& source_desc = GetStringFromId(dex_file, entry.GetSource()); in VerifyAssignability()
983 const DexFile& dex_file, in VerifyClasses() argument
991 std::string descriptor = dex_file.StringByTypeIdx(entry.GetDexTypeIndex()); in VerifyClasses()
1012 static std::string GetFieldDescription(const DexFile& dex_file, uint32_t index) { in GetFieldDescription() argument
1013 const dex::FieldId& field_id = dex_file.GetFieldId(index); in GetFieldDescription()
1014 return std::string(dex_file.GetFieldDeclaringClassDescriptor(field_id)) in GetFieldDescription()
1016 + dex_file.GetFieldName(field_id) in GetFieldDescription()
1018 + dex_file.GetFieldTypeDescriptor(field_id); in GetFieldDescription()
1022 const DexFile& dex_file, in VerifyFields() argument
1030 const dex::FieldId& field_id = dex_file.GetFieldId(entry.GetDexFieldIndex()); in VerifyFields()
1031 std::string_view name(dex_file.StringDataByIdx(field_id.name_idx_)); in VerifyFields()
1033 dex_file.StringDataByIdx(dex_file.GetTypeId(field_id.type_idx_).descriptor_idx_)); in VerifyFields()
1037 ? GetStringFromId(dex_file, entry.GetDeclaringClassIndex()) in VerifyFields()
1038 : dex_file.StringByTypeIdx(field_id.class_idx_); in VerifyFields()
1052 GetFieldDescription(dex_file, entry.GetDexFieldIndex()); in VerifyFields()
1056 + GetFieldDescription(dex_file, entry.GetDexFieldIndex()) in VerifyFields()
1062 + GetFieldDescription(dex_file, entry.GetDexFieldIndex()) in VerifyFields()
1069 + GetFieldDescription(dex_file, entry.GetDexFieldIndex()); in VerifyFields()
1076 static std::string GetMethodDescription(const DexFile& dex_file, uint32_t index) { in GetMethodDescription() argument
1077 const dex::MethodId& method_id = dex_file.GetMethodId(index); in GetMethodDescription()
1078 return std::string(dex_file.GetMethodDeclaringClassDescriptor(method_id)) in GetMethodDescription()
1080 + dex_file.GetMethodName(method_id) in GetMethodDescription()
1081 + dex_file.GetMethodSignature(method_id).ToString(); in GetMethodDescription()
1085 const DexFile& dex_file, in VerifyMethods() argument
1093 const dex::MethodId& method_id = dex_file.GetMethodId(entry.GetDexMethodIndex()); in VerifyMethods()
1095 const char* name = dex_file.GetMethodName(method_id); in VerifyMethods()
1096 const Signature signature = dex_file.GetMethodSignature(method_id); in VerifyMethods()
1100 ? GetStringFromId(dex_file, entry.GetDeclaringClassIndex()) in VerifyMethods()
1101 : dex_file.StringByTypeIdx(method_id.class_idx_); in VerifyMethods()
1121 + GetMethodDescription(dex_file, entry.GetDexMethodIndex()); in VerifyMethods()
1125 + GetMethodDescription(dex_file, entry.GetDexMethodIndex()) in VerifyMethods()
1131 + GetMethodDescription(dex_file, entry.GetDexMethodIndex()) in VerifyMethods()
1138 + GetMethodDescription(dex_file, entry.GetDexMethodIndex()); in VerifyMethods()
1149 for (const DexFile* dex_file : dex_files) { in IsInDexFiles() local
1150 if (OatDexFile::FindClassDef(*dex_file, descriptor, hash) != nullptr) { in IsInDexFiles()
1151 *out_dex_file = dex_file; in IsInDexFiles()
1158 bool VerifierDeps::VerifyInternalClasses(const DexFile& dex_file, in VerifyInternalClasses() argument
1166 for (ClassAccessor accessor : dex_file.GetClasses()) { in VerifyInternalClasses()
1189 + "(dexFile expected=" + dex_file.GetLocation() in VerifyInternalClasses()
1199 const DexFile& dex_file, in VerifyDexFile() argument
1204 return VerifyInternalClasses(dex_file, in VerifyDexFile()
1210 dex_file, in VerifyDexFile()
1216 dex_file, in VerifyDexFile()
1221 VerifyClasses(class_loader, dex_file, deps.classes_, self, error_msg) && in VerifyDexFile()
1222 VerifyFields(class_loader, dex_file, deps.fields_, self, error_msg) && in VerifyDexFile()
1223 VerifyMethods(class_loader, dex_file, deps.methods_, self, error_msg); in VerifyDexFile()