Lines Matching refs:dex_file
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,
159 AnnotationItem* CreateAnnotationItem(const DexFile& dex_file,
161 AnnotationSetItem* CreateAnnotationSetItem(const DexFile& dex_file,
163 AnnotationsDirectoryItem* CreateAnnotationsDirectoryItem(const DexFile& dex_file,
165 CodeItem* DedupeOrCreateCodeItem(const DexFile& dex_file,
169 ClassData* CreateClassData(const DexFile& dex_file, const dex::ClassDef& class_def);
171 void AddAnnotationsFromMapListSection(const DexFile& dex_file,
174 void AddHiddenapiClassDataFromMapListSection(const DexFile& dex_file, uint32_t offset);
176 void CheckAndSetRemainingOffsets(const DexFile& dex_file, const Options& options);
194 EncodedValue* ReadEncodedValue(const DexFile& dex_file, const uint8_t** data);
195 EncodedValue* ReadEncodedValue(const DexFile& dex_file,
199 void ReadEncodedValue(const DexFile& dex_file,
205 MethodItem GenerateMethodItem(const DexFile& dex_file, const ClassAccessor::Method& method);
208 const DexFile& dex_file,
249 Header* DexIrBuilder(const DexFile& dex_file, in DexIrBuilder() argument
252 const DexFile::Header& disk_header = dex_file.GetHeader(); in DexIrBuilder()
263 dex_file.SupportsDefaultMethods(), in DexIrBuilder()
264 dex_file.NumStringIds(), in DexIrBuilder()
265 dex_file.NumTypeIds(), in DexIrBuilder()
266 dex_file.NumProtoIds(), in DexIrBuilder()
267 dex_file.NumFieldIds(), in DexIrBuilder()
268 dex_file.NumMethodIds(), in DexIrBuilder()
269 dex_file.NumClassDefs()); in DexIrBuilder()
274 for (uint32_t i = 0; i < dex_file.NumStringIds(); ++i) { in DexIrBuilder()
275 builder_maps.CreateStringId(dex_file, i); in DexIrBuilder()
279 for (uint32_t i = 0; i < dex_file.NumTypeIds(); ++i) { in DexIrBuilder()
280 builder_maps.CreateTypeId(dex_file, i); in DexIrBuilder()
284 for (uint32_t i = 0; i < dex_file.NumProtoIds(); ++i) { in DexIrBuilder()
285 builder_maps.CreateProtoId(dex_file, i); in DexIrBuilder()
289 for (uint32_t i = 0; i < dex_file.NumFieldIds(); ++i) { in DexIrBuilder()
290 builder_maps.CreateFieldId(dex_file, i); in DexIrBuilder()
294 for (uint32_t i = 0; i < dex_file.NumMethodIds(); ++i) { in DexIrBuilder()
295 builder_maps.CreateMethodId(dex_file, i); in DexIrBuilder()
299 for (uint32_t i = 0; i < dex_file.NumClassDefs(); ++i) { in DexIrBuilder()
303 const dex::ClassDef& class_def = dex_file.GetClassDef(i); in DexIrBuilder()
304 const char* descriptor = dex_file.GetClassDescriptor(class_def); in DexIrBuilder()
309 builder_maps.CreateClassDef(dex_file, i); in DexIrBuilder()
314 builder_maps.CreateCallSitesAndMethodHandles(dex_file); in DexIrBuilder()
315 builder_maps.CheckAndSetRemainingOffsets(dex_file, options); in DexIrBuilder()
322 dex_file.DataBegin() + dex_file.GetHeader().link_off_, in DexIrBuilder()
323 dex_file.DataBegin() + dex_file.GetHeader().link_off_ + dex_file.GetHeader().link_size_)); in DexIrBuilder()
331 void BuilderMaps::CheckAndSetRemainingOffsets(const DexFile& dex_file, const Options& options) { in CheckAndSetRemainingOffsets() argument
332 const DexFile::Header& disk_header = dex_file.GetHeader(); in CheckAndSetRemainingOffsets()
334 const dex::MapList* map = dex_file.GetMapList(); in CheckAndSetRemainingOffsets()
405 AddAnnotationsFromMapListSection(dex_file, item->offset_, item->size_); in CheckAndSetRemainingOffsets()
415 AddHiddenapiClassDataFromMapListSection(dex_file, item->offset_); in CheckAndSetRemainingOffsets()
423 void BuilderMaps::CreateStringId(const DexFile& dex_file, uint32_t i) { in CreateStringId() argument
424 const dex::StringId& disk_string_id = dex_file.GetStringId(dex::StringIndex(i)); in CreateStringId()
429 dex_file.GetStringData(disk_string_id)); in CreateStringId()
436 void BuilderMaps::CreateTypeId(const DexFile& dex_file, uint32_t i) { in CreateTypeId() argument
437 const dex::TypeId& disk_type_id = dex_file.GetTypeId(dex::TypeIndex(i)); in CreateTypeId()
444 void BuilderMaps::CreateProtoId(const DexFile& dex_file, uint32_t i) { in CreateProtoId() argument
445 const dex::ProtoId& disk_proto_id = dex_file.GetProtoId(dex::ProtoIndex(i)); in CreateProtoId()
446 const dex::TypeList* type_list = dex_file.GetProtoParameters(disk_proto_id); in CreateProtoId()
457 void BuilderMaps::CreateFieldId(const DexFile& dex_file, uint32_t i) { in CreateFieldId() argument
458 const dex::FieldId& disk_field_id = dex_file.GetFieldId(i); in CreateFieldId()
467 void BuilderMaps::CreateMethodId(const DexFile& dex_file, uint32_t i) { in CreateMethodId() argument
468 const dex::MethodId& disk_method_id = dex_file.GetMethodId(i); in CreateMethodId()
477 void BuilderMaps::CreateClassDef(const DexFile& dex_file, uint32_t i) { in CreateClassDef() argument
478 const dex::ClassDef& disk_class_def = dex_file.GetClassDef(i); in CreateClassDef()
483 const dex::TypeList* type_list = dex_file.GetInterfacesList(disk_class_def); in CreateClassDef()
491 dex_file.GetAnnotationsDirectory(disk_class_def); in CreateClassDef()
494 dex_file, disk_annotations_directory_item, disk_class_def.annotations_off_); in CreateClassDef()
497 const uint8_t* static_data = dex_file.GetEncodedStaticFieldValuesArray(disk_class_def); in CreateClassDef()
499 CreateEncodedArrayItem(dex_file, static_data, disk_class_def.static_values_off_); in CreateClassDef()
500 ClassData* class_data = CreateClassData(dex_file, disk_class_def); in CreateClassDef()
514 void BuilderMaps::CreateCallSiteId(const DexFile& dex_file, uint32_t i) { in CreateCallSiteId() argument
515 const dex::CallSiteIdItem& disk_call_site_id = dex_file.GetCallSiteId(i); in CreateCallSiteId()
516 const uint8_t* disk_call_item_ptr = dex_file.DataBegin() + disk_call_site_id.data_off_; in CreateCallSiteId()
518 CreateEncodedArrayItem(dex_file, disk_call_item_ptr, disk_call_site_id.data_off_); in CreateCallSiteId()
526 void BuilderMaps::CreateMethodHandleItem(const DexFile& dex_file, uint32_t i) { in CreateMethodHandleItem() argument
527 const dex::MethodHandleItem& disk_method_handle = dex_file.GetMethodHandle(i); in CreateMethodHandleItem()
552 void BuilderMaps::CreateCallSitesAndMethodHandles(const DexFile& dex_file) { in CreateCallSitesAndMethodHandles() argument
554 const dex::MapList* map = dex_file.GetMapList(); in CreateCallSitesAndMethodHandles()
569 for (uint32_t i = 0; i < dex_file.NumMethodHandles(); i++) { in CreateCallSitesAndMethodHandles()
570 CreateMethodHandleItem(dex_file, i); in CreateCallSitesAndMethodHandles()
573 for (uint32_t i = 0; i < dex_file.NumCallSiteIds(); i++) { in CreateCallSitesAndMethodHandles()
574 CreateCallSiteId(dex_file, i); in CreateCallSitesAndMethodHandles()
598 EncodedArrayItem* BuilderMaps::CreateEncodedArrayItem(const DexFile& dex_file, in CreateEncodedArrayItem() argument
609 values->push_back(std::unique_ptr<EncodedValue>(ReadEncodedValue(dex_file, &static_data))); in CreateEncodedArrayItem()
620 void BuilderMaps::AddAnnotationsFromMapListSection(const DexFile& dex_file, in AddAnnotationsFromMapListSection() argument
626 const dex::AnnotationItem* annotation = dex_file.GetAnnotationItemAtOffset(current_offset); in AddAnnotationsFromMapListSection()
627 AnnotationItem* annotation_item = CreateAnnotationItem(dex_file, annotation); in AddAnnotationsFromMapListSection()
633 void BuilderMaps::AddHiddenapiClassDataFromMapListSection(const DexFile& dex_file, in AddHiddenapiClassDataFromMapListSection() argument
636 dex_file.GetHiddenapiClassDataAtOffset(offset); in AddHiddenapiClassDataFromMapListSection()
637 DCHECK(hiddenapi_class_data == dex_file.GetHiddenapiClassData()); in AddHiddenapiClassDataFromMapListSection()
671 AnnotationItem* BuilderMaps::CreateAnnotationItem(const DexFile& dex_file, in CreateAnnotationItem() argument
674 const uint32_t offset = start_data - dex_file.DataBegin(); in CreateAnnotationItem()
680 ReadEncodedValue(dex_file, &annotation_data, DexFile::kDexAnnotationAnnotation, 0)); in CreateAnnotationItem()
693 AnnotationSetItem* BuilderMaps::CreateAnnotationSetItem(const DexFile& dex_file, in CreateAnnotationSetItem() argument
703 dex_file.GetAnnotationItem(disk_annotations_item, i); in CreateAnnotationSetItem()
707 AnnotationItem* annotation_item = CreateAnnotationItem(dex_file, annotation); in CreateAnnotationSetItem()
719 AnnotationsDirectoryItem* BuilderMaps::CreateAnnotationsDirectoryItem(const DexFile& dex_file, in CreateAnnotationsDirectoryItem() argument
727 dex_file.GetClassAnnotationSet(disk_annotations_item); in CreateAnnotationsDirectoryItem()
731 class_annotation = CreateAnnotationSetItem(dex_file, class_set_item, item_offset); in CreateAnnotationsDirectoryItem()
734 dex_file.GetFieldAnnotations(disk_annotations_item); in CreateAnnotationsDirectoryItem()
741 dex_file.GetFieldAnnotationSetItem(fields[i]); in CreateAnnotationsDirectoryItem()
744 CreateAnnotationSetItem(dex_file, field_set_item, annotation_set_offset); in CreateAnnotationsDirectoryItem()
750 dex_file.GetMethodAnnotations(disk_annotations_item); in CreateAnnotationsDirectoryItem()
757 dex_file.GetMethodAnnotationSetItem(methods[i]); in CreateAnnotationsDirectoryItem()
760 CreateAnnotationSetItem(dex_file, method_set_item, annotation_set_offset); in CreateAnnotationsDirectoryItem()
766 dex_file.GetParameterAnnotations(disk_annotations_item); in CreateAnnotationsDirectoryItem()
773 dex_file.GetParameterAnnotationSetRefList(¶meters[i]); in CreateAnnotationsDirectoryItem()
775 GenerateParameterAnnotation(dex_file, method_id, list, parameters[i].annotations_off_))); in CreateAnnotationsDirectoryItem()
788 CodeItem* BuilderMaps::DedupeOrCreateCodeItem(const DexFile& dex_file, in DedupeOrCreateCodeItem() argument
795 CodeItemDebugInfoAccessor accessor(dex_file, disk_code_item, dex_method_index); in DedupeOrCreateCodeItem()
805 const uint8_t* debug_info_stream = dex_file.GetDebugInfoStream(debug_info_offset); in DedupeOrCreateCodeItem()
903 uint32_t size = dex_file.GetCodeItemSize(*disk_code_item); in DedupeOrCreateCodeItem()
943 ClassData* BuilderMaps::CreateClassData(const DexFile& dex_file, in CreateClassData() argument
950 ClassAccessor accessor(dex_file, class_def); in CreateClassData()
968 direct_methods->push_back(GenerateMethodItem(dex_file, *it)); in CreateClassData()
979 virtual_methods->push_back(GenerateMethodItem(dex_file, *it)); in CreateClassData()
988 class_data->SetSize(last_data_ptr - dex_file.GetClassData(class_def)); in CreateClassData()
1096 EncodedValue* BuilderMaps::ReadEncodedValue(const DexFile& dex_file, const uint8_t** data) { in ReadEncodedValue() argument
1100 ReadEncodedValue(dex_file, data, type, encoded_value >> 5, item); in ReadEncodedValue()
1104 EncodedValue* BuilderMaps::ReadEncodedValue(const DexFile& dex_file, in ReadEncodedValue() argument
1109 ReadEncodedValue(dex_file, data, type, length, item); in ReadEncodedValue()
1113 void BuilderMaps::ReadEncodedValue(const DexFile& dex_file, in ReadEncodedValue() argument
1187 const uint32_t offset = *data - dex_file.DataBegin(); in ReadEncodedValue()
1191 values->push_back(std::unique_ptr<EncodedValue>(ReadEncodedValue(dex_file, data))); in ReadEncodedValue()
1209 ReadEncodedValue(dex_file, data))); in ReadEncodedValue()
1224 MethodItem BuilderMaps::GenerateMethodItem(const DexFile& dex_file, in GenerateMethodItem() argument
1231 CodeItem* code_item = DedupeOrCreateCodeItem(dex_file, in GenerateMethodItem()
1239 const DexFile& dex_file, in GenerateParameterAnnotation() argument
1248 dex_file.GetSetRefItemItem(&annotation_set_ref_list->list_[i]); in GenerateParameterAnnotation()
1250 annotations->push_back(CreateAnnotationSetItem(dex_file, annotation_set_item, set_offset)); in GenerateParameterAnnotation()