/art/libdexfile/dex/ |
D | dex_file_verifier_test.cc | 41 static void MakeDexVersion37(DexFile* dex_file) { in MakeDexVersion37() argument 43 CHECK_EQ(*(dex_file->Begin() + offset), '5'); in MakeDexVersion37() 44 *(const_cast<uint8_t*>(dex_file->Begin()) + offset) = '7'; in MakeDexVersion37() 47 static void FixUpChecksum(uint8_t* dex_file) { in FixUpChecksum() argument 48 DexFile::Header* header = reinterpret_cast<DexFile::Header*>(dex_file); in FixUpChecksum() 52 const uint8_t* non_sum_ptr = dex_file + non_sum; in FixUpChecksum() 71 std::unique_ptr<DexFile> dex_file(GetDexFile(dex_bytes.get(), length)); in VerifyModification() local 72 f(dex_file.get()); in VerifyModification() 73 FixUpChecksum(const_cast<uint8_t*>(dex_file->Begin())); in VerifyModification() 77 bool success = DexFileVerifier::Verify(dex_file.get(), in VerifyModification() [all …]
|
D | test_dex_file_builder_test.cc | 32 std::unique_ptr<const DexFile> dex_file(builder.Build(dex_location)); in TEST() local 33 ASSERT_TRUE(dex_file != nullptr); in TEST() 34 EXPECT_STREQ(dex_location, dex_file->GetLocation().c_str()); in TEST() 49 ASSERT_EQ(arraysize(expected_strings), dex_file->NumStringIds()); in TEST() 52 dex_file->GetStringData(dex_file->GetStringId(dex::StringIndex(i)))) << i; in TEST() 63 ASSERT_EQ(arraysize(expected_types), dex_file->NumTypeIds()); in TEST() 66 dex_file->GetTypeDescriptor(dex_file->GetTypeId(dex::TypeIndex(i)))) << i; in TEST() 69 ASSERT_EQ(1u, dex_file->NumFieldIds()); in TEST() 70 EXPECT_STREQ("[I TestClass.intField", dex_file->PrettyField(0u).c_str()); in TEST() 72 ASSERT_EQ(2u, dex_file->NumProtoIds()); in TEST() [all …]
|
D | method_reference.h | 32 return dex_file->PrettyMethod(index, with_signature); 35 return dex_file->GetMethodId(index); in GetMethodId() 42 if (mr1.dex_file == mr2.dex_file) { in operator() 55 int descriptor_diff = strcmp(mr1.dex_file->StringByTypeIdx(mid1.class_idx_), in SlowCompare() 56 mr2.dex_file->StringByTypeIdx(mid2.class_idx_)); in SlowCompare() 61 int name_diff = strcmp(mr1.dex_file->GetMethodName(mid1), mr2.dex_file->GetMethodName(mid2)); in SlowCompare() 66 const dex::ProtoId& prid1 = mr1.dex_file->GetProtoId(mid1.proto_idx_); in SlowCompare() 67 const dex::ProtoId& prid2 = mr2.dex_file->GetProtoId(mid2.proto_idx_); in SlowCompare() 68 int return_type_diff = strcmp(mr1.dex_file->StringByTypeIdx(prid1.return_type_idx_), in SlowCompare() 69 mr2.dex_file->StringByTypeIdx(prid2.return_type_idx_)); in SlowCompare() [all …]
|
D | dex_file_reference.h | 28 DexFileReference(const DexFile* file, uint32_t idx) : dex_file(file), index(idx) {} in DexFileReference() 29 const DexFile* dex_file; variable 34 if (a.dex_file != b.dex_file) { in operator() 35 return a.dex_file < b.dex_file; in operator() 47 return a.dex_file == b.dex_file && a.index == b.index;
|
D | dex_file_layout.cc | 50 void DexLayoutSection::Subsection::Madvise(const DexFile* dex_file, int advice) const { in Madvise() argument 51 DCHECK(dex_file != nullptr); in Madvise() 52 DCHECK_LT(start_offset_, dex_file->Size()); in Madvise() 53 DCHECK_LE(end_offset_, dex_file->Size()); in Madvise() 54 MadviseLargestPageAlignedRegion(dex_file->Begin() + start_offset_, in Madvise() 55 dex_file->Begin() + end_offset_, in Madvise() 59 void DexLayoutSections::Madvise(const DexFile* dex_file, MadviseState state) const { in Madvise() argument 61 UNUSED(dex_file); in Madvise() 70 dex_file, in Madvise() 73 dex_file, in Madvise() [all …]
|
D | type_reference.h | 34 TypeReference(const DexFile* dex_file, dex::TypeIndex index) in TypeReference() argument 35 : DexFileReference(dex_file, index.index_) {} in TypeReference() 47 StringReference sr1(tr1.dex_file, tr1.dex_file->GetTypeId(tr1.TypeIndex()).descriptor_idx_); in operator() 48 StringReference sr2(tr2.dex_file, tr2.dex_file->GetTypeId(tr2.TypeIndex()).descriptor_idx_); in operator()
|
D | code_item_accessors-inl.h | 55 inline void CodeItemInstructionAccessor::Init(const DexFile& dex_file, in Init() argument 58 DCHECK(dex_file.IsInDataSection(code_item)); in Init() 59 if (dex_file.IsCompactDexFile()) { in Init() 62 DCHECK(dex_file.IsStandardDexFile()); in Init() 69 const DexFile& dex_file, in CodeItemInstructionAccessor() argument 71 Init(dex_file, code_item); in CodeItemInstructionAccessor() 112 inline void CodeItemDataAccessor::Init(const DexFile& dex_file, in Init() argument 115 if (dex_file.IsCompactDexFile()) { in Init() 118 DCHECK(dex_file.IsStandardDexFile()); in Init() 124 inline CodeItemDataAccessor::CodeItemDataAccessor(const DexFile& dex_file, in CodeItemDataAccessor() argument [all …]
|
D | type_lookup_table.cc | 33 TypeLookupTable TypeLookupTable::Create(const DexFile& dex_file) { in Create() argument 34 uint32_t num_class_defs = dex_file.NumClassDefs(); in Create() 49 for (size_t class_def_idx = 0; class_def_idx < dex_file.NumClassDefs(); ++class_def_idx) { in Create() 50 const dex::ClassDef& class_def = dex_file.GetClassDef(class_def_idx); in Create() 51 const dex::TypeId& type_id = dex_file.GetTypeId(class_def.class_idx_); in Create() 52 const dex::StringId& str_id = dex_file.GetStringId(type_id.descriptor_idx_); in Create() 53 const uint32_t hash = ComputeModifiedUtf8Hash(dex_file.GetStringData(str_id)); in Create() 65 const dex::ClassDef& class_def = dex_file.GetClassDef(class_def_idx); in Create() 66 const dex::TypeId& type_id = dex_file.GetTypeId(class_def.class_idx_); in Create() 67 const dex::StringId& str_id = dex_file.GetStringId(type_id.descriptor_idx_); in Create() [all …]
|
/art/tools/hiddenapi/ |
D | hiddenapi_test.cc | 119 std::unique_ptr<const DexFile> dex_file(dex_loader.OpenDex( in OpenDex() local 122 if (dex_file.get() == nullptr) { in OpenDex() 125 } else if (!dex_file->IsStandardDexFile()) { in OpenDex() 130 return dex_file; in OpenDex() 167 const dex::ClassDef& FindClass(const char* desc, const DexFile& dex_file) { in FindClass() argument 168 const dex::TypeId* type_id = dex_file.FindTypeId(desc); in FindClass() 170 const dex::ClassDef* found = dex_file.FindClassDef(dex_file.GetIndexForTypeId(*type_id)); in FindClass() 178 const DexFile& dex_file) { in GetFieldHiddenFlags() argument 179 ClassAccessor accessor(dex_file, class_def, /* parse hiddenapi flags */ true); in GetFieldHiddenFlags() 187 const dex::FieldId& fid = dex_file.GetFieldId(field.GetIndex()); in GetFieldHiddenFlags() [all …]
|
/art/runtime/verifier/ |
D | verifier_deps.cc | 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() [all …]
|
D | verifier_deps.h | 72 void RecordClassVerified(const DexFile& dex_file, const dex::ClassDef& class_def) 76 static void MaybeRecordVerificationStatus(const DexFile& dex_file, 83 static void MaybeRecordClassRedefinition(const DexFile& dex_file, const dex::ClassDef& class_def) 88 static void MaybeRecordClassResolution(const DexFile& dex_file, 96 static void MaybeRecordFieldResolution(const DexFile& dex_file, 104 static void MaybeRecordMethodResolution(const DexFile& dex_file, 113 static void MaybeRecordAssignability(const DexFile& dex_file, 135 const std::vector<bool>& GetVerifiedClasses(const DexFile& dex_file) const { in GetVerifiedClasses() argument 136 return GetDexFileDeps(dex_file)->verified_classes_; in GetVerifiedClasses() 139 const std::vector<bool>& GetRedefinedClasses(const DexFile& dex_file) const { in GetRedefinedClasses() argument [all …]
|
/art/dexlayout/ |
D | dex_ir_builder.cc | 144 void CreateStringId(const DexFile& dex_file, uint32_t i); 145 void CreateTypeId(const DexFile& dex_file, uint32_t i); 146 void CreateProtoId(const DexFile& dex_file, uint32_t i); 147 void CreateFieldId(const DexFile& dex_file, uint32_t i); 148 void CreateMethodId(const DexFile& dex_file, uint32_t i); 149 void CreateClassDef(const DexFile& dex_file, uint32_t i); 150 void CreateCallSiteId(const DexFile& dex_file, uint32_t i); 151 void CreateMethodHandleItem(const DexFile& dex_file, uint32_t i); 153 void CreateCallSitesAndMethodHandles(const DexFile& dex_file); 156 EncodedArrayItem* CreateEncodedArrayItem(const DexFile& dex_file, [all …]
|
D | dexlayout_test.cc | 270 for (const std::string& dex_file : GetLibCoreDexFileNames()) { in FullPlainOutputExec() local 272 { dexdump, "-d", "-f", "-h", "-l", "plain", "-o", dexdump_filename, dex_file }; in FullPlainOutputExec() 274 { "-d", "-f", "-h", "-l", "plain", "-o", dexlayout_filename, dex_file }; in FullPlainOutputExec() 298 for (const std::string& dex_file : GetLibCoreDexFileNames()) { in DexFileOutputExec() local 300 { "-w", tmp_dir, "-o", tmp_name, dex_file }; in DexFileOutputExec() 306 { "/usr/bin/unzip", dex_file, "classes.dex", "-d", unzip_dir}; in DexFileOutputExec() 348 for (const std::unique_ptr<const DexFile>& dex_file : dex_files) { in CreateProfile() local 349 for (uint32_t i = 0; i < dex_file->NumMethodIds(); i += 2) { in CreateProfile() 361 dex_file->GetLocationChecksum(), in CreateProfile() 363 dex_file->NumMethodIds()); in CreateProfile() [all …]
|
/art/runtime/mirror/ |
D | dex_cache.cc | 40 const DexFile* dex_file, in InitializeDexCache() argument 43 DCHECK(dex_file != nullptr); in InitializeDexCache() 45 DexCacheArraysLayout layout(image_pointer_size, dex_file); in InitializeDexCache() 48 if (dex_file->NumStringIds() != 0u || in InitializeDexCache() 49 dex_file->NumTypeIds() != 0u || in InitializeDexCache() 50 dex_file->NumMethodIds() != 0u || in InitializeDexCache() 51 dex_file->NumFieldIds() != 0u) { in InitializeDexCache() 60 StringDexCacheType* strings = (dex_file->NumStringIds() == 0u) ? nullptr : in InitializeDexCache() 62 TypeDexCacheType* types = (dex_file->NumTypeIds() == 0u) ? nullptr : in InitializeDexCache() 64 MethodDexCacheType* methods = (dex_file->NumMethodIds() == 0u) ? nullptr : in InitializeDexCache() [all …]
|
/art/compiler/utils/ |
D | atomic_dex_ref_map-inl.h | 33 const DexFile* dex_file) { in NumberOfDexIndices() argument 40 return dex_file->NumMethodIds(); in NumberOfDexIndices() 43 return dex_file->NumClassDefs(); in NumberOfDexIndices() 46 return dex_file->NumTypeIds(); in NumberOfDexIndices() 56 ElementArray* const array = GetArray(ref.dex_file); in Insert() 69 const ElementArray* const array = GetArray(ref.dex_file); in Get() 80 ElementArray* const array = GetArray(ref.dex_file); in Remove() 89 inline void AtomicDexRefMap<DexFileReferenceType, Value>::AddDexFile(const DexFile* dex_file) { in AddDexFile() argument 90 arrays_.Put(dex_file, std::move(ElementArray(NumberOfDexIndices(dex_file)))); in AddDexFile() 96 for (const DexFile* dex_file : dex_files) { in AddDexFiles() local [all …]
|
D | atomic_dex_ref_map.h | 54 void AddDexFile(const DexFile* dex_file); 60 bool HaveDexFile(const DexFile* dex_file) const { in HaveDexFile() argument 61 return arrays_.find(dex_file) != arrays_.end(); in HaveDexFile() 75 const ElementArray* GetArray(const DexFile* dex_file) const; 76 ElementArray* GetArray(const DexFile* dex_file); 78 static size_t NumberOfDexIndices(const DexFile* dex_file);
|
/art/libdexfile/external/ |
D | dex_file_supp_test.cc | 128 std::unique_ptr<DexFile> dex_file = DexFile::OpenFromMemory(kDexData, &size, "", &error_msg); in GetTestDexData() local 130 return dex_file; in GetTestDexData() 185 std::unique_ptr<DexFile> dex_file = GetTestDexData(); in TEST() local 186 ASSERT_NE(dex_file, nullptr); in TEST() 188 MethodInfo info = dex_file->GetMethodInfoForOffset(0x102, false); in TEST() 193 info = dex_file->GetMethodInfoForOffset(0x118, false); in TEST() 199 info = dex_file->GetMethodInfoForOffset(0x104, false); in TEST() 206 std::unique_ptr<DexFile> dex_file = GetTestDexData(); in TEST() local 207 ASSERT_NE(dex_file, nullptr); in TEST() 209 MethodInfo info = dex_file->GetMethodInfoForOffset(0x102, true); in TEST() [all …]
|
/art/runtime/ |
D | imtable-inl.h | 48 const DexFile* dex_file = method->GetDexFile(); in GetImtHashComponents() local 49 const dex::MethodId& method_id = dex_file->GetMethodId(method->GetDexMethodIndex()); in GetImtHashComponents() 52 *class_hash = ComputeModifiedUtf8Hash(dex_file->GetMethodDeclaringClassDescriptor(method_id)); in GetImtHashComponents() 55 *name_hash = ComputeModifiedUtf8Hash(dex_file->GetMethodName(method_id)); in GetImtHashComponents() 57 const dex::ProtoId& proto_id = dex_file->GetMethodPrototype(method_id); in GetImtHashComponents() 61 dex_file->GetTypeDescriptor(dex_file->GetTypeId(proto_id.return_type_idx_))); in GetImtHashComponents() 66 const dex::TypeList* param_types = dex_file->GetProtoParameters(proto_id); in GetImtHashComponents() 71 dex_file->GetTypeDescriptor(dex_file->GetTypeId(type.type_idx_))); in GetImtHashComponents()
|
D | art_method-inl.h | 170 const DexFile* dex_file = GetDexFile(); in GetDeclaringClassDescriptor() local 171 return dex_file->GetMethodDeclaringClassDescriptor(dex_file->GetMethodId(dex_method_idx)); in GetDeclaringClassDescriptor() 181 const DexFile* dex_file = GetDexFile(); in GetShorty() local 182 return dex_file->GetMethodShorty(dex_file->GetMethodId(GetDexMethodIndex()), out_length); in GetShorty() 189 const DexFile* dex_file = GetDexFile(); in GetSignature() local 190 return dex_file->GetMethodSignature(dex_file->GetMethodId(dex_method_idx)); in GetSignature() 199 const DexFile* dex_file = GetDexFile(); in GetName() local 200 return dex_file->GetMethodName(dex_file->GetMethodId(dex_method_idx)); in GetName() 209 const DexFile* dex_file = GetDexFile(); in GetNameView() local 211 const char* name = dex_file->GetMethodName(dex_file->GetMethodId(dex_method_idx), &length); in GetNameView() [all …]
|
/art/test/692-vdex-inmem-loader/ |
D | vdex_inmem_loader.cc | 49 [&](const DexFile* dex_file) { in Java_Main_areClassesVerified() argument 50 dex_files.push_back(dex_file); in Java_Main_areClassesVerified() 59 for (const DexFile* dex_file : dex_files) { in Java_Main_areClassesVerified() local 60 for (uint16_t cdef_idx = 0; cdef_idx < dex_file->NumClassDefs(); ++cdef_idx) { in Java_Main_areClassesVerified() 61 const char* desc = dex_file->GetClassDescriptor(dex_file->GetClassDef(cdef_idx)); in Java_Main_areClassesVerified() 88 [&](const DexFile* dex_file) { in Java_Main_hasVdexFile() argument 89 dex_headers.push_back(&dex_file->GetHeader()); in Java_Main_hasVdexFile() 118 [&](const DexFile* dex_file) { in Java_Main_isBackedByOatFile() argument 119 bool is_backed_by_oat = (dex_file->GetOatDexFile() != nullptr); in Java_Main_isBackedByOatFile() 143 [&](const DexFile* dex_file) { in Java_Main_areClassesPreverified() argument [all …]
|
/art/tools/veridex/ |
D | hidden_api.cc | 78 std::string HiddenApi::GetApiMethodName(const DexFile& dex_file, uint32_t method_index) { in GetApiMethodName() argument 80 const dex::MethodId& method_id = dex_file.GetMethodId(method_index); in GetApiMethodName() 81 ss << dex_file.StringByTypeIdx(method_id.class_idx_) in GetApiMethodName() 83 << dex_file.GetMethodName(method_id) in GetApiMethodName() 84 << dex_file.GetMethodSignature(method_id).ToString(); in GetApiMethodName() 88 std::string HiddenApi::GetApiFieldName(const DexFile& dex_file, uint32_t field_index) { in GetApiFieldName() argument 90 const dex::FieldId& field_id = dex_file.GetFieldId(field_index); in GetApiFieldName() 91 ss << dex_file.StringByTypeIdx(field_id.class_idx_) in GetApiFieldName() 93 << dex_file.GetFieldName(field_id) in GetApiFieldName() 95 << dex_file.GetFieldTypeDescriptor(field_id); in GetApiFieldName()
|
/art/tools/dexanalyze/ |
D | dexanalyze_experiments.cc | 81 for (const std::unique_ptr<const DexFile>& dex_file : dex_files) { in ProcessDexFiles() local 82 ProcessDexFile(*dex_file); in ProcessDexFiles() 92 for (const std::unique_ptr<const DexFile>& dex_file : dex_files) { in ProcessDexFiles() local 93 for (ClassAccessor accessor : dex_file->GetClasses()) { in ProcessDexFiles() 95 CodeItemDebugInfoAccessor code_item(*dex_file, method.GetCodeItem(), method.GetIndex()); in ProcessDexFiles() 96 const uint8_t* debug_info = dex_file->GetDebugInfoStream(code_item.DebugInfoOffset()); in ProcessDexFiles() 217 for (const std::unique_ptr<const DexFile>& dex_file : dex_files) { in ProcessDexFiles() local 218 for (size_t i = 0; i < dex_file->NumTypeIds(); ++i) { in ProcessDexFiles() 220 dex_file->StringDataByIdx(dex_file->GetTypeId(dex::TypeIndex(i)).descriptor_idx_)); in ProcessDexFiles() 222 for (size_t i = 0; i < dex_file->NumFieldIds(); ++i) { in ProcessDexFiles() [all …]
|
/art/dex2oat/driver/ |
D | compiler_driver.cc | 347 const DexFile& dex_file, const dex::ClassDef& class_def) in GetDexToDexCompilationLevel() argument 352 if (dex_file.GetContainer() != nullptr && dex_file.GetContainer()->IsReadOnly()) { in GetDexToDexCompilationLevel() 357 const char* descriptor = dex_file.GetClassDescriptor(class_def); in GetDexToDexCompilationLevel() 391 const DexFile& dex_file, in GetDexToDexCompilationLevel() argument 397 return GetDexToDexCompilationLevel(self, driver, class_loader, dex_file, class_def); in GetDexToDexCompilationLevel() 425 const DexFile& dex_file, in CompileMethodHarness() argument 432 MethodReference method_ref(&dex_file, method_idx); in CompileMethodHarness() 442 dex_file, in CompileMethodHarness() 449 LOG(WARNING) << "Compilation of " << dex_file.PrettyMethod(method_idx) in CompileMethodHarness() 460 LOG(FATAL) << "Unexpected exception compiling: " << dex_file.PrettyMethod(method_idx) << "\n" in CompileMethodHarness() [all …]
|
/art/profman/ |
D | profman.cc | 408 auto process_fn = [profile_filter_keys](std::unique_ptr<const DexFile>&& dex_file) { in GetProfileFilterKeyFromApks() argument 412 dex_file->GetLocation()), dex_file->GetLocationChecksum()); in GetProfileFilterKeyFromApks() 418 auto process_fn = [dex_files](std::unique_ptr<const DexFile>&& dex_file) { in OpenApkFilesFromLocations() argument 419 dex_files->emplace_back(std::move(dex_file)); in OpenApkFilesFromLocations() 482 for (std::unique_ptr<const DexFile>& dex_file : dex_files_for_location) { in OpenApkFilesFromLocations() 483 process_fn(std::move(dex_file)); in OpenApkFilesFromLocations() 569 for (const std::unique_ptr<const DexFile>& dex_file : dex_files) { in DumpProfileInfo() local 571 oss << dex_file->GetLocation() in DumpProfileInfo() 572 << " [checksum=" << std::hex << dex_file->GetLocationChecksum() << "]\n"; in DumpProfileInfo() 639 for (const std::unique_ptr<const DexFile>& dex_file : *dex_files) { in GetClassNamesAndMethods() [all …]
|
/art/compiler/ |
D | compiler.cc | 50 const DexFile& dex_file) { in IsPathologicalCase() argument 56 CodeItemDataAccessor accessor(dex_file, &code_item); in IsPathologicalCase() 60 << " in " << dex_file.PrettyMethod(method_idx); in IsPathologicalCase() 65 << accessor.RegistersSize() << " in " << dex_file.PrettyMethod(method_idx); in IsPathologicalCase()
|