Search in sources :

Example 1 with RWSet

use of soot.jimple.toolkits.pointer.RWSet in project soot by Sable.

the class StrayRWFinder method flowThrough.

/**
 * OUT is the same as (IN minus killSet) plus the genSet.
 */
protected void flowThrough(Object inValue, Object unit, Object outValue) {
    FlowSet in = (FlowSet) inValue, out = (FlowSet) outValue;
    RWSet stmtRead = sea.readSet(body.getMethod(), (Stmt) unit);
    RWSet stmtWrite = sea.writeSet(body.getMethod(), (Stmt) unit);
    Boolean addSelf = Boolean.FALSE;
    Iterator tnIt = tns.iterator();
    while (tnIt.hasNext()) {
        CriticalSection tn = (CriticalSection) tnIt.next();
        if (stmtRead.hasNonEmptyIntersection(tn.write) || stmtWrite.hasNonEmptyIntersection(tn.read) || stmtWrite.hasNonEmptyIntersection(tn.write))
            addSelf = Boolean.TRUE;
    }
    in.copy(out);
    if (addSelf.booleanValue()) {
        CriticalSection tn = new CriticalSection(false, body.getMethod(), 0);
        tn.entermonitor = (Stmt) unit;
        tn.units.add((Unit) unit);
        tn.read.union(stmtRead);
        tn.write.union(stmtWrite);
        out.add(tn);
    }
}
Also used : RWSet(soot.jimple.toolkits.pointer.RWSet) FlowSet(soot.toolkits.scalar.FlowSet) Iterator(java.util.Iterator)

Aggregations

Iterator (java.util.Iterator)1 RWSet (soot.jimple.toolkits.pointer.RWSet)1 FlowSet (soot.toolkits.scalar.FlowSet)1