Search in sources :

Example 6 with FlowSet

use of soot.toolkits.scalar.FlowSet in project soot by Sable.

the class StartJoinAnalysis method merge.

protected void merge(Object in1, Object in2, Object out) {
    FlowSet inSet1 = (FlowSet) in1;
    FlowSet inSet2 = (FlowSet) in2;
    FlowSet outSet = (FlowSet) out;
    inSet1.intersection(inSet2, outSet);
}
Also used : FlowSet(soot.toolkits.scalar.FlowSet)

Example 7 with FlowSet

use of soot.toolkits.scalar.FlowSet in project soot by Sable.

the class StartJoinAnalysis method copy.

protected void copy(Object source, Object dest) {
    FlowSet sourceSet = (FlowSet) source;
    FlowSet destSet = (FlowSet) dest;
    sourceSet.copy(destSet);
}
Also used : FlowSet(soot.toolkits.scalar.FlowSet)

Example 8 with FlowSet

use of soot.toolkits.scalar.FlowSet in project soot by Sable.

the class SimpleVeryBusyAnalysis method kill.

/**
 * Performs kills by generating a killSet and then performing<br/>
 * outSet <- inSet - killSet<br/>
 * The kill set is generated by iterating over the def-boxes
 * of the unit. For each local defined in the unit we iterate
 * over the binopExps in the inSet, and check whether they use
 * that local. If so, it is added to the kill set.
 * @param inSet the set flowing into the unit
 * @param u the unit being flown through
 * @param outSet the set flowing out of the unit
 */
private void kill(FlowSet inSet, Unit u, FlowSet outSet) {
    FlowSet kills = emptySet.clone();
    for (ValueBox defBox : u.getDefBoxes()) {
        if (defBox.getValue() instanceof Local) {
            Iterator<BinopExpr> inIt = inSet.iterator();
            while (inIt.hasNext()) {
                BinopExpr e = inIt.next();
                Iterator<ValueBox> eIt = e.getUseBoxes().iterator();
                while (eIt.hasNext()) {
                    ValueBox useBox = eIt.next();
                    if (useBox.getValue() instanceof Local && useBox.getValue().equivTo(defBox.getValue()))
                        kills.add(e);
                }
            }
        }
    }
    inSet.difference(kills, outSet);
}
Also used : ValueBox(soot.ValueBox) FlowSet(soot.toolkits.scalar.FlowSet) Local(soot.Local) AbstractBinopExpr(soot.jimple.internal.AbstractBinopExpr) BinopExpr(soot.jimple.BinopExpr)

Aggregations

FlowSet (soot.toolkits.scalar.FlowSet)8 Iterator (java.util.Iterator)2 Local (soot.Local)1 SootMethod (soot.SootMethod)1 ValueBox (soot.ValueBox)1 BinopExpr (soot.jimple.BinopExpr)1 Stmt (soot.jimple.Stmt)1 AbstractBinopExpr (soot.jimple.internal.AbstractBinopExpr)1 CallGraph (soot.jimple.toolkits.callgraph.CallGraph)1 RWSet (soot.jimple.toolkits.pointer.RWSet)1 PegCallGraph (soot.jimple.toolkits.thread.mhp.pegcallgraph.PegCallGraph)1 CompleteUnitGraph (soot.toolkits.graph.CompleteUnitGraph)1 UnitGraph (soot.toolkits.graph.UnitGraph)1