From df1ce99f6ddd6bbd2f25e0e685c8e7d21646ac57 Mon Sep 17 00:00:00 2001 From: bdemsky Date: Tue, 8 Jan 2008 23:47:56 +0000 Subject: [PATCH] changes --- .../src/Analysis/TaskStateAnalysis/TagWrapper.java | 12 ++++++++++++ .../Analysis/TaskStateAnalysis/TaskTagAnalysis.java | 12 +++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/Robust/src/Analysis/TaskStateAnalysis/TagWrapper.java b/Robust/src/Analysis/TaskStateAnalysis/TagWrapper.java index 5ce05f27..eedda217 100644 --- a/Robust/src/Analysis/TaskStateAnalysis/TagWrapper.java +++ b/Robust/src/Analysis/TaskStateAnalysis/TagWrapper.java @@ -20,4 +20,16 @@ public class TagWrapper { tw.ts=ts.clone(); return tw; } + + public boolean equals(Object o) { + if (o instanceof TagWrapper) { + TagWrapper tw=(TagWrapper)o; + return tw.initts.equals(initts)&&tw.ts.equals(ts); + } + return false; + } + + public int hashCode() { + return initts.hashCode()^ts.hashCode(); + } } diff --git a/Robust/src/Analysis/TaskStateAnalysis/TaskTagAnalysis.java b/Robust/src/Analysis/TaskStateAnalysis/TaskTagAnalysis.java index d1d023f5..093102e9 100644 --- a/Robust/src/Analysis/TaskStateAnalysis/TaskTagAnalysis.java +++ b/Robust/src/Analysis/TaskStateAnalysis/TaskTagAnalysis.java @@ -69,7 +69,6 @@ public class TaskTagAnalysis { TaskBinding tb=new TaskBinding(tqi); while(tb.hasNext()) { doAnalysis(tb); - tb.next(); } } @@ -83,14 +82,20 @@ public class TaskTagAnalysis { TempDescriptor tmp=tmpit.next(); TagWrapper prevtag=prevtable.get(tmp); if (table.containsKey(tmp)) { + //merge tag states TagWrapper currtag=table.get(tmp); + assert(currtag.initts.equals(prevtag.initts)); + for(Iterator tagit=prevtag.ts.iterator();tagit.hasNext();) { + TagState tag=tagit.next(); + if (!currtag.ts.contains(tag)) { + currtag.ts.add(tag); + } + } } else { table.put(tmp, prevtag.clone()); } - } } - return table; } @@ -106,6 +111,7 @@ public class TaskTagAnalysis { FlatNode fn=tovisit.iterator().next(); tovisit.remove(fn); visited.add(fn); + Hashtable table=computeInitialState(table, fn); for(int i=0;i