Home
last modified time | relevance | path

Searched refs:dex_file (Results 1 – 25 of 305) sorted by relevance

12345678910>>...13

/art/libdexfile/dex/
Ddex_file_verifier_test.cc43 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()
74 std::unique_ptr<DexFile> dex_file(GetDexFile(dex_bytes.get(), length)); in VerifyModification() local
75 f(dex_file.get()); in VerifyModification()
76 FixUpChecksum(const_cast<uint8_t*>(dex_file->Begin())); in VerifyModification()
80 bool success = dex::Verify(dex_file.get(), location, kVerifyChecksum, &error_msg); in VerifyModification()
[all …]
Dtest_dex_file_builder_test.cc32 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 …]
Dmethod_reference.h32 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 …]
Ddex_file_reference.h30 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) ^
Dtype_reference.h34 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()
Dcode_item_accessors-inl.h56 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 …]
/art/dex2oat/
Ddex2oat_vdex_test.cc69 const DexFile* dex_file) { in GetVerifierDeps() argument
87 dex_files.push_back(dex_file); in GetVerifierDeps()
98 uint16_t GetClassDefIndex(const std::string& cls, const DexFile& dex_file) { in GetClassDefIndex() argument
99 const dex::TypeId* type_id = dex_file.FindTypeId(cls.c_str()); in GetClassDefIndex()
101 dex::TypeIndex type_idx = dex_file.GetIndexForTypeId(*type_id); in GetClassDefIndex()
102 const dex::ClassDef* class_def = dex_file.FindClassDef(type_idx); in GetClassDefIndex()
104 return dex_file.GetIndexForClassDef(*class_def); in GetClassDefIndex()
109 const DexFile& dex_file) { in HasVerifiedClass() argument
110 uint16_t class_def_idx = GetClassDefIndex(cls, dex_file); in HasVerifiedClass()
111 return deps->GetVerifiedClasses(dex_file)[class_def_idx]; in HasVerifiedClass()
[all …]
Dverifier_deps_test.cc121 for (const DexFile* dex_file : dex_files_) { in LoadDexFile() local
122 class_linker_->RegisterDexFile(*dex_file, loader.Get()); in LoadDexFile()
215 for (const DexFile* dex_file : dex_files_) { in VerifyClassStatus() local
216 const std::vector<bool>& verified_classes = deps.GetVerifiedClasses(*dex_file); in VerifyClassStatus()
217 ASSERT_EQ(verified_classes.size(), dex_file->NumClassDefs()); in VerifyClassStatus()
218 for (uint32_t i = 0; i < dex_file->NumClassDefs(); ++i) { in VerifyClassStatus()
219 const dex::ClassDef& class_def = dex_file->GetClassDef(i); in VerifyClassStatus()
220 const char* descriptor = dex_file->GetClassDescriptor(class_def); in VerifyClassStatus()
225 } else if (&cls->GetDexFile() != dex_file) { in VerifyClassStatus()
236 uint16_t GetClassDefIndex(const std::string& cls, const DexFile& dex_file) { in GetClassDefIndex() argument
[all …]
/art/tools/hiddenapi/
Dhiddenapi_test.cc118 std::unique_ptr<const DexFile> dex_file(dex_loader.Open( in OpenDex() local
120 if (dex_file.get() == nullptr) { in OpenDex()
123 } else if (!dex_file->IsStandardDexFile()) { in OpenDex()
128 return dex_file; in OpenDex()
165 const dex::ClassDef& FindClass(const char* desc, const DexFile& dex_file) { in FindClass() argument
166 const dex::TypeId* type_id = dex_file.FindTypeId(desc); in FindClass()
168 const dex::ClassDef* found = dex_file.FindClassDef(dex_file.GetIndexForTypeId(*type_id)); in FindClass()
176 const DexFile& dex_file) { in GetFieldHiddenFlags() argument
177 ClassAccessor accessor(dex_file, class_def, /* parse hiddenapi flags */ true); in GetFieldHiddenFlags()
185 const dex::FieldId& fid = dex_file.GetFieldId(field.GetIndex()); in GetFieldHiddenFlags()
[all …]
/art/libdexfile/external/
Ddex_file_supp_test.cc35 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/
Dsdk_checker.cc51 for (const std::unique_ptr<const DexFile>& dex_file : sdk_dex_files_) { in ShouldDenyAccess() local
53 dex_file->FindTypeId(art_method->GetDeclaringClassDescriptor()); in ShouldDenyAccess()
57 const dex::StringId* name_id = dex_file->FindStringId(art_method->GetName()); in ShouldDenyAccess()
64 if (!dex_file->CreateTypeList( in ShouldDenyAccess()
68 const dex::ProtoId* proto_id = dex_file->FindProtoId(return_type_idx, param_type_idxs); in ShouldDenyAccess()
74 dex_file->FindMethodId(*declaring_type_id, *name_id, *proto_id); in ShouldDenyAccess()
95 for (const std::unique_ptr<const DexFile>& dex_file : sdk_dex_files_) { in ShouldDenyAccess() local
99 dex_file->FindTypeId(art_field->GetDeclaringClass()->GetDescriptor(&declaring_class)); in ShouldDenyAccess()
103 const dex::StringId* name_id = dex_file->FindStringId(art_field->GetName()); in ShouldDenyAccess()
107 const dex::TypeId* type_id = dex_file->FindTypeId(art_field->GetTypeDescriptor()); in ShouldDenyAccess()
[all …]
Dimtable-inl.h48 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()
/art/dexlayout/
Ddex_ir_builder.cc145 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 …]
Ddexlayout_test.cc271 for (const std::string& dex_file : GetLibCoreDexFileNames()) { in FullPlainOutputExec() local
273 { dexdump, "-d", "-f", "-h", "-l", "plain", "-o", dexdump_filename, dex_file }; in FullPlainOutputExec()
275 { "-d", "-f", "-h", "-l", "plain", "-o", dexlayout_filename, dex_file }; in FullPlainOutputExec()
299 for (const std::string& dex_file : GetLibCoreDexFileNames()) { in DexFileOutputExec() local
301 { "-w", tmp_dir, "-o", tmp_name, dex_file }; in DexFileOutputExec()
307 { "/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/runtime/verifier/
Dverifier_deps.cc43 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()
63 for (const DexFile* dex_file : dex_files) { in MergeWith() local
64 DexFileDeps* my_deps = GetDexFileDeps(*dex_file); in MergeWith()
65 DexFileDeps& other_deps = *other->GetDexFileDeps(*dex_file); in MergeWith()
79 VerifierDeps::DexFileDeps* VerifierDeps::GetDexFileDeps(const DexFile& dex_file) { in GetDexFileDeps() argument
80 auto it = dex_deps_.find(&dex_file); in GetDexFileDeps()
84 const VerifierDeps::DexFileDeps* VerifierDeps::GetDexFileDeps(const DexFile& dex_file) const { in GetDexFileDeps()
[all …]
Dverifier_deps.h79 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,
124 const std::vector<bool>& GetVerifiedClasses(const DexFile& dex_file) const { in GetVerifiedClasses() argument
125 return GetDexFileDeps(dex_file)->verified_classes_; in GetVerifiedClasses()
129 bool HasRecordedVerifiedStatus(const DexFile& dex_file, const dex::ClassDef& class_def)
136 bool ContainsDexFile(const DexFile& dex_file) const { in ContainsDexFile() argument
137 return GetDexFileDeps(dex_file) != nullptr; in ContainsDexFile()
196 DexFileDeps* GetDexFileDeps(const DexFile& dex_file);
[all …]
/art/compiler/utils/
Datomic_dex_ref_map-inl.h34 const DexFile* dex_file) { in NumberOfDexIndices() argument
41 return dex_file->NumMethodIds(); in NumberOfDexIndices()
44 return dex_file->NumClassDefs(); in NumberOfDexIndices()
47 return dex_file->NumTypeIds(); in NumberOfDexIndices()
57 ElementArray* const array = GetArray(ref.dex_file); in Insert()
70 const ElementArray* const array = GetArray(ref.dex_file); in Get()
81 ElementArray* const array = GetArray(ref.dex_file); in Remove()
90 inline void AtomicDexRefMap<DexFileReferenceType, Value>::AddDexFile(const DexFile* dex_file) { in AddDexFile() argument
91 arrays_.Put(dex_file, std::move(ElementArray(NumberOfDexIndices(dex_file)))); in AddDexFile()
97 for (const DexFile* dex_file : dex_files) { in AddDexFiles() local
[all …]
Datomic_dex_ref_map.h55 void AddDexFile(const DexFile* dex_file);
61 bool HaveDexFile(const DexFile* dex_file) const { in HaveDexFile() argument
62 return arrays_.find(dex_file) != arrays_.end(); in HaveDexFile()
76 const ElementArray* GetArray(const DexFile* dex_file) const;
77 ElementArray* GetArray(const DexFile* dex_file);
79 static size_t NumberOfDexIndices(const DexFile* dex_file);
/art/test/692-vdex-inmem-loader/
Dvdex_inmem_loader.cc50 [&](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/tools/veridex/
Dhidden_api.cc82 std::string HiddenApi::GetApiMethodName(const DexFile& dex_file, uint32_t method_index) { in GetApiMethodName() argument
84 const dex::MethodId& method_id = dex_file.GetMethodId(method_index); in GetApiMethodName()
85 ss << dex_file.StringByTypeIdx(method_id.class_idx_) in GetApiMethodName()
87 << dex_file.GetMethodName(method_id) in GetApiMethodName()
88 << dex_file.GetMethodSignature(method_id).ToString(); in GetApiMethodName()
92 std::string HiddenApi::GetApiFieldName(const DexFile& dex_file, uint32_t field_index) { in GetApiFieldName() argument
94 const dex::FieldId& field_id = dex_file.GetFieldId(field_index); in GetApiFieldName()
95 ss << dex_file.StringByTypeIdx(field_id.class_idx_) in GetApiFieldName()
97 << dex_file.GetFieldName(field_id) in GetApiFieldName()
99 << dex_file.GetFieldTypeDescriptor(field_id); in GetApiFieldName()
/art/compiler/debug/
Delf_symtab_writer.h61 DCHECK(mi->dex_file != nullptr); in GetDedupedName()
62 return mi->dex_file == first->dex_file && mi->class_def_index == first->class_def_index; in GetDedupedName()
65 return strcmp(mi->dex_file->GetMethodName(mi->dex_method_index), in GetDedupedName()
66 first->dex_file->GetMethodName(first->dex_method_index)) == 0; in GetDedupedName()
74 auto& dex_class_def = first->dex_file->GetClassDef(first->class_def_index); in GetDedupedName()
75 AppendPrettyDescriptor(first->dex_file->GetClassDescriptor(dex_class_def), &*out); in GetDedupedName()
81 *out += first->dex_file->GetMethodName(first->dex_method_index); in GetDedupedName()
143 DCHECK(info.dex_file != nullptr); in WriteDebugSymbols()
144 std::string name = info.dex_file->PrettyMethod(info.dex_method_index, !mini_debug_info); in WriteDebugSymbols()
165 const DexFile* dex_file = it.second; in WriteDebugSymbols() local
[all …]
/art/runtime/native/
Djava_lang_VMClassLoader.cc136 auto is_base_dex = [](const DexFile* dex_file) { in VMClassLoader_getBootClassPathEntries() argument
137 return !DexFileLoader::IsMultiDexLocation(dex_file->GetLocation().c_str()); in VMClassLoader_getBootClassPathEntries()
142 auto dchecked_is_base_dex = [&](const DexFile* dex_file) { in VMClassLoader_getBootClassPathEntries() argument
147 if (is_base_dex(dex_file)) { in VMClassLoader_getBootClassPathEntries()
148 CHECK_EQ(DexFileLoader::GetBaseLocation(dex_file->GetLocation().c_str()), in VMClassLoader_getBootClassPathEntries()
149 dex_file->GetLocation()); in VMClassLoader_getBootClassPathEntries()
152 CHECK_EQ(DexFileLoader::GetBaseLocation(dex_file->GetLocation().c_str()), in VMClassLoader_getBootClassPathEntries()
155 last_dex_file = dex_file; in VMClassLoader_getBootClassPathEntries()
157 return is_base_dex(dex_file); in VMClassLoader_getBootClassPathEntries()
159 auto get_location = [](const DexFile* dex_file) { return dex_file->GetLocation(); }; in VMClassLoader_getBootClassPathEntries() argument
/art/tools/dexanalyze/
Ddexanalyze_experiments.cc81 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/runtime/dex/
Ddex_file_annotations.cc120 const DexFile& dex_file, in ClassData() argument
124 dex_file_(dex_file), in ClassData()
151 static const AnnotationSetItem* FindAnnotationSetForField(const DexFile& dex_file, in FindAnnotationSetForField() argument
155 const AnnotationsDirectoryItem* annotations_dir = dex_file.GetAnnotationsDirectory(class_def); in FindAnnotationSetForField()
159 const FieldAnnotationsItem* field_annotations = dex_file.GetFieldAnnotations(annotations_dir); in FindAnnotationSetForField()
166 return dex_file.GetFieldAnnotationSetItem(field_annotations[i]); in FindAnnotationSetForField()
183 const AnnotationItem* SearchAnnotationSet(const DexFile& dex_file, in SearchAnnotationSet() argument
190 const AnnotationItem* annotation_item = dex_file.GetAnnotationItem(annotation_set, i); in SearchAnnotationSet()
197 if (strcmp(descriptor, dex_file.StringByTypeIdx(dex::TypeIndex(type_index))) == 0) { in SearchAnnotationSet()
209 bool SkipAnnotationValue(const DexFile& dex_file, const uint8_t** annotation_ptr) in SkipAnnotationValue() argument
[all …]
/art/dex2oat/driver/
Dcompiler_driver.cc378 const DexFile& dex_file, in CompileMethodHarness() argument
384 MethodReference method_ref(&dex_file, method_idx); in CompileMethodHarness()
394 dex_file, in CompileMethodHarness()
400 LOG(WARNING) << "Compilation of " << dex_file.PrettyMethod(method_idx) in CompileMethodHarness()
411 LOG(FATAL) << "Unexpected exception compiling: " << dex_file.PrettyMethod(method_idx) << "\n" in CompileMethodHarness()
428 compiler_options.GetProfileCompilationInfo()->FindDexFile(*method_ref.dex_file) == in ShouldCompileBasedOnProfile()
459 const DexFile& dex_file, in CompileMethodQuick() argument
471 const DexFile& dex_file, in CompileMethodQuick()
485 dex_file, dex_file.GetClassDef(class_def_idx), method_idx); in CompileMethodQuick()
488 access_flags, method_idx, dex_file, dex_cache); in CompileMethodQuick()
[all …]

12345678910>>...13