use of soot.toolkits.scalar.FlowSet 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);
}
}
use of soot.toolkits.scalar.FlowSet in project soot by Sable.
the class StrayRWFinder method merge.
/**
* union, except for transactions in progress. They get joined
*/
protected void merge(Object in1, Object in2, Object out) {
FlowSet inSet1 = ((FlowSet) in1).clone(), inSet2 = ((FlowSet) in2).clone(), outSet = (FlowSet) out;
/*
boolean hasANull1 = false;
Transaction tn1 = null;
Iterator inIt1 = inSet1.iterator();
while(inIt1.hasNext())
{
tn1 = (Transaction) inIt1.next();
if(tn1.entermonitor == null)
{
hasANull1 = true;
break;
}
}
boolean hasANull2 = false;
Transaction tn2 = null;
Iterator inIt2 = inSet2.iterator();
while(inIt2.hasNext())
{
tn2 = (Transaction) inIt2.next();
if(tn2.entermonitor == null)
{
hasANull2 = true;
break;
}
}
if(hasANull1 && hasANull2)
{
inSet1.remove(tn1);
Iterator itends = tn1.exitmonitors.iterator();
while(itends.hasNext())
{
Stmt stmt = (Stmt) itends.next();
if(!tn2.exitmonitors.contains(stmt))
tn2.exitmonitors.add(stmt);
}
tn2.read.union(tn1.read);
tn2.write.union(tn1.write);
}
*/
inSet1.union(inSet2, outSet);
}
use of soot.toolkits.scalar.FlowSet in project soot by Sable.
the class StrayRWFinder method copy.
protected void copy(Object source, Object dest) {
FlowSet sourceSet = (FlowSet) source, destSet = (FlowSet) dest;
sourceSet.copy(destSet);
}
use of soot.toolkits.scalar.FlowSet in project soot by Sable.
the class MultiCalledMethods method byMCalledS0.
private void byMCalledS0(PegCallGraph pcg) {
Iterator it = pcg.iterator();
while (it.hasNext()) {
SootMethod sm = (SootMethod) it.next();
UnitGraph graph = new CompleteUnitGraph(sm.getActiveBody());
CallGraph callGraph = Scene.v().getCallGraph();
MultiRunStatementsFinder finder = new MultiRunStatementsFinder(graph, sm, multiCalledMethods, callGraph);
FlowSet fs = finder.getMultiRunStatements();
}
}
use of soot.toolkits.scalar.FlowSet in project soot by Sable.
the class StartJoinAnalysis method doFlowInsensitiveSingleIterationAnalysis.
public void doFlowInsensitiveSingleIterationAnalysis() {
FlowSet fs = (FlowSet) newInitialFlow();
Iterator stmtIt = graph.iterator();
while (stmtIt.hasNext()) {
Stmt s = (Stmt) stmtIt.next();
flowThrough(fs, s, fs);
}
}
Aggregations