本文整理汇总了Java中org.jf.dexlib2.iface.instruction.formats.Instruction23x类的典型用法代码示例。如果您正苦于以下问题:Java Instruction23x类的具体用法?Java Instruction23x怎么用?Java Instruction23x使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Instruction23x类属于org.jf.dexlib2.iface.instruction.formats包,在下文中一共展示了Instruction23x类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: jimplify
import org.jf.dexlib2.iface.instruction.formats.Instruction23x; //导入依赖的package包/类
public void jimplify (DexBody body) {
if(!(instruction instanceof Instruction23x))
throw new IllegalArgumentException("Expected Instruction23x but got: "+instruction.getClass());
Instruction23x aPutInstr = (Instruction23x)instruction;
int source = aPutInstr.getRegisterA();
Local arrayBase = body.getRegisterLocal(aPutInstr.getRegisterB());
Local index = body.getRegisterLocal(aPutInstr.getRegisterC());
ArrayRef arrayRef = Jimple.v().newArrayRef(arrayBase, index);
Local sourceValue = body.getRegisterLocal(source);
assign = getAssignStmt(body, sourceValue, arrayRef);
if (aPutInstr.getOpcode().value == Opcode.APUT_OBJECT.value)
assign.addTag(new ObjectOpTag());
setUnit(assign);
addTags(assign);
body.add(assign);
if (IDalvikTyper.ENABLE_DVKTYPER) {
Debug.printDbg(IDalvikTyper.DEBUG, "constraint: "+ assign);
DalvikTyper.v().addConstraint(assign.getLeftOpBox(), assign.getRightOpBox());
DalvikTyper.v().setType(arrayRef.getIndexBox(), IntType.v(), true);
}
}
示例2: newBuilderInstruction23x
import org.jf.dexlib2.iface.instruction.formats.Instruction23x; //导入依赖的package包/类
@Nonnull
private BuilderInstruction23x newBuilderInstruction23x(@Nonnull Instruction23x instruction) {
return new BuilderInstruction23x(
instruction.getOpcode(),
instruction.getRegisterA(),
instruction.getRegisterB(),
instruction.getRegisterC());
}
示例3: of
import org.jf.dexlib2.iface.instruction.formats.Instruction23x; //导入依赖的package包/类
public static ImmutableInstruction23x of(Instruction23x instruction) {
if (instruction instanceof ImmutableInstruction23x) {
return (ImmutableInstruction23x)instruction;
}
return new ImmutableInstruction23x(
instruction.getOpcode(),
instruction.getRegisterA(),
instruction.getRegisterB(),
instruction.getRegisterC());
}
示例4: jimplify
import org.jf.dexlib2.iface.instruction.formats.Instruction23x; //导入依赖的package包/类
public void jimplify (DexBody body) {
if(!(instruction instanceof Instruction23x))
throw new IllegalArgumentException("Expected Instruction23x but got: "+instruction.getClass());
Instruction23x binOpInstr = (Instruction23x)instruction;
int dest = binOpInstr.getRegisterA();
Local source1 = body.getRegisterLocal(binOpInstr.getRegisterB());
Local source2 = body.getRegisterLocal(binOpInstr.getRegisterC());
expr = getExpression(source1, source2);
assign = Jimple.v().newAssignStmt(body.getRegisterLocal(dest), expr);
assign.addTag(getTag());
setUnit(assign);
addTags(assign);
body.add(assign);
if (IDalvikTyper.ENABLE_DVKTYPER) {
Debug.printDbg(IDalvikTyper.DEBUG, "constraint: "+ assign);
int op = (int)instruction.getOpcode().value;
BinopExpr bexpr = (BinopExpr)expr;
JAssignStmt jassign = (JAssignStmt)assign;
DalvikTyper.v().setType(bexpr.getOp1Box(), op1BinType[op-0x90], true);
DalvikTyper.v().setType(bexpr.getOp2Box(), op2BinType[op-0x90], true);
DalvikTyper.v().setType(jassign.leftBox, resBinType[op-0x90], false);
}
}
示例5: jimplify
import org.jf.dexlib2.iface.instruction.formats.Instruction23x; //导入依赖的package包/类
public void jimplify (DexBody body) throws InvalidDalvikBytecodeException {
if(!(instruction instanceof Instruction23x))
throw new IllegalArgumentException("Expected Instruction23x but got: "+instruction.getClass());
Instruction23x aGetInstr = (Instruction23x)instruction;
int dest = aGetInstr.getRegisterA();
Local arrayBase = body.getRegisterLocal(aGetInstr.getRegisterB());
Local index = body.getRegisterLocal(aGetInstr.getRegisterC());
ArrayRef arrayRef = Jimple.v().newArrayRef(arrayBase, index);
Local l = body.getRegisterLocal(dest);
assign = Jimple.v().newAssignStmt(l, arrayRef);
if (aGetInstr.getOpcode().value == Opcode.AGET_OBJECT.value)
assign.addTag(new ObjectOpTag());
setUnit(assign);
addTags(assign);
body.add(assign);
if (IDalvikTyper.ENABLE_DVKTYPER) {
Debug.printDbg(IDalvikTyper.DEBUG, "constraint: "+ assign);
DalvikTyper.v().addConstraint(assign.getLeftOpBox(), assign.getRightOpBox());
DalvikTyper.v().setType(arrayRef.getIndexBox(), IntType.v(), true);
}
}
示例6: sourceRegister
import org.jf.dexlib2.iface.instruction.formats.Instruction23x; //导入依赖的package包/类
/**
* Return the source register for this instruction.
*/
private int sourceRegister() {
// I hate smali's API ..
if (instruction instanceof Instruction23x)
return ((Instruction23x) instruction).getRegisterA();
else if (instruction instanceof Instruction22c)
return ((Instruction22c) instruction).getRegisterA();
else if (instruction instanceof Instruction21c)
return ((Instruction21c) instruction).getRegisterA();
else throw new RuntimeException("Instruction is not a instance, array or static op");
}
示例7: getTargetType
import org.jf.dexlib2.iface.instruction.formats.Instruction23x; //导入依赖的package包/类
@Override
protected Type getTargetType(DexBody body) {
Instruction23x aPutInstr = (Instruction23x)instruction;
Type t = body.getRegisterLocal(aPutInstr.getRegisterB()).getType();
if (t instanceof ArrayType)
return ((ArrayType) t).getElementType();
else
return UnknownType.v();
}
示例8: of
import org.jf.dexlib2.iface.instruction.formats.Instruction23x; //导入依赖的package包/类
public static ImmutableInstruction23x of(Instruction23x instruction) {
if (instruction instanceof ImmutableInstruction23x) {
return (ImmutableInstruction23x) instruction;
}
return new ImmutableInstruction23x(
instruction.getOpcode(),
instruction.getRegisterA(),
instruction.getRegisterB(),
instruction.getRegisterC());
}
示例9: write
import org.jf.dexlib2.iface.instruction.formats.Instruction23x; //导入依赖的package包/类
public void write(@Nonnull Instruction23x instruction) {
try {
writer.write(instruction.getOpcode().value);
writer.write(instruction.getRegisterA());
writer.write(instruction.getRegisterB());
writer.write(instruction.getRegisterC());
} catch (IOException ex) {
throw new RuntimeException(ex);
}
}
示例10: jimplify
import org.jf.dexlib2.iface.instruction.formats.Instruction23x; //导入依赖的package包/类
public void jimplify (DexBody body) {
if(!(instruction instanceof Instruction23x))
throw new IllegalArgumentException("Expected Instruction23x but got: "+instruction.getClass());
Instruction23x cmpInstr = (Instruction23x)instruction;
int dest = cmpInstr.getRegisterA();
Local first = body.getRegisterLocal(cmpInstr.getRegisterB());
Local second = body.getRegisterLocal(cmpInstr.getRegisterC());
//Expr cmpExpr;
//Type type = null
Opcode opcode = instruction.getOpcode();
switch (opcode) {
case CMPL_DOUBLE:
setTag (new DoubleOpTag());
type = DoubleType.v();
cmpExpr = Jimple.v().newCmplExpr(first, second);
break;
case CMPL_FLOAT:
setTag (new FloatOpTag());
type = FloatType.v();
cmpExpr = Jimple.v().newCmplExpr(first, second);
break;
case CMPG_DOUBLE:
setTag (new DoubleOpTag());
type = DoubleType.v();
cmpExpr = Jimple.v().newCmpgExpr(first, second);
break;
case CMPG_FLOAT:
setTag (new FloatOpTag());
type = FloatType.v();
cmpExpr = Jimple.v().newCmpgExpr(first, second);
break;
case CMP_LONG:
setTag (new LongOpTag());
type = LongType.v();
cmpExpr = Jimple.v().newCmpExpr(first, second);
break;
default:
throw new RuntimeException("no opcode for CMP: 0x"+ Integer.toHexString(opcode.value));
}
assign = Jimple.v().newAssignStmt(body.getRegisterLocal(dest), cmpExpr);
assign.addTag(getTag());
setUnit(assign);
addTags(assign);
body.add(assign);
if (IDalvikTyper.ENABLE_DVKTYPER) {
Debug.printDbg(IDalvikTyper.DEBUG, "constraint: "+ assign);
getTag().getName();
BinopExpr bexpr = (BinopExpr)cmpExpr;
DalvikTyper.v().setType(bexpr.getOp1Box(), type, true);
DalvikTyper.v().setType(bexpr.getOp2Box(), type, true);
DalvikTyper.v().setType(((JAssignStmt)assign).leftBox, IntType.v(), false);
}
}