Home
last modified time | relevance | path

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

12

/tools/dexter/slicer/
Dbytecode_encoder.cc26 static dex::u2 Pack_Z_8(dex::u4 a) { in Pack_Z_8()
27 dex::u2 fa = (a & 0xff); in Pack_Z_8()
33 static dex::u2 Pack_8_8(dex::u4 a, dex::u4 b) { in Pack_8_8()
34 dex::u2 fa = (a & 0xff); in Pack_8_8()
36 dex::u2 fb = (b & 0xff); in Pack_8_8()
42 static dex::u2 Pack_4_4_8(dex::u4 a, dex::u4 b, dex::u4 c) { in Pack_4_4_8()
43 dex::u2 fa = (a & 0xf); in Pack_4_4_8()
45 dex::u2 fb = (b & 0xf); in Pack_4_4_8()
47 dex::u2 fc = (c & 0xff); in Pack_4_4_8()
53 static dex::u2 Pack_4_4_4_4(dex::u4 a, dex::u4 b, dex::u4 c, dex::u4 d) { in Pack_4_4_4_4()
[all …]
Dreader.cc27 namespace dex { namespace
29 Reader::Reader(const dex::u1* image, size_t size) : image_(image), size_(size) { in Reader()
31 header_ = ptr<dex::Header>(0); in Reader()
36 dex_ir_->magic = slicer::MemView(header_, sizeof(dex::Header::magic)); in Reader()
39 slicer::ArrayView<const dex::ClassDef> Reader::ClassDefs() const { in ClassDefs()
40 return section<dex::ClassDef>(header_->class_defs_off, in ClassDefs()
44 slicer::ArrayView<const dex::StringId> Reader::StringIds() const { in StringIds()
45 return section<dex::StringId>(header_->string_ids_off, in StringIds()
49 slicer::ArrayView<const dex::TypeId> Reader::TypeIds() const { in TypeIds()
50 return section<dex::TypeId>(header_->type_ids_off, in TypeIds()
[all …]
Dwriter.cc32 namespace dex { namespace
36 static dex::u4 OptIndex(const T* ir_node) { in OptIndex()
37 return ir_node != nullptr ? ir_node->index : dex::kNoIndex; in OptIndex()
41 static void WriteEncodedValueHeader(dex::u1 type, int arg, Section& data) { in WriteEncodedValueHeader()
42 assert((type & ~dex::kEncodedValueTypeMask) == 0); in WriteEncodedValueHeader()
44 dex::u1 header = dex::u1(type | (arg << dex::kEncodedValueArgShift)); in WriteEncodedValueHeader()
45 data.Push<dex::u1>(header); in WriteEncodedValueHeader()
50 static void WriteIntValue(dex::u1 type, T value, Section& data) { in WriteIntValue()
51 dex::u1 buff[sizeof(T)] = {}; in WriteIntValue()
52 dex::u1* dst = buff; in WriteIntValue()
[all …]
Dcode_ir.cc71 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()
[all …]
Dinstrumentation.cc35 dex::u4 src_reg, in BoxValue()
36 dex::u4 dst_reg) { in BoxValue()
83 boxing_invoke->opcode = dex::OP_INVOKE_STATIC_RANGE; in BoxValue()
89 move_result->opcode = dex::OP_MOVE_RESULT_OBJECT; in BoxValue()
119 if ((ir_method->access_flags & dex::kAccStatic) == 0) { in Apply()
152 hook_invoke->opcode = dex::OP_INVOKE_STATIC_RANGE; in Apply()
161 void GenerateShiftParamsCode(lir::CodeIr* code_ir, lir::Instruction* position, dex::u4 shift) { in GenerateShiftParamsCode()
167 if ((ir_method->access_flags & dex::kAccStatic) == 0) { in GenerateShiftParamsCode()
175 const dex::u4 regs = ir_method->code->registers; in GenerateShiftParamsCode()
176 const dex::u4 ins_count = ir_method->code->ins_count; in GenerateShiftParamsCode()
[all …]
Ddebuginfo_encoder.cc35 dbginfo_.Push<dex::u1>(dex::DBG_ADVANCE_PC); in Visit()
42 case dex::DBG_ADVANCE_LINE: { in Visit()
57 int adj_opcode = delta - dex::DBG_LINE_BASE; in Visit()
59 if (adj_opcode < 0 || adj_opcode >= dex::DBG_LINE_RANGE) { in Visit()
60 dbginfo_.Push<dex::u1>(dex::DBG_ADVANCE_LINE); in Visit()
62 adj_opcode = -dex::DBG_LINE_BASE; in Visit()
64 assert(adj_opcode >= 0 && dex::DBG_FIRST_SPECIAL + adj_opcode < 256); in Visit()
65 dex::u1 special_opcode = dex::DBG_FIRST_SPECIAL + adj_opcode; in Visit()
66 dbginfo_.Push<dex::u1>(special_opcode); in Visit()
71 case dex::DBG_START_LOCAL: { in Visit()
[all …]
Dcontrol_flow_graph.cc56 const auto flags = dex::GetFlagsFromOpcode(bytecode->opcode); in Visit()
59 dex::kBranch | in Visit()
60 dex::kSwitch | in Visit()
61 dex::kThrow | in Visit()
62 dex::kReturn; in Visit()
66 dex::kBranch | in Visit()
67 dex::kSwitch | in Visit()
68 dex::kReturn; in Visit()
69 terminate_block = bytecode->opcode == dex::OP_THROW || (flags & exit_instr_flags) != 0; in Visit()
Ddex_ir.cc46 return dex::Utf8Cmp(string_key, string->c_str()) == 0; in Compare()
79 return dex::DescriptorToDecl(descriptor->c_str()); in Decl()
129 void DexFile::TopSortClassIndex(Class* irClass, dex::u4* nextIndex) { in TopSortClassIndex()
130 if (irClass->index == dex::u4(-1)) { in TopSortClassIndex()
152 irClass->index = dex::u4(-1); in SortClassIndexes()
155 dex::u4 nextIndex = 0; in SortClassIndexes()
201 return dex::Utf8Cmp(a->c_str(), b->c_str()) < 0; in Normalize()
Dtryblocks_encoder.cc26 const dex::u4 begin_offset = try_end->try_begin->offset; in Visit()
27 const dex::u4 end_offset = try_end->offset; in Visit()
32 dex::TryBlock try_block = {}; in Visit()
39 dex::s4 catch_count = try_end->handlers.size(); in Visit()
106 auto tries_ptr = tries_.ptr<const dex::TryBlock>(0); in Encode()
107 ir_code->try_blocks = slicer::ArrayView<const dex::TryBlock>(tries_ptr, tries_count); in Encode()
Ddex_ir_builder.cc68 dex::u4 len = strlen(cstr); in GetAsciiString()
137 ss << dex::DescriptorToShorty(return_type->descriptor->c_str()); in CreateShorty()
140 ss << dex::DescriptorToShorty(param_type->descriptor->c_str()); in CreateShorty()
/tools/dexter/slicer/export/slicer/
Dwriter.h29 namespace dex {
35 explicit Section(dex::u2 mapEntryType) : map_entry_type_(mapEntryType) {} in Section()
41 void SetOffset(dex::u4 offset) { in SetOffset()
46 dex::u4 SectionOffset() const { in SectionOffset()
51 dex::u4 AbsoluteOffset(dex::u4 itemOffset) const { in AbsoluteOffset()
58 dex::u4 AddItem(dex::u4 alignment = 1) {
64 dex::u4 ItemsCount() const { return count_; } in ItemsCount()
66 dex::u2 MapEntryType() const { return map_entry_type_; } in MapEntryType()
69 dex::u4 offset_ = 0;
70 dex::u4 count_ = 0;
[all …]
Dreader.h28 namespace dex {
39 Reader(const dex::u1* image, size_t size);
48 const dex::Header* Header() const { return header_; } in Header()
49 const char* GetStringMUTF8(dex::u4 index) const;
50 slicer::ArrayView<const dex::ClassDef> ClassDefs() const;
51 slicer::ArrayView<const dex::StringId> StringIds() const;
52 slicer::ArrayView<const dex::TypeId> TypeIds() const;
53 slicer::ArrayView<const dex::FieldId> FieldIds() const;
54 slicer::ArrayView<const dex::MethodId> MethodIds() const;
55 slicer::ArrayView<const dex::ProtoId> ProtoIds() const;
[all …]
Dcode_ir.h49 constexpr dex::u4 kInvalidOffset = dex::u4(-1);
129 dex::s4 s4_value;
130 dex::u4 u4_value;
134 explicit Const32(dex::u4 value) { u.u4_value = value; } in Const32()
141 dex::s8 s8_value;
142 dex::u8 u8_value;
146 explicit Const64(dex::u8 value) { u.u8_value = value; } in Const64()
152 dex::u4 reg;
154 explicit VReg(dex::u4 reg) : reg(reg) {} in VReg()
160 dex::u4 base_reg;
[all …]
Ddex_ir.h121 dex::u4 index;
125 dex::u4 orig_index;
131 dex::u1 type;
166 const dex::u1* strData = data.ptr<dex::u1>(); in c_str()
167 dex::ReadULeb128(&strData); in c_str()
212 dex::u4 access_flags;
218 dex::u4 line_start;
229 dex::u2 registers;
230 dex::u2 ins_count;
231 dex::u2 outs_count;
[all …]
Dbuffer.h130 size_t PushULeb128(dex::u4 value) { in PushULeb128()
131 dex::u1 tmp[4]; in PushULeb128()
132 dex::u1* end = dex::WriteULeb128(tmp, value); in PushULeb128()
137 size_t PushSLeb128(dex::s4 value) { in PushSLeb128()
138 dex::u1 tmp[4]; in PushSLeb128()
139 dex::u1* end = dex::WriteSLeb128(tmp, value); in PushSLeb128()
155 const dex::u1* data() const { in data()
165 buff_ = static_cast<dex::u1*>(::realloc(buff_, capacity_)); in Expand()
172 dex::u1* buff_ = nullptr;
Dbytecode_encoder.h54 void FixupPackedSwitch(dex::u4 base_offset, dex::u4 payload_offset);
55 void FixupSparseSwitch(dex::u4 base_offset, dex::u4 payload_offset);
61 dex::u4 offset; // instruction to be fixed up
65 LabelFixup(dex::u4 offset, Label* label, bool short_fixup) : in LabelFixup()
74 dex::u4 offset_ = 0;
77 dex::u4 outs_count_ = 0;
81 std::map<dex::u4, const PackedSwitchPayload*> packed_switches_;
82 std::map<dex::u4, const SparseSwitchPayload*> sparse_switches_;
Dinstrumentation.h130 virtual dex::Opcode GetNewOpcode(dex::Opcode opcode) = 0;
142 virtual dex::Opcode GetNewOpcode(dex::Opcode opcode) override;
154 virtual dex::Opcode GetNewOpcode(dex::Opcode opcode) override;
167 const std::set<dex::u4>& ScratchRegs() const { in ScratchRegs()
175 void Allocate(lir::CodeIr* code_ir, dex::u4 first_reg, int count);
181 std::set<dex::u4> scratch_regs_;
Dindex_map.h29 dex::u4 AllocateIndex() { in AllocateIndex()
38 void MarkUsedIndex(dex::u4 index) { in MarkUsedIndex()
48 dex::u4 alloc_pos_ = 0;
Ddebuginfo_encoder.h46 dex::u4 line_start_ = 0;
47 dex::u4 last_line_ = 0;
48 dex::u4 last_address_ = 0;
/tools/dexter/dexter/
Ddexter.cc127 static void PrintDexMap(const dex::Reader& reader) { in PrintDexMap()
130 const dex::MapList& dexMap = *reader.DexMapList(); in PrintDexMap()
131 for (dex::u4 i = 0; i < dexMap.size; ++i) { in PrintDexMap()
132 const dex::MapItem& section = dexMap.list[i]; in PrintDexMap()
135 case dex::kHeaderItem: in PrintDexMap()
138 case dex::kStringIdItem: in PrintDexMap()
141 case dex::kTypeIdItem: in PrintDexMap()
144 case dex::kProtoIdItem: in PrintDexMap()
147 case dex::kFieldIdItem: in PrintDexMap()
150 case dex::kMethodIdItem: in PrintDexMap()
[all …]
Dexperimental.cc73 dex::Opcode new_call_opcode = dex::OP_NOP; in StressWrapInvoke()
75 case dex::OP_INVOKE_VIRTUAL: in StressWrapInvoke()
76 new_call_opcode = dex::OP_INVOKE_STATIC; in StressWrapInvoke()
78 case dex::OP_INVOKE_VIRTUAL_RANGE: in StressWrapInvoke()
79 new_call_opcode = dex::OP_INVOKE_STATIC_RANGE; in StressWrapInvoke()
85 assert(new_call_opcode != dex::OP_NOP); in StressWrapInvoke()
150 if ((ir_method->access_flags & dex::kAccStatic) == 0) { in StressEntryHook()
174 call->opcode = dex::OP_INVOKE_STATIC_RANGE; in StressEntryHook()
233 dex::Opcode move_result_opcode = dex::OP_NOP; in StressExitHook()
234 dex::u4 reg = 0; in StressExitHook()
[all …]
Ddissasembler.cc64 printf("\t%5u| %s", bytecode->offset, dex::GetOpcodeName(bytecode->opcode)); in Visit()
198 SLICER_CHECK(type->index != dex::kNoIndex); in Visit()
205 SLICER_CHECK(field->index != dex::kNoIndex); in Visit()
212 SLICER_CHECK(method->index != dex::kNoIndex); in Visit()
272 case dex::DBG_START_LOCAL: in Visit()
275 case dex::DBG_START_LOCAL_EXTENDED: in Visit()
278 case dex::DBG_END_LOCAL: in Visit()
281 case dex::DBG_RESTART_LOCAL: in Visit()
284 case dex::DBG_SET_PROLOGUE_END: in Visit()
287 case dex::DBG_SET_EPILOGUE_BEGIN: in Visit()
[all …]
/tools/trebuchet/trebuchet/startup-analyzer/
DREADME.md108 Open dex file
128 Open dex file function invocation
135 … /data/dalvik-cache/arm/system@framework@org.apache.http.legacy.impl.jar@classes.dex @ 0.028 ms
137 … /data/dalvik-cache/arm/system@framework@com.google.android.maps.jar@classes.dex @ 0.026 ms
139 …vik-cache/arm/data@app@com.facebook.katana-Hu0CRasfgvX30RlV_mJxBA==@base.apk@classes.dex @ 0.026 ms
141 …ata@app@com.facebook.katana-Hu0CRasfgvX30RlV_mJxBA==@split_codegenerator.apk@classes.dex @ 0.017 ms
157 … /data/app/com.facebook.katana-Hu0CRasfgvX30RlV_mJxBA==/base.apk!classes2.dex @ 0.061 ms
158 … /data/app/com.facebook.katana-Hu0CRasfgvX30RlV_mJxBA==/base.apk!classes9.dex @ 0.054 ms
159 … /data/app/com.facebook.katana-Hu0CRasfgvX30RlV_mJxBA==/base.apk!classes3.dex @ 0.063 ms
/tools/dexter/testdata/expected/
Dexit_hooks.stats2 .dex file statistics:
15 .dex IR statistics:
Dentry_hooks.stats2 .dex file statistics:
15 .dex IR statistics:

12