use of com.android.dx.io.instructions.DecodedInstruction in project buck by facebook.
the class CodeReader method visitAll.
public void visitAll(DecodedInstruction[] decodedInstructions) throws DexException {
int size = decodedInstructions.length;
for (int i = 0; i < size; i++) {
DecodedInstruction one = decodedInstructions[i];
if (one == null) {
continue;
}
callVisit(decodedInstructions, one);
}
}
use of com.android.dx.io.instructions.DecodedInstruction in project jadx by skylot.
the class InsnDecoder method getMoveResultRegister.
private int getMoveResultRegister(DecodedInstruction[] insnArr, int offset) {
int nextOffset = getNextInsnOffset(insnArr, offset);
if (nextOffset >= 0) {
DecodedInstruction next = insnArr[nextOffset];
int opc = next.getOpcode();
if (opc == Opcodes.MOVE_RESULT || opc == Opcodes.MOVE_RESULT_WIDE || opc == Opcodes.MOVE_RESULT_OBJECT) {
return next.getA();
}
}
return -1;
}
use of com.android.dx.io.instructions.DecodedInstruction in project jadx by skylot.
the class InsnDecoder method decodeSwitch.
private InsnNode decodeSwitch(DecodedInstruction insn, int offset, boolean packed) {
int payloadOffset = insn.getTarget();
DecodedInstruction payload = insnArr[payloadOffset];
Object[] keys;
int[] targets;
if (packed) {
PackedSwitchPayloadDecodedInstruction ps = (PackedSwitchPayloadDecodedInstruction) payload;
targets = ps.getTargets();
keys = new Object[targets.length];
int k = ps.getFirstKey();
for (int i = 0; i < keys.length; i++) {
keys[i] = k++;
}
} else {
SparseSwitchPayloadDecodedInstruction ss = (SparseSwitchPayloadDecodedInstruction) payload;
targets = ss.getTargets();
keys = new Object[targets.length];
for (int i = 0; i < keys.length; i++) {
keys[i] = ss.getKeys()[i];
}
}
// convert from relative to absolute offsets
for (int i = 0; i < targets.length; i++) {
targets[i] = targets[i] - payloadOffset + offset;
}
int nextOffset = getNextInsnOffset(insnArr, offset);
return new SwitchNode(InsnArg.reg(insn, 0, ArgType.NARROW), keys, targets, nextOffset);
}
Aggregations