Abstracts accesses to code item fields other than debug info for CompactDexFile and StandardDexFile.
| 81 | // Abstracts accesses to code item fields other than debug info for CompactDexFile and |
| 82 | // StandardDexFile. |
| 83 | class CodeItemDataAccessor : public CodeItemInstructionAccessor { |
| 84 | public: |
| 85 | ALWAYS_INLINE CodeItemDataAccessor(const DexFile& dex_file, const DexFile::CodeItem* code_item); |
| 86 | |
| 87 | uint16_t RegistersSize() const { |
| 88 | return registers_size_; |
| 89 | } |
| 90 | |
| 91 | uint16_t InsSize() const { |
| 92 | return ins_size_; |
| 93 | } |
| 94 | |
| 95 | uint16_t OutsSize() const { |
| 96 | return outs_size_; |
| 97 | } |
| 98 | |
| 99 | uint16_t TriesSize() const { |
| 100 | return tries_size_; |
| 101 | } |
| 102 | |
| 103 | IterationRange<const DexFile::TryItem*> TryItems() const; |
| 104 | |
| 105 | const uint8_t* GetCatchHandlerData(size_t offset = 0) const; |
| 106 | |
| 107 | const DexFile::TryItem* FindTryItem(uint32_t try_dex_pc) const; |
| 108 | |
| 109 | inline const void* CodeItemDataEnd() const; |
| 110 | |
| 111 | protected: |
| 112 | CodeItemDataAccessor() = default; |
| 113 | |
| 114 | ALWAYS_INLINE void Init(const CompactDexFile::CodeItem& code_item); |
| 115 | ALWAYS_INLINE void Init(const StandardDexFile::CodeItem& code_item); |
| 116 | ALWAYS_INLINE void Init(const DexFile& dex_file, const DexFile::CodeItem* code_item); |
| 117 | |
| 118 | private: |
| 119 | // Fields mirrored from the dex/cdex code item. |
| 120 | uint16_t registers_size_; |
| 121 | uint16_t ins_size_; |
| 122 | uint16_t outs_size_; |
| 123 | uint16_t tries_size_; |
| 124 | }; |
| 125 | |
| 126 | // Abstract accesses to code item data including debug info offset. More heavy weight than the other |
| 127 | // helpers. |
no outgoing calls
no test coverage detected