Skip to content

Commit 9eea9ac

Browse files
committed
added a new scheduling strategy
1 parent 5a1857f commit 9eea9ac

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

soot-infoflow/src/soot/jimple/infoflow/solver/fastSolver/DefaultSchedulingStrategy.java

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ public class DefaultSchedulingStrategy<N, D extends FastSolverLinkedNode<D, N>,
1414

1515
protected final IFDSSolver<N, D, I> solver;
1616

17+
/**
18+
* Strategy that schedules each edge individually, potentially in a new thread
19+
*/
1720
public final ISchedulingStrategy<N, D> EACH_EDGE_INDIVIDUALLY = new ISchedulingStrategy<N, D>() {
1821

1922
@Override
@@ -53,6 +56,10 @@ public void propagateReturnFlow(D sourceVal, N target, D targetVal, N relatedCal
5356

5457
};
5558

59+
/**
60+
* Strategy that schedules each edge that crosses a method boundary, but
61+
* processes all edges inside the same method locally in the same task
62+
*/
5663
public final ISchedulingStrategy<N, D> EACH_METHOD_INDIVIDUALLY = new ISchedulingStrategy<N, D>() {
5764

5865
@Override
@@ -90,6 +97,44 @@ public void propagateReturnFlow(D sourceVal, N target, D targetVal, N relatedCal
9097

9198
};
9299

100+
/**
101+
* Strategy that never schedules a new task, i.e., processes all edges locally
102+
* in same task
103+
*/
104+
public final ISchedulingStrategy<N, D> ALL_EDGES_LOCALLY = new ISchedulingStrategy<N, D>() {
105+
106+
@Override
107+
public void propagateInitialSeeds(D sourceVal, N target, D targetVal, N relatedCallSite,
108+
boolean isUnbalancedReturn) {
109+
solver.propagate(sourceVal, target, targetVal, relatedCallSite, isUnbalancedReturn, ScheduleTarget.LOCAL);
110+
}
111+
112+
@Override
113+
public void propagateNormalFlow(D sourceVal, N target, D targetVal, N relatedCallSite,
114+
boolean isUnbalancedReturn) {
115+
solver.propagate(sourceVal, target, targetVal, relatedCallSite, isUnbalancedReturn, ScheduleTarget.LOCAL);
116+
}
117+
118+
@Override
119+
public void propagateCallFlow(D sourceVal, N target, D targetVal, N relatedCallSite,
120+
boolean isUnbalancedReturn) {
121+
solver.propagate(sourceVal, target, targetVal, relatedCallSite, isUnbalancedReturn, ScheduleTarget.LOCAL);
122+
}
123+
124+
@Override
125+
public void propagateCallToReturnFlow(D sourceVal, N target, D targetVal, N relatedCallSite,
126+
boolean isUnbalancedReturn) {
127+
solver.propagate(sourceVal, target, targetVal, relatedCallSite, isUnbalancedReturn, ScheduleTarget.LOCAL);
128+
}
129+
130+
@Override
131+
public void propagateReturnFlow(D sourceVal, N target, D targetVal, N relatedCallSite,
132+
boolean isUnbalancedReturn) {
133+
solver.propagate(sourceVal, target, targetVal, relatedCallSite, isUnbalancedReturn, ScheduleTarget.LOCAL);
134+
};
135+
136+
};
137+
93138
/**
94139
* Creates a new instance of the {@link DefaultSchedulingStrategy} class
95140
*

0 commit comments

Comments
 (0)