Java 类soot.jimple.internal.JInvokeStmt 实例源码

项目:petablox    文件:DomP.java   
@Override
public String toFIString(Unit u) {       
    StringBuilder sb = new StringBuilder();
    boolean printId = Utils.buildBoolProperty("petablox.printrel.printID", false);
    if (printId) sb.append("(" + indexOf(u) + ")");
    String type;
    if(u instanceof JAssignStmt)
        type = "Assign";
    else if(u instanceof JBreakpointStmt)
        type = "Breakpoint";
    else if(u instanceof JGotoStmt)
        type = "Goto";
    else if(u instanceof JIfStmt) 
        type = "If";
    else if(u instanceof JIdentityStmt) 
        type = "Identity";
    else if(u instanceof JInvokeStmt) 
        type = "Invoke";
    else if(u instanceof JLookupSwitchStmt) 
        type = "LookupSwitch";
    else if(u instanceof JNopStmt)
        type = "Nop";
    else if(u instanceof JRetStmt) 
        type = "Return";
    else if(u instanceof JTableSwitchStmt) 
        type = "TablelSwitch";
    else if(u instanceof JThrowStmt) 
        type = "Throw";
    else
        type = "Other";
    sb.append(type);
    sb.append(": " + SootUtilities.getMethod(u).getName() + "@" + SootUtilities.getMethod(u).getDeclaringClass().getName());
    return sb.toString();
}
项目:petablox    文件:SootUtilities.java   
public static boolean isInvoke(Unit q){
    if (q instanceof JInvokeStmt)
        return true;
    else if (q instanceof JAssignStmt)
        if ((((JAssignStmt)q).rightBox.getValue()) instanceof InvokeExpr)
            return true;
    return false;
}
项目:petablox    文件:SootUtilities.java   
public static boolean isVirtualInvoke(Unit q){
    assert (q instanceof JInvokeStmt || q instanceof JAssignStmt);
    InvokeExpr ie;
    if (q instanceof JInvokeStmt)
        ie = ((JInvokeStmt)q).getInvokeExpr();
    else if (q instanceof JAssignStmt)
        ie = ((InvokeExpr)(((JAssignStmt)q).rightBox.getValue()));
    else
        ie = null;
    return ie != null && ie instanceof JVirtualInvokeExpr;
}
项目:petablox    文件:SootUtilities.java   
public static boolean isInterfaceInvoke(Unit q){
    assert (q instanceof JInvokeStmt || q instanceof JAssignStmt);
    InvokeExpr ie;
    if (q instanceof JInvokeStmt)
        ie = ((JInvokeStmt)q).getInvokeExpr();
    else if (q instanceof JAssignStmt)
        ie = ((InvokeExpr)(((JAssignStmt)q).rightBox.getValue()));
    else
        ie = null;
    return ie != null && ie instanceof JInterfaceInvokeExpr;
}
项目:petablox    文件:SootUtilities.java   
public static boolean isInstanceInvoke(Unit q){
    assert (q instanceof JInvokeStmt || q instanceof JAssignStmt);
    InvokeExpr ie;
    if (q instanceof JInvokeStmt)
        ie = ((JInvokeStmt)q).getInvokeExpr();
    else if (q instanceof JAssignStmt)
        ie = ((InvokeExpr)(((JAssignStmt)q).rightBox.getValue()));
    else
        ie = null;
    if (ie != null && ie instanceof InstanceInvokeExpr)
        return true;
    return false;
}
项目:petablox    文件:SootUtilities.java   
public static boolean isStaticInvoke(Unit q){
    assert (q instanceof JInvokeStmt || q instanceof JAssignStmt);
    InvokeExpr ie;
    if (q instanceof JInvokeStmt)
        ie = ((JInvokeStmt)q).getInvokeExpr();
    else if (q instanceof JAssignStmt)
        ie = ((InvokeExpr)(((JAssignStmt)q).rightBox.getValue()));
    else
        ie = null;
    if (ie != null && ie instanceof StaticInvokeExpr)
        return true;
    return false;
}
项目:petablox    文件:SootUtilities.java   
public static InvokeExpr getInvokeExpr(Unit q){
    assert (q instanceof JInvokeStmt || q instanceof JAssignStmt);
    InvokeExpr ie;
    if (q instanceof JInvokeStmt)
        ie = ((JInvokeStmt)q).getInvokeExpr();
    else if (q instanceof JAssignStmt)
        ie = ((InvokeExpr)(((JAssignStmt)q).rightBox.getValue()));
    else
        ie = null;
    return ie;
}
项目:petablox    文件:SootUtilities.java   
public static Value getInstanceInvkBase(Unit q){
    assert (q instanceof JInvokeStmt || q instanceof JAssignStmt);
    InvokeExpr ie;
    if (q instanceof JInvokeStmt)
        ie = ((JInvokeStmt)q).getInvokeExpr();
    else if (q instanceof JAssignStmt)
        ie = ((InvokeExpr)(((JAssignStmt)q).rightBox.getValue()));
    else
        ie = null;
    if (ie != null && ie instanceof InstanceInvokeExpr)
        return ((InstanceInvokeExpr)ie).getBase();
    return null;
}
项目:petablox    文件:SootUtilities.java   
public static List<Value> getInvokeArgs (Unit q) {
    assert (q instanceof JInvokeStmt || q instanceof JAssignStmt);
    List<Value> args;
    if (q instanceof JInvokeStmt)
        args = ((JInvokeStmt)q).getInvokeExpr().getArgs();
    else if (q instanceof JAssignStmt)
        args = ((InvokeExpr)(((JAssignStmt)q).rightBox.getValue())).getArgs();
    else
        args = null;
    return args;
}
项目:jgs    文件:TestSootUtils.java   
@Test
public final void testExtractLn() {
    Stmt statement1 =
        new JInvokeStmt(new JStaticInvokeExpr(sootMethod1C1.makeRef(),
                                              new ArrayList<Object>()));
    Tag tag1 = new SourceLnPosTag(8, 8, 3, 4);
    statement1.addTag(tag1);
    Stmt statement2 = new JReturnVoidStmt();
    Tag tag2 = new SourceLnPosTag(532, 532, 3, 4);
    statement2.addTag(tag2);
    Stmt statement3 = new JReturnVoidStmt();
    assertTrue("Correct line number", extractLineNumber(statement1) == 8);
    assertTrue("Correct line number", extractLineNumber(statement2) == 532);
    assertTrue("No line number present", extractLineNumber(statement3) == 0);
}
项目:petablox    文件:RelInvokeInst.java   
public void visit(JInvokeStmt s) {
    add(s, s.getInvokeExpr());
}
项目:petablox    文件:DomI.java   
@Override
public void visit(JInvokeStmt s) {}
项目:petablox    文件:RelMgetClassInvkInst.java   
public void visit(JInvokeStmt s) {}
项目:petablox    文件:IInvokeInstVisitor.java   
public void visit(JInvokeStmt q);