Search in sources :

Example 26 with PointsToSetInternal

use of soot.jimple.spark.sets.PointsToSetInternal in project soot by Sable.

the class PropAlias method makeP2Set.

protected final PointsToSetInternal makeP2Set(FieldRefNode n) {
    PointsToSetInternal ret = loadSets.get(n);
    if (ret == null) {
        ret = pag.getSetFactory().newSet(null, pag);
        loadSets.put(n, ret);
    }
    return ret;
}
Also used : PointsToSetInternal(soot.jimple.spark.sets.PointsToSetInternal)

Example 27 with PointsToSetInternal

use of soot.jimple.spark.sets.PointsToSetInternal in project soot by Sable.

the class PropIter method handleStores.

protected final boolean handleStores(VarNode src) {
    boolean ret = false;
    final PointsToSetInternal srcSet = src.getP2Set();
    if (srcSet.isEmpty())
        return false;
    Node[] storeTargets = pag.storeLookup(src);
    for (Node element : storeTargets) {
        final FieldRefNode fr = (FieldRefNode) element;
        final SparkField f = fr.getField();
        ret = fr.getBase().getP2Set().forall(new P2SetVisitor() {

            public final void visit(Node n) {
                AllocDotField nDotF = pag.makeAllocDotField((AllocNode) n, f);
                if (nDotF.makeP2Set().addAll(srcSet, null)) {
                    returnValue = true;
                }
            }
        }) | ret;
    }
    return ret;
}
Also used : FieldRefNode(soot.jimple.spark.pag.FieldRefNode) AllocDotField(soot.jimple.spark.pag.AllocDotField) AllocNode(soot.jimple.spark.pag.AllocNode) PointsToSetInternal(soot.jimple.spark.sets.PointsToSetInternal) ClassConstantNode(soot.jimple.spark.pag.ClassConstantNode) FieldRefNode(soot.jimple.spark.pag.FieldRefNode) NewInstanceNode(soot.jimple.spark.pag.NewInstanceNode) Node(soot.jimple.spark.pag.Node) VarNode(soot.jimple.spark.pag.VarNode) AllocNode(soot.jimple.spark.pag.AllocNode) SparkField(soot.jimple.spark.pag.SparkField) P2SetVisitor(soot.jimple.spark.sets.P2SetVisitor)

Example 28 with PointsToSetInternal

use of soot.jimple.spark.sets.PointsToSetInternal in project soot by Sable.

the class PropIter method handleLoads.

protected final boolean handleLoads(FieldRefNode src) {
    boolean ret = false;
    final Node[] loadTargets = pag.loadLookup(src);
    final SparkField f = src.getField();
    ret = src.getBase().getP2Set().forall(new P2SetVisitor() {

        public final void visit(Node n) {
            AllocDotField nDotF = ((AllocNode) n).dot(f);
            if (nDotF == null)
                return;
            PointsToSetInternal set = nDotF.getP2Set();
            if (set.isEmpty())
                return;
            for (Node element : loadTargets) {
                VarNode target = (VarNode) element;
                if (target.makeP2Set().addAll(set, null)) {
                    returnValue = true;
                }
            }
        }
    }) | ret;
    return ret;
}
Also used : VarNode(soot.jimple.spark.pag.VarNode) AllocDotField(soot.jimple.spark.pag.AllocDotField) PointsToSetInternal(soot.jimple.spark.sets.PointsToSetInternal) ClassConstantNode(soot.jimple.spark.pag.ClassConstantNode) FieldRefNode(soot.jimple.spark.pag.FieldRefNode) NewInstanceNode(soot.jimple.spark.pag.NewInstanceNode) Node(soot.jimple.spark.pag.Node) VarNode(soot.jimple.spark.pag.VarNode) AllocNode(soot.jimple.spark.pag.AllocNode) SparkField(soot.jimple.spark.pag.SparkField) P2SetVisitor(soot.jimple.spark.sets.P2SetVisitor)

Example 29 with PointsToSetInternal

use of soot.jimple.spark.sets.PointsToSetInternal in project soot by Sable.

