use of soot.toDex.instructions.Insn22c in project soot by Sable.
the class ExprVisitor method caseInstanceOfExpr.
@Override
public void caseInstanceOfExpr(InstanceOfExpr ioe) {
final Value referenceToCheck = ioe.getOp();
// There are some strange apps that use constants here
constantV.setOrigStmt(origStmt);
Register referenceToCheckReg = regAlloc.asImmediate(referenceToCheck, constantV);
TypeReference checkType = DexPrinter.toTypeReference(ioe.getCheckType());
stmtV.addInsn(new Insn22c(Opcode.INSTANCE_OF, destinationReg, referenceToCheckReg, checkType), origStmt);
}
use of soot.toDex.instructions.Insn22c in project soot by Sable.
the class ExprVisitor method caseNewArrayExpr.
@Override
public void caseNewArrayExpr(NewArrayExpr nae) {
Value size = nae.getSize();
constantV.setOrigStmt(origStmt);
Register sizeReg = regAlloc.asImmediate(size, constantV);
ArrayType arrayType = nae.getBaseType().getArrayType();
TypeReference arrayTypeItem = DexPrinter.toTypeReference(arrayType);
stmtV.addInsn(new Insn22c(Opcode.NEW_ARRAY, destinationReg, sizeReg, arrayTypeItem), origStmt);
}
use of soot.toDex.instructions.Insn22c in project soot by Sable.
the class StmtVisitor method buildInstanceFieldPutInsn.
private Insn buildInstanceFieldPutInsn(InstanceFieldRef destRef, Value source) {
FieldReference destField = DexPrinter.toFieldReference(destRef.getFieldRef());
Local instance = (Local) destRef.getBase();
Register instanceReg = regAlloc.asLocal(instance);
Register sourceReg = regAlloc.asImmediate(source, constantV);
Opcode opc = getPutGetOpcodeWithTypeSuffix(IPUT_OPCODE, destField.getType());
return new Insn22c(opc, sourceReg, instanceReg, destField);
}
use of soot.toDex.instructions.Insn22c in project soot by Sable.
the class StmtVisitor method buildInstanceFieldGetInsn.
private Insn buildInstanceFieldGetInsn(Register destinationReg, InstanceFieldRef sourceRef) {
Local instance = (Local) sourceRef.getBase();
Register instanceReg = regAlloc.asLocal(instance);
FieldReference sourceField = DexPrinter.toFieldReference(sourceRef.getFieldRef());
Opcode opc = getPutGetOpcodeWithTypeSuffix(IGET_OPCODE, sourceField.getType());
return new Insn22c(opc, destinationReg, instanceReg, sourceField);
}
Aggregations