Lines Matching refs:dex
71 const dex::u1* ptr = in DissasembleTryBlocks()
72 ir_code->catch_handlers.ptr<dex::u1>() + tryBlock.handler_off; in DissasembleTryBlocks()
73 int catchCount = dex::ReadSLeb128(&ptr); in DissasembleTryBlocks()
79 dex::u4 type_index = dex::ReadULeb128(&ptr); in DissasembleTryBlocks()
84 dex::u4 address = dex::ReadULeb128(&ptr); in DissasembleTryBlocks()
96 dex::u4 address = dex::ReadULeb128(&ptr); in DissasembleTryBlocks()
115 dex::u4 address = 0; in DissasembleDebugInfo()
129 auto annotation = Alloc<DbgInfoAnnotation>(dex::DBG_SET_FILE); in DissasembleDebugInfo()
132 source_file, source_file ? source_file->orig_index : dex::kNoIndex)); in DissasembleDebugInfo()
138 auto annotation = Alloc<DbgInfoAnnotation>(dex::DBG_ADVANCE_LINE); in DissasembleDebugInfo()
145 const dex::u1* ptr = ir_debug_info->data.ptr<dex::u1>(); in DissasembleDebugInfo()
146 dex::u1 opcode = 0; in DissasembleDebugInfo()
147 while ((opcode = *ptr++) != dex::DBG_END_SEQUENCE) { in DissasembleDebugInfo()
151 case dex::DBG_ADVANCE_PC: in DissasembleDebugInfo()
153 address += dex::ReadULeb128(&ptr); in DissasembleDebugInfo()
156 case dex::DBG_ADVANCE_LINE: in DissasembleDebugInfo()
158 line += dex::ReadSLeb128(&ptr); in DissasembleDebugInfo()
162 case dex::DBG_START_LOCAL: { in DissasembleDebugInfo()
166 annotation->operands.push_back(Alloc<VReg>(dex::ReadULeb128(&ptr))); in DissasembleDebugInfo()
169 dex::u4 name_index = dex::ReadULeb128(&ptr) - 1; in DissasembleDebugInfo()
173 dex::u4 type_index = dex::ReadULeb128(&ptr) - 1; in DissasembleDebugInfo()
177 case dex::DBG_START_LOCAL_EXTENDED: { in DissasembleDebugInfo()
181 annotation->operands.push_back(Alloc<VReg>(dex::ReadULeb128(&ptr))); in DissasembleDebugInfo()
184 dex::u4 name_index = dex::ReadULeb128(&ptr) - 1; in DissasembleDebugInfo()
188 dex::u4 type_index = dex::ReadULeb128(&ptr) - 1; in DissasembleDebugInfo()
192 dex::u4 sig_index = dex::ReadULeb128(&ptr) - 1; in DissasembleDebugInfo()
196 case dex::DBG_END_LOCAL: in DissasembleDebugInfo()
197 case dex::DBG_RESTART_LOCAL: in DissasembleDebugInfo()
200 annotation->operands.push_back(Alloc<VReg>(dex::ReadULeb128(&ptr))); in DissasembleDebugInfo()
203 case dex::DBG_SET_PROLOGUE_END: in DissasembleDebugInfo()
207 case dex::DBG_SET_EPILOGUE_BEGIN: in DissasembleDebugInfo()
211 case dex::DBG_SET_FILE: { in DissasembleDebugInfo()
215 dex::u4 name_index = dex::ReadULeb128(&ptr) - 1; in DissasembleDebugInfo()
216 source_file = (name_index == dex::kNoIndex) in DissasembleDebugInfo()
223 int adjusted_opcode = opcode - dex::DBG_FIRST_SPECIAL; in DissasembleDebugInfo()
224 line += dex::DBG_LINE_BASE + (adjusted_opcode % dex::DBG_LINE_RANGE); in DissasembleDebugInfo()
225 address += (adjusted_opcode / dex::DBG_LINE_RANGE); in DissasembleDebugInfo()
227 annotation = Alloc<DbgInfoAnnotation>(dex::DBG_ADVANCE_LINE); in DissasembleDebugInfo()
240 const dex::u2* begin = ir_code->instructions.begin(); in DissasembleBytecode()
241 const dex::u2* end = ir_code->instructions.end(); in DissasembleBytecode()
242 const dex::u2* ptr = begin; in DissasembleBytecode()
245 auto isize = dex::GetWidthFromBytecode(ptr); in DissasembleBytecode()
248 dex::u4 offset = ptr - begin; in DissasembleBytecode()
252 case dex::kPackedSwitchSignature: in DissasembleBytecode()
256 case dex::kSparseSwitchSignature: in DissasembleBytecode()
260 case dex::kArrayDataSignature: in DissasembleBytecode()
277 const dex::u2* begin = ir_method->code->instructions.begin(); in FixupSwitches()
358 PackedSwitchPayload* CodeIr::DecodePackedSwitch(const dex::u2* /*ptr*/, in DecodePackedSwitch()
359 dex::u4 offset) { in DecodePackedSwitch()
370 void CodeIr::FixupPackedSwitch(PackedSwitchPayload* instr, dex::u4 base_offset, in FixupPackedSwitch()
371 const dex::u2* ptr) { in FixupPackedSwitch()
374 auto dex_packed_switch = reinterpret_cast<const dex::PackedSwitchPayload*>(ptr); in FixupPackedSwitch()
375 SLICER_CHECK(dex_packed_switch->ident == dex::kPackedSwitchSignature); in FixupPackedSwitch()
378 for (dex::u2 i = 0; i < dex_packed_switch->size; ++i) { in FixupPackedSwitch()
384 SparseSwitchPayload* CodeIr::DecodeSparseSwitch(const dex::u2* /*ptr*/, in DecodeSparseSwitch()
385 dex::u4 offset) { in DecodeSparseSwitch()
396 void CodeIr::FixupSparseSwitch(SparseSwitchPayload* instr, dex::u4 base_offset, in FixupSparseSwitch()
397 const dex::u2* ptr) { in FixupSparseSwitch()
400 auto dex_sparse_switch = reinterpret_cast<const dex::SparseSwitchPayload*>(ptr); in FixupSparseSwitch()
401 SLICER_CHECK(dex_sparse_switch->ident == dex::kSparseSwitchSignature); in FixupSparseSwitch()
406 for (dex::u2 i = 0; i < size; ++i) { in FixupSparseSwitch()
414 ArrayData* CodeIr::DecodeArrayData(const dex::u2* ptr, dex::u4 offset) { in DecodeArrayData()
415 auto dex_array_data = reinterpret_cast<const dex::ArrayData*>(ptr); in DecodeArrayData()
416 SLICER_CHECK(dex_array_data->ident == dex::kArrayDataSignature); in DecodeArrayData()
420 instr->data = slicer::MemView(ptr, dex::GetWidthFromBytecode(ptr) * 2); in DecodeArrayData()
424 Operand* CodeIr::GetRegA(const dex::Instruction& dex_instr) { in GetRegA()
425 auto flags = dex::GetFlagsFromOpcode(dex_instr.opcode); in GetRegA()
426 if ((flags & dex::kInstrWideRegA) != 0) { in GetRegA()
433 Operand* CodeIr::GetRegB(const dex::Instruction& dex_instr) { in GetRegB()
434 auto flags = dex::GetFlagsFromOpcode(dex_instr.opcode); in GetRegB()
435 if ((flags & dex::kInstrWideRegB) != 0) { in GetRegB()
442 Operand* CodeIr::GetRegC(const dex::Instruction& dex_instr) { in GetRegC()
443 auto flags = dex::GetFlagsFromOpcode(dex_instr.opcode); in GetRegC()
444 if ((flags & dex::kInstrWideRegC) != 0) { in GetRegC()
451 Bytecode* CodeIr::DecodeBytecode(const dex::u2* ptr, dex::u4 offset) { in DecodeBytecode()
452 auto dex_instr = dex::DecodeInstruction(ptr); in DecodeBytecode()
457 auto index_type = dex::GetIndexTypeFromOpcode(dex_instr.opcode); in DecodeBytecode()
459 switch (dex::GetFormatFromOpcode(dex_instr.opcode)) { in DecodeBytecode()
460 case dex::kFmt10x: // op in DecodeBytecode()
463 case dex::kFmt12x: // op vA, vB in DecodeBytecode()
464 case dex::kFmt22x: // op vAA, vBBBB in DecodeBytecode()
465 case dex::kFmt32x: // op vAAAA, vBBBB in DecodeBytecode()
470 case dex::kFmt11n: // op vA, #+B in DecodeBytecode()
471 case dex::kFmt21s: // op vAA, #+BBBB in DecodeBytecode()
472 case dex::kFmt31i: // op vAA, #+BBBBBBBB in DecodeBytecode()
477 case dex::kFmt11x: // op vAA in DecodeBytecode()
481 case dex::kFmt10t: // op +AA in DecodeBytecode()
482 case dex::kFmt20t: // op +AAAA in DecodeBytecode()
483 case dex::kFmt30t: // op +AAAAAAAA in DecodeBytecode()
485 auto label = GetLabel(offset + dex::s4(dex_instr.vA)); in DecodeBytecode()
489 case dex::kFmt21t: // op vAA, +BBBB in DecodeBytecode()
490 case dex::kFmt31t: // op vAA, +BBBBBBBB in DecodeBytecode()
492 dex::u4 targetOffset = offset + dex::s4(dex_instr.vB); in DecodeBytecode()
497 if (dex_instr.opcode == dex::OP_PACKED_SWITCH) { in DecodeBytecode()
499 dex::u4& base_offset = packed_switches_[targetOffset].base_offset; in DecodeBytecode()
502 } else if (dex_instr.opcode == dex::OP_SPARSE_SWITCH) { in DecodeBytecode()
504 dex::u4& base_offset = sparse_switches_[targetOffset].base_offset; in DecodeBytecode()
507 } else if (dex_instr.opcode == dex::OP_FILL_ARRAY_DATA) { in DecodeBytecode()
512 case dex::kFmt23x: // op vAA, vBB, vCC in DecodeBytecode()
518 case dex::kFmt22t: // op vA, vB, +CCCC in DecodeBytecode()
522 auto label = GetLabel(offset + dex::s4(dex_instr.vC)); in DecodeBytecode()
526 case dex::kFmt22b: // op vAA, vBB, #+CC in DecodeBytecode()
527 case dex::kFmt22s: // op vA, vB, #+CCCC in DecodeBytecode()
533 case dex::kFmt22c: // op vA, vB, thing@CCCC in DecodeBytecode()
539 case dex::kFmt21c: // op vAA, thing@BBBB in DecodeBytecode()
540 case dex::kFmt31c: // op vAA, string@BBBBBBBB in DecodeBytecode()
545 case dex::kFmt35c: // op {vC,vD,vE,vF,vG}, thing@BBBB in DecodeBytecode()
549 for (dex::u4 i = 0; i < dex_instr.vA; ++i) { in DecodeBytecode()
556 case dex::kFmt3rc: // op {vCCCC .. v(CCCC+AA-1)}, thing@BBBB in DecodeBytecode()
563 case dex::kFmt21h: // op vAA, #+BBBB0000[00000000] in DecodeBytecode()
565 case dex::OP_CONST_HIGH16: in DecodeBytecode()
570 case dex::OP_CONST_WIDE_HIGH16: in DecodeBytecode()
572 instr->operands.push_back(Alloc<Const64>(dex::u8(dex_instr.vB) << 48)); in DecodeBytecode()
580 case dex::kFmt51l: // op vAA, #+BBBBBBBBBBBBBBBB in DecodeBytecode()
594 IndexedOperand* CodeIr::GetIndexedOperand(dex::InstructionIndexType index_type, in GetIndexedOperand()
595 dex::u4 index) { in GetIndexedOperand()
596 SLICER_CHECK(index != dex::kNoIndex); in GetIndexedOperand()
598 case dex::kIndexStringRef: in GetIndexedOperand()
601 case dex::kIndexTypeRef: in GetIndexedOperand()
604 case dex::kIndexFieldRef: in GetIndexedOperand()
607 case dex::kIndexMethodRef: in GetIndexedOperand()
616 Type* CodeIr::GetType(dex::u4 index) { in GetType()
617 auto ir_type = (index == dex::kNoIndex) ? nullptr : dex_ir->types_map[index]; in GetType()
622 String* CodeIr::GetString(dex::u4 index) { in GetString()
623 auto ir_string = (index == dex::kNoIndex) ? nullptr : dex_ir->strings_map[index]; in GetString()
628 Label* CodeIr::GetLabel(dex::u4 offset) { in GetLabel()