/art/libdexfile/dex/ |
D | dex_file_verifier_test.cc | 43 static void MakeDexVersion37(DexFile* dex_file) { in MakeDexVersion37() argument 45 CHECK_EQ(*(dex_file->Begin() + offset), '5'); in MakeDexVersion37() 46 *(const_cast<uint8_t*>(dex_file->Begin()) + offset) = '7'; in MakeDexVersion37() 49 static void FixUpChecksum(uint8_t* dex_file) { in FixUpChecksum() argument 50 DexFile::Header* header = reinterpret_cast<DexFile::Header*>(dex_file); in FixUpChecksum() 54 const uint8_t* non_sum_ptr = dex_file + non_sum; in FixUpChecksum() 73 std::unique_ptr<DexFile> dex_file(GetDexFile(dex_bytes.get(), length)); in VerifyModification() local 74 f(dex_file.get()); in VerifyModification() 75 FixUpChecksum(const_cast<uint8_t*>(dex_file->Begin())); in VerifyModification() 79 bool success = dex::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 | 30 DexFileReference(const DexFile* file, uint32_t idx) : dex_file(file), index(idx) {} in DexFileReference() 31 const DexFile* dex_file; variable 36 if (a.dex_file != b.dex_file) { in operator() 37 return a.dex_file < b.dex_file; in operator() 49 return a.dex_file == b.dex_file && a.index == b.index; 62 return hash<decltype(ref.dex_file)>()(ref.dex_file) ^
|
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 | 56 inline void CodeItemInstructionAccessor::Init(const DexFile& dex_file, in Init() argument 59 DCHECK(dex_file.IsInDataSection(code_item)); in Init() 60 if (dex_file.IsCompactDexFile()) { in Init() 63 DCHECK(dex_file.IsStandardDexFile()); in Init() 70 const DexFile& dex_file, in CodeItemInstructionAccessor() argument 72 Init(dex_file, code_item); in CodeItemInstructionAccessor() 113 inline void CodeItemDataAccessor::Init(const DexFile& dex_file, in Init() argument 116 if (dex_file.IsCompactDexFile()) { in Init() 119 DCHECK(dex_file.IsStandardDexFile()); in Init() 125 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/dex2oat/ |
D | dex2oat_vdex_test.cc | 71 const std::string& vdex_location, const DexFile* dex_file) { in GetVerifierDeps() argument 90 dex_files.push_back(dex_file); in GetVerifierDeps() 101 uint16_t GetClassDefIndex(const std::string& cls, const DexFile& dex_file) { in GetClassDefIndex() argument 102 const dex::TypeId* type_id = dex_file.FindTypeId(cls.c_str()); in GetClassDefIndex() 104 dex::TypeIndex type_idx = dex_file.GetIndexForTypeId(*type_id); in GetClassDefIndex() 105 const dex::ClassDef* class_def = dex_file.FindClassDef(type_idx); in GetClassDefIndex() 107 return dex_file.GetIndexForClassDef(*class_def); in GetClassDefIndex() 112 const DexFile& dex_file) { in HasVerifiedClass() argument 113 uint16_t class_def_idx = GetClassDefIndex(cls, dex_file); in HasVerifiedClass() 114 return deps->GetVerifiedClasses(dex_file)[class_def_idx]; in HasVerifiedClass() [all …]
|
D | verifier_deps_test.cc | 125 for (const DexFile* dex_file : dex_files_) { in LoadDexFile() local 126 class_linker_->RegisterDexFile(*dex_file, loader.Get()); in LoadDexFile() 128 for (const DexFile* dex_file : dex_files_) { in LoadDexFile() local 129 verification_results_->AddDexFile(dex_file); in LoadDexFile() 225 for (const DexFile* dex_file : dex_files_) { in VerifyClassStatus() local 226 const std::vector<bool>& verified_classes = deps.GetVerifiedClasses(*dex_file); in VerifyClassStatus() 227 ASSERT_EQ(verified_classes.size(), dex_file->NumClassDefs()); in VerifyClassStatus() 228 for (uint32_t i = 0; i < dex_file->NumClassDefs(); ++i) { in VerifyClassStatus() 229 const dex::ClassDef& class_def = dex_file->GetClassDef(i); in VerifyClassStatus() 230 const char* descriptor = dex_file->GetClassDescriptor(class_def); in VerifyClassStatus() [all …]
|
/art/tools/hiddenapi/ |
D | hiddenapi_test.cc | 118 std::unique_ptr<const DexFile> dex_file(dex_loader.OpenDex( in OpenDex() local 121 if (dex_file.get() == nullptr) { in OpenDex() 124 } else if (!dex_file->IsStandardDexFile()) { in OpenDex() 129 return dex_file; in OpenDex() 166 const dex::ClassDef& FindClass(const char* desc, const DexFile& dex_file) { in FindClass() argument 167 const dex::TypeId* type_id = dex_file.FindTypeId(desc); in FindClass() 169 const dex::ClassDef* found = dex_file.FindClassDef(dex_file.GetIndexForTypeId(*type_id)); in FindClass() 177 const DexFile& dex_file) { in GetFieldHiddenFlags() argument 178 ClassAccessor accessor(dex_file, class_def, /* parse hiddenapi flags */ true); in GetFieldHiddenFlags() 186 const dex::FieldId& fid = dex_file.GetFieldId(field.GetIndex()); in GetFieldHiddenFlags() [all …]
|
/art/libdexfile/external/ |
D | dex_file_supp_test.cc | 35 std::unique_ptr<DexFile> dex_file; in TEST() local 36 EXPECT_TRUE(DexFile::Create(kDexData, size, &size, "", &dex_file).Ok()); in TEST() 38 EXPECT_NE(dex_file, nullptr); in TEST() 43 std::unique_ptr<DexFile> dex_file; in TEST() local 44 DexFile::Error error = DexFile::Create(kDexData, size, &size, "", &dex_file); in TEST() 49 EXPECT_EQ(dex_file, nullptr); in TEST() 54 std::unique_ptr<DexFile> dex_file; in TEST() local 55 DexFile::Error error = DexFile::Create(kDexData, size, &size, "", &dex_file); in TEST() 60 EXPECT_EQ(dex_file, nullptr); in TEST() 65 std::unique_ptr<DexFile> dex_file; in GetTestDexData() local [all …]
|
/art/runtime/ |
D | sdk_checker.cc | 55 for (const std::unique_ptr<const DexFile>& dex_file : sdk_dex_files_) { in ShouldDenyAccess() local 57 dex_file->FindTypeId(art_method->GetDeclaringClassDescriptor()); in ShouldDenyAccess() 61 const dex::StringId* name_id = dex_file->FindStringId(art_method->GetName()); in ShouldDenyAccess() 68 if (!dex_file->CreateTypeList( in ShouldDenyAccess() 74 const dex::ProtoId* proto_id = dex_file->FindProtoId(return_type_idx, param_type_idxs); in ShouldDenyAccess() 80 dex_file->FindMethodId(*declaring_type_id, *name_id, *proto_id); in ShouldDenyAccess() 101 for (const std::unique_ptr<const DexFile>& dex_file : sdk_dex_files_) { in ShouldDenyAccess() local 104 const dex::TypeId* declaring_type_id = dex_file->FindTypeId( in ShouldDenyAccess() 109 const dex::StringId* name_id = dex_file->FindStringId(art_field->GetName()); in ShouldDenyAccess() 113 const dex::TypeId* type_id = dex_file->FindTypeId(art_field->GetTypeDescriptor()); in ShouldDenyAccess() [all …]
|
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 | 172 const DexFile* dex_file = GetDexFile(); in GetDeclaringClassDescriptor() local 173 return dex_file->GetMethodDeclaringClassDescriptor(dex_file->GetMethodId(dex_method_idx)); in GetDeclaringClassDescriptor() 183 const DexFile* dex_file = GetDexFile(); in GetShorty() local 184 return dex_file->GetMethodShorty(dex_file->GetMethodId(GetDexMethodIndex()), out_length); in GetShorty() 191 const DexFile* dex_file = GetDexFile(); in GetSignature() local 192 return dex_file->GetMethodSignature(dex_file->GetMethodId(dex_method_idx)); in GetSignature() 201 const DexFile* dex_file = GetDexFile(); in GetName() local 202 return dex_file->GetMethodName(dex_file->GetMethodId(dex_method_idx)); in GetName() 211 const DexFile* dex_file = GetDexFile(); in GetNameView() local 213 const char* name = dex_file->GetMethodName(dex_file->GetMethodId(dex_method_idx), &length); in GetNameView() [all …]
|
/art/dexlayout/ |
D | dex_ir_builder.cc | 145 void CreateStringId(const DexFile& dex_file, uint32_t i); 146 void CreateTypeId(const DexFile& dex_file, uint32_t i); 147 void CreateProtoId(const DexFile& dex_file, uint32_t i); 148 void CreateFieldId(const DexFile& dex_file, uint32_t i); 149 void CreateMethodId(const DexFile& dex_file, uint32_t i); 150 void CreateClassDef(const DexFile& dex_file, uint32_t i); 151 void CreateCallSiteId(const DexFile& dex_file, uint32_t i); 152 void CreateMethodHandleItem(const DexFile& dex_file, uint32_t i); 154 void CreateCallSitesAndMethodHandles(const DexFile& dex_file); 157 EncodedArrayItem* CreateEncodedArrayItem(const DexFile& dex_file, [all …]
|
D | dexlayout_test.cc | 269 for (const std::string& dex_file : GetLibCoreDexFileNames()) { in FullPlainOutputExec() local 271 { dexdump, "-d", "-f", "-h", "-l", "plain", "-o", dexdump_filename, dex_file }; in FullPlainOutputExec() 273 { "-d", "-f", "-h", "-l", "plain", "-o", dexlayout_filename, dex_file }; in FullPlainOutputExec() 297 for (const std::string& dex_file : GetLibCoreDexFileNames()) { in DexFileOutputExec() local 299 { "-w", tmp_dir, "-o", tmp_name, dex_file }; in DexFileOutputExec() 305 { "/usr/bin/unzip", dex_file, "classes.dex", "-d", unzip_dir}; in DexFileOutputExec() 345 for (const std::unique_ptr<const DexFile>& dex_file : dex_files) { in CreateProfile() local 346 for (uint32_t i = 0; i < dex_file->NumMethodIds(); i += 2) { in CreateProfile() 356 pfi.AddMethod(ProfileMethodInfo(MethodReference(dex_file.get(), /*index=*/ i)), in CreateProfile() 361 for (uint32_t i = 0; i < dex_file->NumClassDefs(); i += 1) { in CreateProfile() [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/runtime/verifier/ |
D | verifier_deps.cc | 43 for (const DexFile* dex_file : dex_files) { in VerifierDeps() local 44 DCHECK(GetDexFileDeps(*dex_file) == nullptr); in VerifierDeps() 45 std::unique_ptr<DexFileDeps> deps(new DexFileDeps(dex_file->NumClassDefs())); in VerifierDeps() 46 dex_deps_.emplace(dex_file, std::move(deps)); in VerifierDeps() 66 for (const DexFile* dex_file : dex_files) { in MergeWith() local 67 DexFileDeps* my_deps = GetDexFileDeps(*dex_file); in MergeWith() 68 DexFileDeps& other_deps = *other->GetDexFileDeps(*dex_file); in MergeWith() 82 VerifierDeps::DexFileDeps* VerifierDeps::GetDexFileDeps(const DexFile& dex_file) { in GetDexFileDeps() argument 83 auto it = dex_deps_.find(&dex_file); in GetDexFileDeps() 87 const VerifierDeps::DexFileDeps* VerifierDeps::GetDexFileDeps(const DexFile& dex_file) const { in GetDexFileDeps() [all …]
|
D | verifier_deps.h | 79 void RecordClassVerified(const DexFile& dex_file, const dex::ClassDef& class_def) 84 const DexFile& dex_file, 93 const DexFile& dex_file, 103 const DexFile& dex_file, 123 const std::vector<bool>& GetVerifiedClasses(const DexFile& dex_file) const { in GetVerifiedClasses() argument 124 return GetDexFileDeps(dex_file)->verified_classes_; in GetVerifiedClasses() 128 bool HasRecordedVerifiedStatus(const DexFile& dex_file, const dex::ClassDef& class_def) 135 bool ContainsDexFile(const DexFile& dex_file) const { in ContainsDexFile() argument 136 return GetDexFileDeps(dex_file) != nullptr; in ContainsDexFile() 192 DexFileDeps* GetDexFileDeps(const DexFile& dex_file); [all …]
|
/art/tools/veridex/ |
D | hidden_api.cc | 73 std::string HiddenApi::GetApiMethodName(const DexFile& dex_file, uint32_t method_index) { in GetApiMethodName() argument 75 const dex::MethodId& method_id = dex_file.GetMethodId(method_index); in GetApiMethodName() 76 ss << dex_file.StringByTypeIdx(method_id.class_idx_) in GetApiMethodName() 78 << dex_file.GetMethodName(method_id) in GetApiMethodName() 79 << dex_file.GetMethodSignature(method_id).ToString(); in GetApiMethodName() 83 std::string HiddenApi::GetApiFieldName(const DexFile& dex_file, uint32_t field_index) { in GetApiFieldName() argument 85 const dex::FieldId& field_id = dex_file.GetFieldId(field_index); in GetApiFieldName() 86 ss << dex_file.StringByTypeIdx(field_id.class_idx_) in GetApiFieldName() 88 << dex_file.GetFieldName(field_id) in GetApiFieldName() 90 << dex_file.GetFieldTypeDescriptor(field_id); in GetApiFieldName()
|
/art/test/692-vdex-inmem-loader/ |
D | vdex_inmem_loader.cc | 50 [&](const DexFile* dex_file) { in Java_Main_areClassesVerified() argument 51 dex_files.push_back(dex_file); in Java_Main_areClassesVerified() 60 for (const DexFile* dex_file : dex_files) { in Java_Main_areClassesVerified() local 61 for (uint16_t cdef_idx = 0; cdef_idx < dex_file->NumClassDefs(); ++cdef_idx) { in Java_Main_areClassesVerified() 62 const char* desc = dex_file->GetClassDescriptor(dex_file->GetClassDef(cdef_idx)); in Java_Main_areClassesVerified() 89 [&](const DexFile* dex_file) { in Java_Main_hasVdexFile() argument 90 dex_files.push_back(dex_file); in Java_Main_hasVdexFile() 121 [&](const DexFile* dex_file) { in Java_Main_isBackedByOatFile() argument 122 bool is_backed_by_oat = (dex_file->GetOatDexFile() != nullptr); in Java_Main_isBackedByOatFile() 146 [&](const DexFile* dex_file) { in Java_Main_areClassesPreverified() argument [all …]
|
/art/compiler/debug/ |
D | elf_symtab_writer.h | 60 DCHECK(mi->dex_file != nullptr); in GetDedupedName() 61 return mi->dex_file == first->dex_file && mi->class_def_index == first->class_def_index; in GetDedupedName() 64 return strcmp(mi->dex_file->GetMethodName(mi->dex_method_index), in GetDedupedName() 65 first->dex_file->GetMethodName(first->dex_method_index)) == 0; in GetDedupedName() 73 auto& dex_class_def = first->dex_file->GetClassDef(first->class_def_index); in GetDedupedName() 74 AppendPrettyDescriptor(first->dex_file->GetClassDescriptor(dex_class_def), &*out); in GetDedupedName() 80 *out += first->dex_file->GetMethodName(first->dex_method_index); in GetDedupedName() 142 DCHECK(info.dex_file != nullptr); in WriteDebugSymbols() 143 std::string name = info.dex_file->PrettyMethod(info.dex_method_index, !mini_debug_info); in WriteDebugSymbols() 164 const DexFile* dex_file = it.second; in WriteDebugSymbols() local [all …]
|
/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 …]
|