Lines Matching full:instruction
35 // Dex instruction memory access types correspond to the ordering of GET/PUT instructions;
52 constexpr bool IsInstructionReturn(Instruction::Code opcode) {
53 return Instruction::RETURN_VOID <= opcode && opcode <= Instruction::RETURN_OBJECT;
56 constexpr bool IsInstructionInvoke(Instruction::Code opcode) {
57 return Instruction::INVOKE_VIRTUAL <= opcode && opcode <= Instruction::INVOKE_INTERFACE_RANGE &&
58 opcode != Instruction::RETURN_VOID_NO_BARRIER;
61 constexpr bool IsInstructionQuickInvoke(Instruction::Code opcode) {
62 return opcode == Instruction::INVOKE_VIRTUAL_QUICK ||
63 opcode == Instruction::INVOKE_VIRTUAL_RANGE_QUICK;
66 constexpr bool IsInstructionInvokeStatic(Instruction::Code opcode) {
67 return opcode == Instruction::INVOKE_STATIC || opcode == Instruction::INVOKE_STATIC_RANGE;
70 constexpr bool IsInstructionGoto(Instruction::Code opcode) {
71 return Instruction::GOTO <= opcode && opcode <= Instruction::GOTO_32;
74 constexpr bool IsInstructionIfCc(Instruction::Code opcode) {
75 return Instruction::IF_EQ <= opcode && opcode <= Instruction::IF_LE;
78 constexpr bool IsInstructionIfCcZ(Instruction::Code opcode) {
79 return Instruction::IF_EQZ <= opcode && opcode <= Instruction::IF_LEZ;
82 constexpr bool IsInstructionIGet(Instruction::Code code) {
83 return Instruction::IGET <= code && code <= Instruction::IGET_SHORT;
86 constexpr bool IsInstructionIPut(Instruction::Code code) {
87 return Instruction::IPUT <= code && code <= Instruction::IPUT_SHORT;
90 constexpr bool IsInstructionSGet(Instruction::Code code) {
91 return Instruction::SGET <= code && code <= Instruction::SGET_SHORT;
94 constexpr bool IsInstructionSPut(Instruction::Code code) {
95 return Instruction::SPUT <= code && code <= Instruction::SPUT_SHORT;
98 constexpr bool IsInstructionAGet(Instruction::Code code) {
99 return Instruction::AGET <= code && code <= Instruction::AGET_SHORT;
102 constexpr bool IsInstructionAPut(Instruction::Code code) {
103 return Instruction::APUT <= code && code <= Instruction::APUT_SHORT;
106 constexpr bool IsInstructionIGetOrIPut(Instruction::Code code) {
107 return Instruction::IGET <= code && code <= Instruction::IPUT_SHORT;
110 constexpr bool IsInstructionIGetQuickOrIPutQuick(Instruction::Code code) {
111 return (code >= Instruction::IGET_QUICK && code <= Instruction::IPUT_OBJECT_QUICK) ||
112 (code >= Instruction::IPUT_BOOLEAN_QUICK && code <= Instruction::IGET_SHORT_QUICK);
115 constexpr bool IsInstructionSGetOrSPut(Instruction::Code code) {
116 return Instruction::SGET <= code && code <= Instruction::SPUT_SHORT;
119 constexpr bool IsInstructionAGetOrAPut(Instruction::Code code) {
120 return Instruction::AGET <= code && code <= Instruction::APUT_SHORT;
123 constexpr bool IsInstructionBinOp2Addr(Instruction::Code code) {
124 return Instruction::ADD_INT_2ADDR <= code && code <= Instruction::REM_DOUBLE_2ADDR;
129 constexpr bool IsInvokeInstructionRange(Instruction::Code opcode) {
133 return opcode >= Instruction::INVOKE_VIRTUAL_RANGE;
136 constexpr DexInvokeType InvokeInstructionType(Instruction::Code opcode) {
141 ? (opcode - Instruction::INVOKE_VIRTUAL_RANGE)
142 : (opcode - Instruction::INVOKE_VIRTUAL));
145 constexpr DexMemAccessType IGetMemAccessType(Instruction::Code code) {
149 return static_cast<DexMemAccessType>(code - Instruction::IGET);
152 constexpr DexMemAccessType IPutMemAccessType(Instruction::Code code) {
156 return static_cast<DexMemAccessType>(code - Instruction::IPUT);
159 constexpr DexMemAccessType SGetMemAccessType(Instruction::Code code) {
163 return static_cast<DexMemAccessType>(code - Instruction::SGET);
166 constexpr DexMemAccessType SPutMemAccessType(Instruction::Code code) {
170 return static_cast<DexMemAccessType>(code - Instruction::SPUT);
173 constexpr DexMemAccessType AGetMemAccessType(Instruction::Code code) {
177 return static_cast<DexMemAccessType>(code - Instruction::AGET);
180 constexpr DexMemAccessType APutMemAccessType(Instruction::Code code) {
184 return static_cast<DexMemAccessType>(code - Instruction::APUT);
187 constexpr DexMemAccessType IGetOrIPutMemAccessType(Instruction::Code code) {
191 return (code >= Instruction::IPUT) ? IPutMemAccessType(code) : IGetMemAccessType(code);
194 static inline DexMemAccessType IGetQuickOrIPutQuickMemAccessType(Instruction::Code code) {
197 case Instruction::IGET_QUICK: case Instruction::IPUT_QUICK:
199 case Instruction::IGET_WIDE_QUICK: case Instruction::IPUT_WIDE_QUICK:
201 case Instruction::IGET_OBJECT_QUICK: case Instruction::IPUT_OBJECT_QUICK:
203 case Instruction::IGET_BOOLEAN_QUICK: case Instruction::IPUT_BOOLEAN_QUICK:
205 case Instruction::IGET_BYTE_QUICK: case Instruction::IPUT_BYTE_QUICK:
207 case Instruction::IGET_CHAR_QUICK: case Instruction::IPUT_CHAR_QUICK:
209 case Instruction::IGET_SHORT_QUICK: case Instruction::IPUT_SHORT_QUICK:
217 constexpr DexMemAccessType SGetOrSPutMemAccessType(Instruction::Code code) {
221 return (code >= Instruction::SPUT) ? SPutMemAccessType(code) : SGetMemAccessType(code);
224 constexpr DexMemAccessType AGetOrAPutMemAccessType(Instruction::Code code) {
228 return (code >= Instruction::APUT) ? APutMemAccessType(code) : AGetMemAccessType(code);