本文整理汇总了Java中org.jf.dexlib2.iface.instruction.formats.Instruction12x类的典型用法代码示例。如果您正苦于以下问题:Java Instruction12x类的具体用法?Java Instruction12x怎么用?Java Instruction12x使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Instruction12x类属于org.jf.dexlib2.iface.instruction.formats包,在下文中一共展示了Instruction12x类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: jimplify
import org.jf.dexlib2.iface.instruction.formats.Instruction12x; //导入依赖的package包/类
public void jimplify (DexBody body) {
if(!(instruction instanceof Instruction12x))
throw new IllegalArgumentException("Expected Instruction12x but got: "+instruction.getClass());
Instruction12x lengthOfArrayInstruction = (Instruction12x)instruction;
int dest = lengthOfArrayInstruction.getRegisterA();
Local arrayReference = body.getRegisterLocal(lengthOfArrayInstruction.getRegisterB());
LengthExpr lengthExpr = Jimple.v().newLengthExpr(arrayReference);
assign = Jimple.v().newAssignStmt(body.getRegisterLocal(dest), lengthExpr);
setUnit(assign);
addTags(assign);
body.add(assign);
if (IDalvikTyper.ENABLE_DVKTYPER) {
Debug.printDbg(IDalvikTyper.DEBUG, "constraint: "+ assign);
DalvikTyper.v().setType(assign.getLeftOpBox(), IntType.v(), false);
}
}
示例2: jimplify
import org.jf.dexlib2.iface.instruction.formats.Instruction12x; //导入依赖的package包/类
public void jimplify (DexBody body) {
if(!(instruction instanceof Instruction12x))
throw new IllegalArgumentException("Expected Instruction12x but got: "+instruction.getClass());
Instruction12x cmpInstr = (Instruction12x)instruction;
int dest = cmpInstr.getRegisterA();
Local source = body.getRegisterLocal(cmpInstr.getRegisterB());
Value expr = getExpression(source);
assign = Jimple.v().newAssignStmt(body.getRegisterLocal(dest), expr);
setUnit(assign);
addTags(assign);
body.add(assign);
if (IDalvikTyper.ENABLE_DVKTYPER) {
Debug.printDbg(IDalvikTyper.DEBUG, "constraint: "+ assign);
int op = (int)instruction.getOpcode().value;
//DalvikTyper.v().captureAssign((JAssignStmt)assign, op);
JAssignStmt jass = (JAssignStmt)assign;
DalvikTyper.v().setType((expr instanceof JCastExpr) ? ((JCastExpr) expr).getOpBox() : ((UnopExpr) expr).getOpBox(), opUnType[op - 0x7b], true);
DalvikTyper.v().setType(jass.leftBox, resUnType[op - 0x7b], false);
}
}
示例3: newBuilderInstruction12x
import org.jf.dexlib2.iface.instruction.formats.Instruction12x; //导入依赖的package包/类
@Nonnull
private BuilderInstruction12x newBuilderInstruction12x(@Nonnull Instruction12x instruction) {
return new BuilderInstruction12x(
instruction.getOpcode(),
instruction.getRegisterA(),
instruction.getRegisterB());
}
示例4: of
import org.jf.dexlib2.iface.instruction.formats.Instruction12x; //导入依赖的package包/类
public static ImmutableInstruction12x of(Instruction12x instruction) {
if (instruction instanceof ImmutableInstruction12x) {
return (ImmutableInstruction12x)instruction;
}
return new ImmutableInstruction12x(
instruction.getOpcode(),
instruction.getRegisterA(),
instruction.getRegisterB());
}
示例5: jimplify
import org.jf.dexlib2.iface.instruction.formats.Instruction12x; //导入依赖的package包/类
public void jimplify (DexBody body) {
if(!(instruction instanceof Instruction12x))
throw new IllegalArgumentException("Expected Instruction12x but got: "+instruction.getClass());
Instruction12x binOp2AddrInstr = (Instruction12x)instruction;
int dest = binOp2AddrInstr.getRegisterA();
Local source1 = body.getRegisterLocal(binOp2AddrInstr.getRegisterA());
Local source2 = body.getRegisterLocal(binOp2AddrInstr.getRegisterB());
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);
BinopExpr bexpr = (BinopExpr)expr;
short op = instruction.getOpcode().value;
DalvikTyper.v().setType(bexpr.getOp1Box(), op1BinType[op-0xb0], true);
DalvikTyper.v().setType(bexpr.getOp2Box(), op2BinType[op-0xb0], true);
DalvikTyper.v().setType(assign.getLeftOpBox(), resBinType[op-0xb0], false);
}
}
示例6: of
import org.jf.dexlib2.iface.instruction.formats.Instruction12x; //导入依赖的package包/类
public static ImmutableInstruction12x of(Instruction12x instruction) {
if (instruction instanceof ImmutableInstruction12x) {
return (ImmutableInstruction12x) instruction;
}
return new ImmutableInstruction12x(
instruction.getOpcode(),
instruction.getRegisterA(),
instruction.getRegisterB());
}
示例7: write
import org.jf.dexlib2.iface.instruction.formats.Instruction12x; //导入依赖的package包/类
public void write(@Nonnull Instruction12x instruction) {
try {
writer.write(instruction.getOpcode().value);
writer.write(packNibbles(instruction.getRegisterA(), instruction.getRegisterB()));
} catch (IOException ex) {
throw new RuntimeException(ex);
}
}