the class PropWorklist method handleFieldRefNode.

/**
 * Propagates new points-to information of node src to all its successors.
 */
protected final void handleFieldRefNode(FieldRefNode src, final HashSet<Object[]> edgesToPropagate) {
    final Node[] loadTargets = pag.loadLookup(src);
    if (loadTargets.length == 0)
        return;
    final SparkField field = src.getField();
    src.getBase().getP2Set().forall(new P2SetVisitor() {

        public final void visit(Node n) {
            AllocDotField nDotF = pag.makeAllocDotField((AllocNode) n, field);
            if (nDotF != null) {
                PointsToSetInternal p2Set = nDotF.getP2Set();
                if (!p2Set.getNewSet().isEmpty()) {
                    for (Node element : loadTargets) {
                        Object[] pair = { p2Set, element };
                        edgesToPropagate.add(pair);
                    }
                }
            }
        }
    });
}
Also used : AllocDotField(soot.jimple.spark.pag.AllocDotField) AllocNode(soot.jimple.spark.pag.AllocNode) PointsToSetInternal(soot.jimple.spark.sets.PointsToSetInternal) ClassConstantNode(soot.jimple.spark.pag.ClassConstantNode) FieldRefNode(soot.jimple.spark.pag.FieldRefNode) NewInstanceNode(soot.jimple.spark.pag.NewInstanceNode) Node(soot.jimple.spark.pag.Node) VarNode(soot.jimple.spark.pag.VarNode) AllocNode(soot.jimple.spark.pag.AllocNode) SparkField(soot.jimple.spark.pag.SparkField) P2SetVisitor(soot.jimple.spark.sets.P2SetVisitor)

Example 30 with PointsToSetInternal

use of soot.jimple.spark.sets.PointsToSetInternal in project soot by Sable.

the class MergeChecker method handleStores.

protected void handleStores(final VarNode src) {
    final PointsToSetInternal srcSet = src.getP2Set();
    if (srcSet.isEmpty())
        return;
    Node[] storeTargets = pag.storeLookup(src);
    for (Node element : storeTargets) {
        final FieldRefNode fr = (FieldRefNode) element;
        checkAll(fr, srcSet, src);
    }
}
Also used : FieldRefNode(soot.jimple.spark.pag.FieldRefNode) PointsToSetInternal(soot.jimple.spark.sets.PointsToSetInternal) FieldRefNode(soot.jimple.spark.pag.FieldRefNode) Node(soot.jimple.spark.pag.Node) VarNode(soot.jimple.spark.pag.VarNode) AllocNode(soot.jimple.spark.pag.AllocNode)

Aggregations

PointsToSetInternal (soot.jimple.spark.sets.PointsToSetInternal)37 AllocNode (soot.jimple.spark.pag.AllocNode)32 VarNode (soot.jimple.spark.pag.VarNode)28 Node (soot.jimple.spark.pag.Node)25 FieldRefNode (soot.jimple.spark.pag.FieldRefNode)22 LocalVarNode (soot.jimple.spark.pag.LocalVarNode)15 P2SetVisitor (soot.jimple.spark.sets.P2SetVisitor)15 SparkField (soot.jimple.spark.pag.SparkField)12 ClassConstantNode (soot.jimple.spark.pag.ClassConstantNode)9 GlobalVarNode (soot.jimple.spark.pag.GlobalVarNode)9 NewInstanceNode (soot.jimple.spark.pag.NewInstanceNode)9 HashSet (java.util.HashSet)8 AllocDotField (soot.jimple.spark.pag.AllocDotField)8 SootMethod (soot.SootMethod)7 AssignEdge (soot.jimple.spark.ondemand.pautil.AssignEdge)7 Type (soot.Type)5 ImmutableStack (soot.jimple.spark.ondemand.genericutil.ImmutableStack)5 Stack (soot.jimple.spark.ondemand.genericutil.Stack)5 ContextVarNode (soot.jimple.spark.pag.ContextVarNode)5 Propagator (soot.jimple.spark.ondemand.genericutil.Propagator)4