use of soot.toDex.instructions.Insn22x in project soot by Sable.
the class StmtVisitor method buildMoveInsn.
protected static Insn buildMoveInsn(Register destinationReg, Register sourceReg) {
// get the optional opcode suffix, depending on the sizes of the regs
if (!destinationReg.fitsShort()) {
Opcode opc;
if (sourceReg.isObject())
opc = Opcode.MOVE_OBJECT_16;
else if (sourceReg.isWide())
opc = Opcode.MOVE_WIDE_16;
else
opc = Opcode.MOVE_16;
return new Insn32x(opc, destinationReg, sourceReg);
} else if (!destinationReg.fitsByte() || !sourceReg.fitsByte()) {
Opcode opc;
if (sourceReg.isObject())
opc = Opcode.MOVE_OBJECT_FROM16;
else if (sourceReg.isWide())
opc = Opcode.MOVE_WIDE_FROM16;
else
opc = Opcode.MOVE_FROM16;
return new Insn22x(opc, destinationReg, sourceReg);
}
Opcode opc;
if (sourceReg.isObject())
opc = Opcode.MOVE_OBJECT;
else if (sourceReg.isWide())
opc = Opcode.MOVE_WIDE;
else
opc = Opcode.MOVE;
return new Insn12x(opc, destinationReg, sourceReg);
}