more work generalizing work list

git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@2930 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
This commit is contained in:
sjfink 2008-06-29 22:51:39 +00:00
parent 9cc41a4422
commit 257cb0d5d5
1 changed files with 9 additions and 1 deletions

View File

@ -142,7 +142,7 @@ public class TabulationSolver<T, P> {
/**
* The worklist
*/
final private ITabulationWorklist<T> worklist = makeWorklist();
private ITabulationWorklist<T> worklist;
/**
* A progress monitor. can be null.
@ -224,6 +224,9 @@ public class TabulationSolver<T, P> {
* @throws CancelException
*/
private void forwardTabulateSLRPs() throws CancelException {
if (worklist == null) {
worklist = makeWorklist();
}
while (worklist.size() > 0) {
MonitorUtil.throwExceptionIfCanceled(progressMonitor);
if (verbose) {
@ -752,11 +755,13 @@ public class TabulationSolver<T, P> {
}
protected PathEdge<T> popFromWorkList() {
assert worklist != null;
return worklist.take();
}
private PathEdge peekFromWorkList() {
// horrible. don't use in performance-critical
assert worklist != null;
PathEdge<T> result = worklist.take();
worklist.insert(result);
return result;
@ -835,6 +840,9 @@ public class TabulationSolver<T, P> {
}
protected void addToWorkList(T s_p, int i, T n, int j) {
if (worklist == null) {
worklist = makeWorklist();
}
worklist.insert(PathEdge.createPathEdge(s_p, i, n, j));
if (DEBUG_LEVEL >= 3) {
System.err.println("WORKLIST: " + worklist);