Lines Matching refs:data

41 static void WriteEncodedValueHeader(dex::u1 type, int arg, Section& data) {  in WriteEncodedValueHeader()  argument
45 data.Push<dex::u1>(header); in WriteEncodedValueHeader()
50 static void WriteIntValue(dex::u1 type, T value, Section& data) { in WriteIntValue() argument
70 WriteEncodedValueHeader(type, size - 1, data); in WriteIntValue()
71 data.Push(buff, size); in WriteIntValue()
76 static void WriteFloatValue(dex::u1 type, T value, Section& data) { in WriteFloatValue() argument
93 WriteEncodedValueHeader(type, size - 1, data); in WriteFloatValue()
94 data.Push(buff, size); in WriteFloatValue()
97 static void WriteEncodedArray(const ir::EncodedArray* ir_array, Section& data);
98 static void WriteAnnotation(const ir::Annotation* ir_annotation, Section& data);
101 static void WriteEncodedValue(const ir::EncodedValue* ir_value, Section& data) { in WriteEncodedValue() argument
102 SLICER_EXTRA(auto offset = data.size()); in WriteEncodedValue()
107 WriteIntValue(type, ir_value->u.byte_value, data); in WriteEncodedValue()
111 WriteIntValue(type, ir_value->u.short_value, data); in WriteEncodedValue()
115 WriteIntValue(type, ir_value->u.char_value, data); in WriteEncodedValue()
119 WriteIntValue(type, ir_value->u.int_value, data); in WriteEncodedValue()
123 WriteIntValue(type, ir_value->u.long_value, data); in WriteEncodedValue()
127 WriteFloatValue(type, ir_value->u.float_value, data); in WriteEncodedValue()
131 WriteFloatValue(type, ir_value->u.double_value, data); in WriteEncodedValue()
135 WriteIntValue<dex::u4>(type, ir_value->u.string_value->index, data); in WriteEncodedValue()
139 WriteIntValue<dex::u4>(type, ir_value->u.type_value->index, data); in WriteEncodedValue()
143 WriteIntValue<dex::u4>(type, ir_value->u.field_value->index, data); in WriteEncodedValue()
147 WriteIntValue<dex::u4>(type, ir_value->u.method_value->index, data); in WriteEncodedValue()
151 WriteIntValue<dex::u4>(type, ir_value->u.enum_value->index, data); in WriteEncodedValue()
155 WriteEncodedValueHeader(type, 0, data); in WriteEncodedValue()
156 WriteEncodedArray(ir_value->u.array_value, data); in WriteEncodedValue()
160 WriteEncodedValueHeader(type, 0, data); in WriteEncodedValue()
161 WriteAnnotation(ir_value->u.annotation_value, data); in WriteEncodedValue()
165 WriteEncodedValueHeader(type, 0, data); in WriteEncodedValue()
170 WriteEncodedValueHeader(type, arg, data); in WriteEncodedValue()
190 auto ptr = data.ptr<const dex::u1>(offset); in WriteEncodedValue()
191 auto size = data.size() - offset; in WriteEncodedValue()
200 static void WriteAnnotation(const ir::Annotation* ir_annotation, Section& data) { in WriteAnnotation() argument
201 data.PushULeb128(ir_annotation->type->index); in WriteAnnotation()
202 data.PushULeb128(ir_annotation->elements.size()); in WriteAnnotation()
204 data.PushULeb128(irAnnotationElement->name->index); in WriteAnnotation()
205 WriteEncodedValue(irAnnotationElement->value, data); in WriteAnnotation()
210 static void WriteEncodedArray(const ir::EncodedArray* ir_array, Section& data) { in WriteEncodedArray() argument
212 data.PushULeb128(values.size()); in WriteEncodedArray()
214 WriteEncodedValue(irEncodedValue, data); in WriteEncodedArray()
232 ::memcpy(image + offset, section.data(), size); in CopySection()
372 section.Push(ir_string->data); in CreateStringDataSection()
636 auto& data = dex_->type_lists; in WriteTypeList() local
637 dex::u4 offset = data.AddItem(4); in WriteTypeList()
638 data.Push<dex::u4>(types.size()); in WriteTypeList()
640 data.Push<dex::u2>(ir_type->index); in WriteTypeList()
642 return data.AbsoluteOffset(offset); in WriteTypeList()
649 auto& data = dex_->ann_items; in WriteAnnotationItem() local
650 dex::u4 offset = data.AddItem(); in WriteAnnotationItem()
651 data.Push<dex::u1>(ir_annotation->visibility); in WriteAnnotationItem()
652 WriteAnnotation(ir_annotation, data); in WriteAnnotationItem()
653 return data.AbsoluteOffset(offset); in WriteAnnotationItem()
662 auto& data = dex_->ann_sets; in WriteAnnotationSet() local
663 dex::u4 offset = data.AddItem(4); in WriteAnnotationSet()
664 data.Push<dex::u4>(annotations.size()); in WriteAnnotationSet()
666 data.Push<dex::u4>(FilePointer(ir_annotation)); in WriteAnnotationSet()
668 return data.AbsoluteOffset(offset); in WriteAnnotationSet()
678 auto& data = dex_->ann_set_ref_lists; in WriteAnnotationSetRefList() local
679 dex::u4 offset = data.AddItem(4); in WriteAnnotationSetRefList()
680 data.Push<dex::u4>(annotations.size()); in WriteAnnotationSetRefList()
682 data.Push<dex::u4>(FilePointer(ir_annotation_set)); in WriteAnnotationSetRefList()
684 return data.AbsoluteOffset(offset); in WriteAnnotationSetRefList()
737 auto& data = dex_->ann_directories; in WriteClassAnnotations() local
738 offset = data.AddItem(4); in WriteClassAnnotations()
739 data.Push(dex_annotations); in WriteClassAnnotations()
740 data.Push(dex_field_annotations); in WriteClassAnnotations()
741 data.Push(dex_method_annotations); in WriteClassAnnotations()
742 data.Push(dex_param_annotations); in WriteClassAnnotations()
743 offset = data.AbsoluteOffset(offset); in WriteClassAnnotations()
752 auto& data = dex_->debug_info; in WriteDebugInfo() local
753 dex::u4 offset = data.AddItem(); in WriteDebugInfo()
756 data.PushULeb128(ir_debug_info->line_start); in WriteDebugInfo()
757 data.PushULeb128(ir_debug_info->param_names.size()); in WriteDebugInfo()
759 data.PushULeb128(OptIndex(ir_string) + 1); in WriteDebugInfo()
763 const dex::u1* src = ir_debug_info->data.ptr<dex::u1>(); in WriteDebugInfo()
766 data.Push<dex::u1>(opcode); in WriteDebugInfo()
771 data.PushULeb128(dex::ReadULeb128(&src)); in WriteDebugInfo()
776 data.PushSLeb128(dex::ReadSLeb128(&src)); in WriteDebugInfo()
781 data.PushULeb128(dex::ReadULeb128(&src)); in WriteDebugInfo()
784 data.PushULeb128(MapStringIndex(name_index) + 1); in WriteDebugInfo()
787 data.PushULeb128(MapTypeIndex(type_index) + 1); in WriteDebugInfo()
792 data.PushULeb128(dex::ReadULeb128(&src)); in WriteDebugInfo()
795 data.PushULeb128(MapStringIndex(name_index) + 1); in WriteDebugInfo()
798 data.PushULeb128(MapTypeIndex(type_index) + 1); in WriteDebugInfo()
801 data.PushULeb128(MapStringIndex(sig_index) + 1); in WriteDebugInfo()
807 data.PushULeb128(dex::ReadULeb128(&src)); in WriteDebugInfo()
812 data.PushULeb128(MapStringIndex(name_index) + 1); in WriteDebugInfo()
816 data.Push<dex::u1>(dex::DBG_END_SEQUENCE); in WriteDebugInfo()
818 return data.AbsoluteOffset(offset); in WriteDebugInfo()
941 auto& data = dex_->code; in WriteTryBlocks() local
942 dex::u4 tries_offset = data.size(); in WriteTryBlocks()
943 data.Push(irCode->try_blocks); in WriteTryBlocks()
944 data.Push(handlers_list); in WriteTryBlocks()
948 data.ptr<dex::TryBlock>(tries_offset), irCode->try_blocks.size())) { in WriteTryBlocks()
967 auto& data = dex_->code; in WriteCode() local
968 dex::u4 offset = data.AddItem(4); in WriteCode()
969 data.Push(&dex_code, offsetof(dex::Code, insns)); in WriteCode()
972 data.Align(4); in WriteCode()
975 return data.AbsoluteOffset(offset); in WriteCode()
989 auto& data = dex_->class_data; in WriteEncodedField() local
990 data.PushULeb128(index_delta); in WriteEncodedField()
991 data.PushULeb128(ir_encoded_field->access_flags); in WriteEncodedField()
1007 auto& data = dex_->class_data; in WriteEncodedMethod() local
1008 data.PushULeb128(index_delta); in WriteEncodedMethod()
1009 data.PushULeb128(ir_encoded_method->access_flags); in WriteEncodedMethod()
1010 data.PushULeb128(code_offset); in WriteEncodedMethod()
1020 auto& data = dex_->class_data; in WriteClassData() local
1021 dex::u4 offset = data.AddItem(); in WriteClassData()
1023 data.PushULeb128(ir_class->static_fields.size()); in WriteClassData()
1024 data.PushULeb128(ir_class->instance_fields.size()); in WriteClassData()
1025 data.PushULeb128(ir_class->direct_methods.size()); in WriteClassData()
1026 data.PushULeb128(ir_class->virtual_methods.size()); in WriteClassData()
1048 return data.AbsoluteOffset(offset); in WriteClassData()
1059 auto& data = dex_->encoded_arrays; in WriteClassStaticValues() local
1060 offset = data.AddItem(); in WriteClassStaticValues()
1061 WriteEncodedArray(ir_class->static_init, data); in WriteClassStaticValues()
1062 offset = data.AbsoluteOffset(offset); in WriteClassStaticValues()