Home
last modified time | relevance | path

Searched refs:dex (Results 1 – 25 of 331) sorted by relevance

12345678910>>...14

/art/libdexfile/dex/
Ddex_file.h240 const dex::StringId& GetStringId(dex::StringIndex idx) const { in GetStringId()
245 dex::StringIndex GetIndexForStringId(const dex::StringId& string_id) const { in GetIndexForStringId()
248 return dex::StringIndex(&string_id - string_ids_); in GetIndexForStringId()
251 int32_t GetStringLength(const dex::StringId& string_id) const;
256 const char* GetStringDataAndUtf16Length(const dex::StringId& string_id,
259 const char* GetStringData(const dex::StringId& string_id) const;
262 const char* StringDataAndUtf16LengthByIdx(dex::StringIndex idx, uint32_t* utf16_length) const;
264 const char* StringDataByIdx(dex::StringIndex idx) const;
265 std::string_view StringViewByIdx(dex::StringIndex idx) const;
268 const dex::StringId* FindStringId(const char* string) const;
[all …]
Dart_dex_file_loader_test.cc56 std::unique_ptr<const DexFile> dex(OpenTestDexFile("Nested")); in TEST_F() local
57 ASSERT_TRUE(dex.get() != nullptr); in TEST_F()
102 const dex::ClassDef& c0 = raw->GetClassDef(0); in TEST_F()
105 const dex::ClassDef& c1 = raw->GetClassDef(1); in TEST_F()
108 const dex::ClassDef& c2 = raw->GetClassDef(2); in TEST_F()
117 const dex::ClassDef& class_def = raw->GetClassDef(0); in TEST_F()
128 const dex::MethodId& method_id = raw->GetMethodId(cur_method->GetIndex()); in TEST_F()
202 const dex::MethodId& method_id = raw->GetMethodId(cur_method->GetIndex()); in TEST_F()
227 const dex::StringId* str_id = raw->FindStringId(str); in TEST_F()
235 const char* type_str = java_lang_dex_file_->StringByTypeIdx(dex::TypeIndex(i)); in TEST_F()
[all …]
Ddex_file_verifier.h82 bool CheckAndGetHandlerOffsets(const dex::CodeItem* code_item,
87 dex::TypeIndex class_type_index,
92 dex::TypeIndex class_type_index,
98 bool CheckStaticFieldTypes(const dex::ClassDef* class_def);
112 dex::TypeIndex* class_type_index,
113 const dex::ClassDef** class_def);
121 dex::TypeIndex* class_type_index,
122 const dex::ClassDef** class_def);
143 dex::TypeIndex FindFirstClassDataDefiner(const uint8_t* ptr, bool* success);
144 dex::TypeIndex FindFirstAnnotationsDirectoryDefiner(const uint8_t* ptr, bool* success);
[all …]
Ddex_file-inl.h41 inline int32_t DexFile::GetStringLength(const dex::StringId& string_id) const { in GetStringLength()
46 inline const char* DexFile::GetStringDataAndUtf16Length(const dex::StringId& string_id, in GetStringDataAndUtf16Length()
54 inline const char* DexFile::GetStringData(const dex::StringId& string_id) const { in GetStringData()
59 inline const char* DexFile::StringDataAndUtf16LengthByIdx(dex::StringIndex idx, in StringDataAndUtf16LengthByIdx()
65 const dex::StringId& string_id = GetStringId(idx); in StringDataAndUtf16LengthByIdx()
69 inline const char* DexFile::StringDataByIdx(dex::StringIndex idx) const { in StringDataByIdx()
74 inline std::string_view DexFile::StringViewByIdx(dex::StringIndex idx) const { in StringViewByIdx()
80 inline const char* DexFile::StringByTypeIdx(dex::TypeIndex idx, uint32_t* unicode_length) const { in StringByTypeIdx()
84 const dex::TypeId& type_id = GetTypeId(idx); in StringByTypeIdx()
88 inline const char* DexFile::StringByTypeIdx(dex::TypeIndex idx) const { in StringByTypeIdx()
[all …]
Ddex_file_verifier.cc104 const char* DexFileVerifier::CheckLoadStringByIdx(dex::StringIndex idx, const char* error_string) { in CheckLoadStringByIdx()
111 const char* DexFileVerifier::CheckLoadStringByTypeIdx(dex::TypeIndex type_idx, in CheckLoadStringByTypeIdx()
119 const dex::FieldId* DexFileVerifier::CheckLoadFieldId(uint32_t idx, const char* error_string) { in CheckLoadFieldId()
126 const dex::MethodId* DexFileVerifier::CheckLoadMethodId(uint32_t idx, const char* err_string) { in CheckLoadMethodId()
133 const dex::ProtoId* DexFileVerifier::CheckLoadProtoId(dex::ProtoIndex idx, in CheckLoadProtoId()
157 const dex::MethodId* (var) = CheckLoadMethodId(idx, error_string); \
164 const dex::FieldId* (var) = CheckLoadFieldId(idx, fmt); \
388 const dex::MapList* map = reinterpret_cast<const dex::MapList*>(begin_ + header_->map_off_); in CheckMap()
390 if (!CheckListSize(map, 1, sizeof(dex::MapList), "maplist content")) { in CheckMap()
394 const dex::MapItem* item = map->list_; in CheckMap()
[all …]
Ddex_file_structs.h32 namespace dex {
61 dex::StringIndex descriptor_idx_; // index into string_ids
69 dex::TypeIndex class_idx_; // index into type_ids_ array for defining class
70 dex::TypeIndex type_idx_; // index into type_ids_ array for field type
71 dex::StringIndex name_idx_; // index into string_ids_ array for field name
79 dex::StringIndex shorty_idx_; // index into string_ids array for shorty descriptor
80 dex::TypeIndex return_type_idx_; // index into type_ids array for return type
90 dex::TypeIndex class_idx_; // index into type_ids_ array for defining class
91 dex::ProtoIndex proto_idx_; // index into proto_ids_ array for method prototype
92 dex::StringIndex name_idx_; // index into string_ids_ array for method name
[all …]
Dsignature.h30 namespace dex {
55 Signature(const DexFile* dex, const dex::ProtoId& proto) : dex_file_(dex), proto_id_(&proto) { in Signature() argument
63 const dex::ProtoId* const proto_id_ = nullptr;
Ddex_file.cc45 using dex::CallSiteIdItem;
46 using dex::ClassDef;
47 using dex::FieldId;
48 using dex::MapList;
49 using dex::MapItem;
50 using dex::MethodHandleItem;
51 using dex::MethodId;
52 using dex::ProtoId;
53 using dex::StringId;
54 using dex::TryItem;
[all …]
Dstring_reference_test.cc38 ASSERT_STREQ("String1", dex_file1->GetStringData(dex_file1->GetStringId(dex::StringIndex(0)))); in TEST()
39 StringReference sr1(dex_file1.get(), dex::StringIndex(0)); in TEST()
45 ASSERT_STREQ("String2", dex_file2->GetStringData(dex_file2->GetStringId(dex::StringIndex(0)))); in TEST()
46 StringReference sr2(dex_file2.get(), dex::StringIndex(0)); in TEST()
85 dex_file1->GetStringData(dex_file1->GetStringId(dex::StringIndex(index)))); in TEST()
96 dex_file2->GetStringData(dex_file2->GetStringId(dex::StringIndex(index)))); in TEST()
102 StringReference sr1(dex_file1.get(), dex::StringIndex(index1)); in TEST()
103 StringReference sr2(dex_file2.get(), dex::StringIndex(index2)); in TEST()
Dcode_item_accessors.h28 namespace dex {
43 const dex::CodeItem* code_item);
81 ALWAYS_INLINE void Init(const DexFile& dex_file, const dex::CodeItem* code_item);
98 ALWAYS_INLINE CodeItemDataAccessor(const DexFile& dex_file, const dex::CodeItem* code_item);
116 IterationRange<const dex::TryItem*> TryItems() const;
120 const dex::TryItem* FindTryItem(uint32_t try_dex_pc) const;
127 ALWAYS_INLINE void Init(const DexFile& dex_file, const dex::CodeItem* code_item);
148 const dex::CodeItem* code_item, in CodeItemDebugInfoAccessor()
154 const dex::CodeItem* code_item,
/art/test/etc/
Ddefault-build268 local dex_output=${name}.dex
287 echo unzip -p $d8_output classes.dex \> $dex_output
289 unzip -p $d8_output classes.dex > $dex_output
325 mv ./d8_merge_out/classes.dex "$dst_file";
349 if [ -e classes.dex ]; then
350 zip $TEST_NAME.jar classes.dex
368 mv classes-ex.dex classes.dex # rename it so it shows up as "classes.dex" in the zip file.
369 zip ${TEST_NAME}-ex.jar classes.dex
410 make_dexmerge classes.dex jasmin_classes.dex
420 ${SMALI} -JXmx512m assemble ${SMALI_ARGS} --output smali_classes.dex `find smali -name '*.smali'`
[all …]
/art/libdexfile/
DAndroid.bp22 "dex/art_dex_file_loader.cc",
23 "dex/compact_dex_file.cc",
24 "dex/compact_offset_table.cc",
25 "dex/descriptors_names.cc",
26 "dex/dex_file.cc",
27 "dex/dex_file_exception_helpers.cc",
28 "dex/dex_file_layout.cc",
29 "dex/dex_file_loader.cc",
30 "dex/dex_file_tracking_registrar.cc",
31 "dex/dex_file_verifier.cc",
[all …]
/art/test/071-dexfile-get-static-size/
Dbuild25 cp res/test1.dex test-jar/classes.dex
26 cp res/test2.dex test-jar/classes2.dex
27 zip -j res/test-jar.jar test-jar/classes.dex
28 zip -j res/multi-jar.jar test-jar/classes.dex test-jar/classes2.dex
Dinfo.txt3 test1.dex and test2.dex are arbitrary valid dex files.
/art/tools/hiddenapi/
Dhiddenapi_test.cc167 const dex::ClassDef& FindClass(const char* desc, const DexFile& dex_file) { in FindClass()
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()
177 const dex::ClassDef& class_def, in GetFieldHiddenFlags()
187 const dex::FieldId& fid = dex_file.GetFieldId(field.GetIndex()); in GetFieldHiddenFlags()
204 const dex::ClassDef& class_def, in GetMethodHiddenFlags()
214 const dex::MethodId& mid = dex_file.GetMethodId(method.GetIndex()); in GetMethodHiddenFlags()
269 ScratchFile dex, flags_csv; in TEST_F() local
274 auto dex_file = RunHiddenapiEncode(flags_csv, {}, dex); in TEST_F()
280 ScratchFile dex, flags_csv; in TEST_F() local
[all …]
/art/test/dexdump/
Drun-all-tests76 for dex in *.dex; do
78 new_output=${dex%%.*}.${suffix}
79 ${SUFFIX_COMMAND_MAP[${suffix}]} ${dex} > ${new_output}
81 echo "Failed running ${SUFFIX_COMMAND_MAP[${suffix}]} ${dex} > ${new_output}" 2>&1
92 for dex in *.dex; do
93 echo ${dex}
95 expected_output=${dex%%.*}.${suffix}
97 cmd="${SUFFIX_COMMAND_MAP[${suffix}]} ${dex}"
/art/test/663-odd-dex-size4/
Dinfo.txt1 Test for an aligned dex file followed by a dex file with an odd size.
3 The code in classes.dex is:
8 The code in classes2.dex is:
16 The generated dex file was then manually edited to:
17 1) Add 1 to the size value in the dex header.
19 3) Change the checksum in the dex header.
/art/test/663-odd-dex-size3/
Dinfo.txt1 Test for a dex file with an odd size followed by an aligned dex file.
3 The code in classes.dex is:
11 The generated dex file was then manually edited to:
12 1) Add 1 to the size value in the dex header.
14 3) Change the checksum in the dex header.
16 The code in classes2.dex is:
/art/test/370-dex-v37/
Dbuild24 if test -f classes.dex && head -c 7 classes.dex | grep -q 035; then
26 printf '037' | dd status=none conv=notrunc of=classes.dex bs=1 seek=4 count=3
28 zip $TEST_NAME.jar classes.dex
/art/runtime/verifier/
Dverifier_deps.h72 void RecordClassVerified(const DexFile& dex_file, const dex::ClassDef& class_def)
77 const dex::ClassDef& class_def,
83 static void MaybeRecordClassRedefinition(const DexFile& dex_file, const dex::ClassDef& class_def)
89 dex::TypeIndex type_idx,
157 using ClassResolutionBase = std::tuple<dex::TypeIndex, uint16_t>;
161 ClassResolution(dex::TypeIndex type_idx, uint16_t access_flags) in ClassResolution()
165 dex::TypeIndex GetDexTypeIndex() const { return std::get<0>(*this); } in GetDexTypeIndex()
169 using FieldResolutionBase = std::tuple<uint32_t, uint16_t, dex::StringIndex>;
173 FieldResolution(uint32_t field_idx, uint16_t access_flags, dex::StringIndex declaring_class_idx) in FieldResolution()
179 dex::StringIndex GetDeclaringClassIndex() const { return std::get<2>(*this); } in GetDeclaringClassIndex()
[all …]
Dmethod_verifier_test.cc57 void VerifyDexFile(const DexFile& dex) in VerifyDexFile() argument
60 for (size_t i = 0; i < dex.NumClassDefs(); i++) { in VerifyDexFile()
61 const dex::ClassDef& class_def = dex.GetClassDef(i); in VerifyDexFile()
62 const char* descriptor = dex.GetClassDescriptor(class_def); in VerifyDexFile()
/art/runtime/
Ddex_reference_collection.h48 void AddReference(const DexFile* dex, IndexType index) { in AddReference() argument
49 GetOrInsertVector(dex)->push_back(index); in AddReference()
70 ALWAYS_INLINE IndexVector* GetOrInsertVector(const DexFile* dex) { in GetOrInsertVector() argument
73 if (UNLIKELY(current_dex_file_ != dex)) { in GetOrInsertVector()
76 current_vector_ = &map_.emplace(dex, IndexVector(vector_allocator_)).first->second; in GetOrInsertVector()
77 current_dex_file_ = dex; in GetOrInsertVector()
/art/test/693-vdex-inmem-loader-evict/src/
DMain.java108 byte[] dex = DEX_BYTES_BASE.clone(); in createDex()
111 System.arraycopy(DEX_BYTES_CHECKSUMS[index], 0, dex, DEX_BYTES_CHECKSUM_OFFSET, in createDex()
115 if (dex[DEX_BYTES_CLASS_ID_OFFSET1 + 0] != 0x30 || in createDex()
116 dex[DEX_BYTES_CLASS_ID_OFFSET1 + 1] != 0x31 || in createDex()
117 dex[DEX_BYTES_CLASS_ID_OFFSET2 + 0] != 0x30 || in createDex()
118 dex[DEX_BYTES_CLASS_ID_OFFSET2 + 1] != 0x31) { in createDex()
125 dex[DEX_BYTES_CLASS_ID_OFFSET1 + 0] = str_id1; in createDex()
126 dex[DEX_BYTES_CLASS_ID_OFFSET1 + 1] = str_id2; in createDex()
127 dex[DEX_BYTES_CLASS_ID_OFFSET2 + 0] = str_id1; in createDex()
128 dex[DEX_BYTES_CLASS_ID_OFFSET2 + 1] = str_id2; in createDex()
[all …]
/art/test/983-source-transform-verify/
Dsource_transform_art.cc46 std::unique_ptr<const DexFile> dex(dex_file_loader.Open(class_data, in VerifyClassData() local
54 CHECK(dex.get() != nullptr) << "Failed to verify dex: " << error; in VerifyClassData()
56 for (ClassAccessor accessor : dex->GetClasses()) { in VerifyClassData()
63 LOG(FATAL) << "Unexpected instruction found in " << dex->PrettyMethod(method.GetIndex()) in VerifyClassData()
65 << inst.DumpString(dex.get()) << std::endl; in VerifyClassData()
/art/dex2oat/driver/
Dcompiler_driver_test.cc96 const dex::ClassDef& class_def = dex_file.GetClassDef(i); in MakeDexFileExecutable()
125 const DexFile& dex = *java_lang_dex_file_; in TEST_F() local
126 ObjPtr<mirror::DexCache> dex_cache = class_linker_->FindDexCache(soa.Self(), dex); in TEST_F()
127 EXPECT_EQ(dex.NumStringIds(), dex_cache->NumStrings()); in TEST_F()
129 const ObjPtr<mirror::String> string = dex_cache->GetResolvedString(dex::StringIndex(i)); in TEST_F()
132 EXPECT_EQ(dex.NumTypeIds(), dex_cache->NumResolvedTypes()); in TEST_F()
134 const ObjPtr<mirror::Class> type = dex_cache->GetResolvedType(dex::TypeIndex(i)); in TEST_F()
136 << "type_idx=" << i << " " << dex.GetTypeDescriptor(dex.GetTypeId(dex::TypeIndex(i))); in TEST_F()
139 || dex.NumMethodIds() == dex_cache->NumResolvedMethods()); in TEST_F()
146 << " " << dex.GetMethodDeclaringClassDescriptor(dex.GetMethodId(i)) in TEST_F()
[all …]

12345678910>>...14