Search in sources :

Example 1 with ConvertToBaf

use of soot.jimple.ConvertToBaf in project soot by Sable.

the class JTableSwitchStmt method convertToBaf.

public void convertToBaf(JimpleToBafContext context, List<Unit> out) {
    List<PlaceholderInst> targetPlaceholders = new ArrayList<PlaceholderInst>();
    ((ConvertToBaf) getKey()).convertToBaf(context, out);
    for (Unit target : getTargets()) {
        targetPlaceholders.add(Baf.v().newPlaceholderInst(target));
    }
    Unit u = Baf.v().newTableSwitchInst(Baf.v().newPlaceholderInst(getDefaultTarget()), lowIndex, highIndex, targetPlaceholders);
    u.addAllTagsOf(this);
    out.add(u);
}
Also used : PlaceholderInst(soot.baf.PlaceholderInst) ArrayList(java.util.ArrayList) ConvertToBaf(soot.jimple.ConvertToBaf) Unit(soot.Unit)

Example 2 with ConvertToBaf

use of soot.jimple.ConvertToBaf in project soot by Sable.

the class JDynamicInvokeExpr method convertToBaf.

public void convertToBaf(JimpleToBafContext context, List<Unit> out) {
    if (argBoxes != null) {
        for (ValueBox element : argBoxes) {
            ((ConvertToBaf) (element.getValue())).convertToBaf(context, out);
        }
    }
    List<Value> bsmArgs = new ArrayList<Value>();
    for (ValueBox argBox : bsmArgBoxes) {
        bsmArgs.add(argBox.getValue());
    }
    Unit u = Baf.v().newDynamicInvokeInst(bsmRef, bsmArgs, methodRef, tag);
    u.addAllTagsOf(context.getCurrentUnit());
    out.add(u);
}
Also used : ValueBox(soot.ValueBox) Value(soot.Value) ArrayList(java.util.ArrayList) ConvertToBaf(soot.jimple.ConvertToBaf) Unit(soot.Unit)

Example 3 with ConvertToBaf

use of soot.jimple.ConvertToBaf in project soot by Sable.

the class AbstractVirtualInvokeExpr method convertToBaf.

public void convertToBaf(JimpleToBafContext context, List<Unit> out) {
    ((ConvertToBaf) (getBase())).convertToBaf(context, out);
    if (argBoxes != null) {
        for (ValueBox element : argBoxes) {
            ((ConvertToBaf) (element.getValue())).convertToBaf(context, out);
        }
    }
    Unit u = Baf.v().newVirtualInvokeInst(methodRef);
    out.add(u);
    u.addAllTagsOf(context.getCurrentUnit());
}
Also used : ValueBox(soot.ValueBox) ConvertToBaf(soot.jimple.ConvertToBaf) Unit(soot.Unit)

Example 4 with ConvertToBaf

use of soot.jimple.ConvertToBaf in project soot by Sable.

the class JLookupSwitchStmt method convertToBaf.

public void convertToBaf(JimpleToBafContext context, List<Unit> out) {
    List<PlaceholderInst> targetPlaceholders = new ArrayList<PlaceholderInst>();
    ((ConvertToBaf) getKey()).convertToBaf(context, out);
    for (Unit target : getTargets()) {
        targetPlaceholders.add(Baf.v().newPlaceholderInst(target));
    }
    Unit u = Baf.v().newLookupSwitchInst(Baf.v().newPlaceholderInst(getDefaultTarget()), getLookupValues(), targetPlaceholders);
    u.addAllTagsOf(this);
    out.add(u);
}
Also used : PlaceholderInst(soot.baf.PlaceholderInst) ArrayList(java.util.ArrayList) ConvertToBaf(soot.jimple.ConvertToBaf) Unit(soot.Unit)

Aggregations

Unit (soot.Unit)4 ConvertToBaf (soot.jimple.ConvertToBaf)4 ArrayList (java.util.ArrayList)3 ValueBox (soot.ValueBox)2 PlaceholderInst (soot.baf.PlaceholderInst)2 Value (soot.Value)1