more changes according to new effect analysis
authoryeom <yeom>
Wed, 30 Jun 2010 01:01:31 +0000 (01:01 +0000)
committeryeom <yeom>
Wed, 30 Jun 2010 01:01:31 +0000 (01:01 +0000)
and set up debug features of OoOJava analysis

Robust/src/Analysis/Disjoint/DisjointAnalysis.java
Robust/src/Analysis/OoOJava/ConflictEdge.java
Robust/src/Analysis/OoOJava/ConflictGraph.java
Robust/src/Analysis/OoOJava/ConflictNode.java
Robust/src/Analysis/OoOJava/OoOJavaAnalysis.java
Robust/src/Analysis/OoOJava/SESELock.java
Robust/src/Analysis/OoOJava/SESEWaitingQueue.java [new file with mode: 0644]
Robust/src/Analysis/OoOJava/WaitingElement.java [new file with mode: 0644]
Robust/src/IR/State.java
Robust/src/Main/Main.java

index 8a7e763e6f91f68319d678cf9bc9255f4b36d76b..6b8e9c5505b1eb75706de1db8f1b48cc71f399e8 100644 (file)
@@ -730,9 +730,6 @@ public class DisjointAnalysis {
       throw new Error( "IO Exception while writing disjointness analysis output." );
     }
 
-    if( doEffectsAnalysis ) {
-      effectsAnalysis.writeEffects( "effects.txt" );
-    }
   }
 
 
index 60c610f817e8ce04ce83459366a923ba3ea3a3fc..11056891014b89ec7ed1a205bc57185f620b785b 100644 (file)
@@ -18,7 +18,7 @@ public class ConflictEdge {
     } else if (type == ConflictGraph.COARSE_GRAIN_EDGE) {
       return "\"C_CONFLICT\"";
     } else {
-      return "CONFLICT\"";
+      return "\"CONFLICT\"";
     }
   }
 
index 6f114385631c0ce99852cadcb938c6ba4828f771..9a65b158f0dafd46e71f237b7153107e450fe1eb 100644 (file)
@@ -3,6 +3,7 @@ package Analysis.OoOJava;
 import java.io.BufferedWriter;
 import java.io.FileWriter;
 import java.util.Collection;
+import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Hashtable;
 import java.util.Iterator;
@@ -92,7 +93,7 @@ public class ConflictGraph {
     String id = var + "_fn" + fn.hashCode();
     ConflictNode node = id2cn.get(id);
     if (node == null) {
-      node = new ConflictNode(id, ConflictNode.STALLSITE);
+      node = new ConflictNode(id, ConflictNode.STALLSITE, t.getVar(), t.getStallSite());
     }
     node.addEffect(as, e);
 
@@ -107,7 +108,7 @@ public class ConflictGraph {
     String id = invar + "_sese" + sese.getIdentifier();
     ConflictNode node = id2cn.get(id);
     if (node == null) {
-      node = new ConflictNode(id, ConflictNode.INVAR);
+      node = new ConflictNode(id, ConflictNode.INVAR, t.getVar(), t.getSESE());
     }
     node.addEffect(as, e);
 
@@ -436,6 +437,187 @@ public class ConflictGraph {
     return false;
   }
 
+  public boolean isFineElement(int type) {
+    if (type == ConflictNode.FINE_READ || type == ConflictNode.FINE_WRITE
+        || type == ConflictNode.PARENT_READ || type == ConflictNode.PARENT_WRITE) {
+      return true;
+    } else {
+      return false;
+    }
+  }
+
+  public SESEWaitingQueue getWaitingElementSetBySESEID(int seseID,
+ HashSet<SESELock> seseLockSet) {
+    
+    HashSet<WaitingElement> waitingElementSet = new HashSet<WaitingElement>();
+
+    Iterator iter = id2cn.entrySet().iterator();
+    while (iter.hasNext()) {
+      Entry entry = (Entry) iter.next();
+      String conflictNodeID = (String) entry.getKey();
+      ConflictNode node = (ConflictNode) entry.getValue();
+
+      if (node.isInVarNode()) {
+        if (node.getSESEIdentifier() == seseID) {
+
+          Set<ConflictEdge> edgeSet = node.getEdgeSet();
+          for (Iterator iterator = edgeSet.iterator(); iterator.hasNext();) {
+            ConflictEdge conflictEdge = (ConflictEdge) iterator.next();
+
+            for (Iterator<SESELock> seseLockIter = seseLockSet.iterator(); seseLockIter.hasNext();) {
+              SESELock seseLock = seseLockIter.next();
+              if (seseLock.containsConflictNode(node)
+                  && seseLock.containsConflictEdge(conflictEdge)) {
+                WaitingElement newElement = new WaitingElement();
+                newElement.setQueueID(seseLock.getID());
+                newElement.setStatus(seseLock.getNodeType(node));
+                if (isFineElement(newElement.getStatus())) {
+                  newElement.setDynID(node.getVar().toString());
+                  newElement.setTempDesc(node.getVar());
+                }
+                if (!waitingElementSet.contains(newElement)) {
+                  waitingElementSet.add(newElement);
+                }
+
+              }
+            }
+          }
+
+        }
+      }
+
+    }
+
+    // handle the case that multiple enqueues by an SESE for different live-in
+    // into the same queue
+    return refineQueue(waitingElementSet);
+//    return waitingElementSet;
+
+  }
+  
+  public SESEWaitingQueue refineQueue(Set<WaitingElement> waitingElementSet) {
+
+    Set<WaitingElement> refinedSet=new HashSet<WaitingElement>();
+    HashMap<Integer, Set<WaitingElement>> map = new HashMap<Integer, Set<WaitingElement>>();
+    SESEWaitingQueue seseDS=new SESEWaitingQueue();
+
+    for (Iterator iterator = waitingElementSet.iterator(); iterator
+        .hasNext();) {
+      WaitingElement waitingElement = (WaitingElement) iterator.next();
+      Set<WaitingElement> set=map.get(new Integer(waitingElement.getQueueID()));
+      if(set==null){
+        set=new HashSet<WaitingElement>();
+      }
+      set.add(waitingElement);
+      map.put(new Integer(waitingElement.getQueueID()), set);
+    }
+    
+    Set<Integer> keySet=map.keySet();
+    for (Iterator iterator = keySet.iterator(); iterator.hasNext();) {
+      Integer queueID = (Integer) iterator.next();
+      Set<WaitingElement> queueWEset=map.get(queueID);
+      refineQueue(queueID.intValue(),queueWEset,seseDS);      
+    }
+    
+    return seseDS;
+  }
+  
+  
+  private void refineQueue(int queueID,
+      Set<WaitingElement> waitingElementSet, SESEWaitingQueue seseDS) {
+
+    if (waitingElementSet.size() > 1) {
+      //only consider there is more than one element submitted by same SESE
+      Set<WaitingElement> refinedSet = new HashSet<WaitingElement>();
+
+      int numCoarse = 0;
+      int numRead = 0;
+      int numWrite = 0;
+      int total=waitingElementSet.size();
+      WaitingElement SCCelement = null;
+      WaitingElement coarseElement = null;
+
+      for (Iterator iterator = waitingElementSet.iterator(); iterator
+          .hasNext();) {
+        WaitingElement waitingElement = (WaitingElement) iterator
+            .next();
+        if (waitingElement.getStatus() == ConflictNode.FINE_READ) {
+          numRead++;
+        } else if (waitingElement.getStatus() == ConflictNode.FINE_WRITE) {
+          numWrite++;
+        } else if (waitingElement.getStatus() == ConflictNode.COARSE) {
+          numCoarse++;
+          coarseElement = waitingElement;
+        } else if (waitingElement.getStatus() == ConflictNode.SCC) {
+          SCCelement = waitingElement;
+        } 
+      }
+
+      if (SCCelement != null) {
+        // if there is at lease one SCC element, just enqueue SCC and
+        // ignore others.
+        refinedSet.add(SCCelement);
+      } else if (numCoarse == 1 && (numRead + numWrite == total)) {
+        // if one is a coarse, the othere are reads/write, enqueue SCC.
+        WaitingElement we = new WaitingElement();
+        we.setQueueID(queueID);
+        we.setStatus(ConflictNode.SCC);
+        refinedSet.add(we);
+      } else if (numCoarse == total) {
+        // if there are multiple coarses, enqueue just one coarse.
+        refinedSet.add(coarseElement);
+      } else if(numWrite==total || (numRead+numWrite)==total){
+        // code generator is going to handle the case for multiple writes & read/writes.
+        seseDS.setType(queueID, SESEWaitingQueue.EXCEPTION);
+        refinedSet.addAll(waitingElementSet);
+      } else{
+        // otherwise, enqueue everything.
+        refinedSet.addAll(waitingElementSet);
+      }
+      seseDS.setWaitingElementSet(queueID, refinedSet);
+    } else {
+      seseDS.setWaitingElementSet(queueID, waitingElementSet);
+    }
+    
+  }
+  
+  public Set<WaitingElement> getStallSiteWaitingElementSet(FlatNode stallSite,
+      HashSet<SESELock> seseLockSet) {
+
+    HashSet<WaitingElement> waitingElementSet = new HashSet<WaitingElement>();
+    Iterator iter = id2cn.entrySet().iterator();
+    while (iter.hasNext()) {
+      Entry entry = (Entry) iter.next();
+      String conflictNodeID = (String) entry.getKey();
+      ConflictNode node = (ConflictNode) entry.getValue();
+
+      if (node.isStallSiteNode() && node.getStallSiteFlatNode().equals(stallSite)) {
+        Set<ConflictEdge> edgeSet = node.getEdgeSet();
+        for (Iterator iter2 = edgeSet.iterator(); iter2.hasNext();) {
+          ConflictEdge conflictEdge = (ConflictEdge) iter2.next();
+
+          for (Iterator<SESELock> seseLockIter = seseLockSet.iterator(); seseLockIter.hasNext();) {
+            SESELock seseLock = seseLockIter.next();
+            if (seseLock.containsConflictNode(node) && seseLock.containsConflictEdge(conflictEdge)) {
+              WaitingElement newElement = new WaitingElement();
+              newElement.setQueueID(seseLock.getID());
+              newElement.setStatus(seseLock.getNodeType(node));
+              if (isFineElement(newElement.getStatus())) {
+                newElement.setDynID(node.getVar().toString());
+              }
+              waitingElementSet.add(newElement);
+            }
+          }
+
+        }
+
+      }
+
+    }
+
+    return waitingElementSet;
+  }
+
   public void writeGraph(String graphName, boolean filter) throws java.io.IOException {
 
     graphName = graphName.replaceAll("[\\W]", "");
@@ -463,7 +645,7 @@ public class ConflictGraph {
 
       String attributes = "[";
 
-      attributes += "label=\"ID" + node.getID() + "\\n";
+      attributes += "label=\"" + node.getID() + "\\n";
 
       if (node.isStallSiteNode()) {
         attributes += "STALL SITE" + "\\n" + "\"]";
@@ -491,8 +673,8 @@ public class ConflictGraph {
         }
 
         if (!addedSet.contains(conflictEdge)) {
-          bw.write(" " + u.getID() + "--" + v.getID() + "[label="
-              + conflictEdge.toGraphEdgeString() + ",decorate];\n");
+          bw.write("" + u.getID() + "--" + v.getID() + "[label=" + conflictEdge.toGraphEdgeString()
+              + ",decorate];\n");
           addedSet.add(conflictEdge);
         }
 
index 51908e43157fb9b2c56ac3966cfdd2ada9f62a10..7c7a24f0549b9479d486aeec7e82f1fc572f7e97 100644 (file)
@@ -8,6 +8,9 @@ import java.util.Set;
 import Analysis.Disjoint.AllocSite;
 import Analysis.Disjoint.Effect;
 import IR.Flat.FlatNew;
+import IR.Flat.FlatNode;
+import IR.Flat.FlatSESEEnterNode;
+import IR.Flat.TempDescriptor;
 
 public class ConflictNode {
 
@@ -19,8 +22,10 @@ public class ConflictNode {
   protected Hashtable<AllocSite, Set<Effect>> alloc2strongUpdateEffectSet;
 
   protected int nodeType;
-  protected int type;
   protected String id;
+  protected FlatNode stallSite;
+  protected TempDescriptor var;
+  protected FlatSESEEnterNode fsen;
 
   public static final int FINE_READ = 0;
   public static final int FINE_WRITE = 1;
@@ -32,8 +37,19 @@ public class ConflictNode {
 
   public static final int INVAR = 0;
   public static final int STALLSITE = 1;
+  
+  public ConflictNode(String id, int nodeType, TempDescriptor var, FlatNode stallSite){
+    this(id, var, nodeType);
+    this.stallSite=stallSite;    
+  }
+  
+  public ConflictNode(String id, int nodeType, TempDescriptor var, FlatSESEEnterNode fsen){
+    this(id, var, nodeType);
+    this.fsen=fsen;    
+  }
 
-  public ConflictNode(String id, int nodeType) {
+
+  public ConflictNode(String id, TempDescriptor var, int nodeType) {
     edgeSet = new HashSet<ConflictEdge>();
     // redundant views of access root's 
     // allocation sites for efficient retrieval
@@ -45,6 +61,7 @@ public class ConflictNode {
 
     this.id = id;
     this.nodeType = nodeType;
+    this.var=var;
   }
 
   public void addEffect(AllocSite as, Effect e) {
@@ -122,6 +139,10 @@ public class ConflictNode {
     }
     return fnSet;
   }
+  
+  public TempDescriptor getVar(){
+    return var;
+  }
 
   public Set<ConflictEdge> getEdgeSet() {
     return edgeSet;
@@ -131,14 +152,18 @@ public class ConflictNode {
     edgeSet.add(edge);
   }
 
-  public int getType() {
-    return type;
-  }
-
   public String getID() {
     return id;
   }
-
+  
+  public FlatNode getStallSiteFlatNode(){
+    return stallSite;
+  }
+  
+  public int getSESEIdentifier(){
+    return fsen.getIdentifier();
+  }
+  
   public boolean equals(Object o) {
 
     if (o == null) {
index d8ec7134528509b7901a45aa20ab247c57b90c4d..217f8266a0fc2bd96e76553502ae0a0a2f259db7 100644 (file)
@@ -1,5 +1,7 @@
 package Analysis.OoOJava;
 
+import java.io.BufferedWriter;
+import java.io.FileWriter;
 import java.io.IOException;
 import java.util.Enumeration;
 import java.util.HashSet;
@@ -223,7 +225,7 @@ public class OoOJavaAnalysis {
                            null, // don't do effects analysis again!
                            null  // don't do effects analysis again!
                            );
-
+writeConflictGraph();
     // 10th pass, calculate conflicts with reachability info
     calculateConflicts(null, true);
     
@@ -235,6 +237,14 @@ public class OoOJavaAnalysis {
     writeConflictGraph();
     */
     
+    if( state.OOODEBUG ) {      
+      try {
+        writeReports( "" );
+        disjointAnalysisTaints.getEffectsAnalysis().writeEffects( "effects.txt" );
+        writeConflictGraph();
+      } catch( IOException e ) {}
+    }
+    
   }
 
   private void livenessAnalysisBackward(FlatSESEEnterNode fsen, boolean toplevel,
@@ -1074,5 +1084,125 @@ public class OoOJavaAnalysis {
 
     conflictGraph2SESELock.put(conflictGraph, lockSet);
   }
+  
+  public void writeReports( String timeReport ) throws java.io.IOException {
+
+    BufferedWriter bw = new BufferedWriter( new FileWriter( "mlpReport_summary.txt" ) );
+    bw.write( "MLP Analysis Results\n\n" );
+    bw.write( timeReport+"\n\n" );
+    printSESEHierarchy( bw );
+    bw.write( "\n" );
+    printSESEInfo( bw );
+    bw.close();
+
+    Iterator<Descriptor> methItr = disjointAnalysisTaints.getDescriptorsToAnalyze().iterator();
+    while( methItr.hasNext() ) {
+      MethodDescriptor md = (MethodDescriptor) methItr.next();      
+      FlatMethod       fm = state.getMethodFlat( md );
+      if (fm!=null) {
+        bw =
+            new BufferedWriter(new FileWriter("mlpReport_" + md.getClassMethodName()
+                + md.getSafeMethodDescriptor() + ".txt"));
+        bw.write("MLP Results for " + md + "\n-------------------\n");
+
+        FlatSESEEnterNode implicitSESE = (FlatSESEEnterNode) fm.getNext(0);
+        if (!implicitSESE.getIsCallerSESEplaceholder() && implicitSESE != rblockRel.getMainSESE()) {
+          System.out.println(implicitSESE + " is not implicit?!");
+          System.exit(-1);
+        }
+        bw.write("Dynamic vars to manage:\n  " + implicitSESE.getDynamicVarSet());
+
+        bw.write("\n\nLive-In, Root View\n------------------\n" + fm.printMethod(livenessRootView));
+        bw.write("\n\nVariable Results-Out\n----------------\n" + fm.printMethod(variableResults));
+        bw.write("\n\nNot Available Results-Out\n---------------------\n"
+            + fm.printMethod(notAvailableResults));
+        bw.write("\n\nCode Plans\n----------\n" + fm.printMethod(codePlans));
+        bw.close();
+      }
+    }
+  }
+  
+  private void printSESEHierarchy( BufferedWriter bw ) throws java.io.IOException {
+    bw.write( "SESE Hierarchy\n--------------\n" ); 
+    Iterator<FlatSESEEnterNode> rootItr = rblockRel.getRootSESEs().iterator();
+    while( rootItr.hasNext() ) {
+      FlatSESEEnterNode root = rootItr.next();
+      if( root.getIsCallerSESEplaceholder() ) {
+  if( !root.getChildren().isEmpty() ) {
+    printSESEHierarchyTree( bw, root, 0 );
+  }
+      } else {
+  printSESEHierarchyTree( bw, root, 0 );
+      }
+    }
+  }
+
+  private void printSESEHierarchyTree( BufferedWriter bw,
+               FlatSESEEnterNode fsen,
+               int depth 
+             ) throws java.io.IOException {
+    for( int i = 0; i < depth; ++i ) {
+      bw.write( "  " );
+    }
+    bw.write( "- "+fsen.getPrettyIdentifier()+"\n" );
+
+    Iterator<FlatSESEEnterNode> childItr = fsen.getChildren().iterator();
+    while( childItr.hasNext() ) {
+      FlatSESEEnterNode fsenChild = childItr.next();
+      printSESEHierarchyTree( bw, fsenChild, depth + 1 );
+    }
+  }
+
+  
+  private void printSESEInfo( BufferedWriter bw ) throws java.io.IOException {
+    bw.write("\nSESE info\n-------------\n" ); 
+    Iterator<FlatSESEEnterNode> rootItr = rblockRel.getRootSESEs().iterator();
+    while( rootItr.hasNext() ) {
+      FlatSESEEnterNode root = rootItr.next();
+      if( root.getIsCallerSESEplaceholder() ) {
+  if( !root.getChildren().isEmpty() ) {
+    printSESEInfoTree( bw, root );
+  }
+      } else {
+  printSESEInfoTree( bw, root );
+      }
+    }
+  }
+
+  private void printSESEInfoTree( BufferedWriter bw,
+          FlatSESEEnterNode fsen 
+        ) throws java.io.IOException {
+
+    if( !fsen.getIsCallerSESEplaceholder() ) {
+      bw.write( "SESE "+fsen.getPrettyIdentifier()+" {\n" );
+
+      bw.write( "  in-set: "+fsen.getInVarSet()+"\n" );
+      Iterator<TempDescriptor> tItr = fsen.getInVarSet().iterator();
+      while( tItr.hasNext() ) {
+  TempDescriptor inVar = tItr.next();
+  if( fsen.getReadyInVarSet().contains( inVar ) ) {
+    bw.write( "    (ready)  "+inVar+"\n" );
+  }
+  if( fsen.getStaticInVarSet().contains( inVar ) ) {
+    bw.write( "    (static) "+inVar+" from "+
+                    fsen.getStaticInVarSrc( inVar )+"\n" );
+  } 
+  if( fsen.getDynamicInVarSet().contains( inVar ) ) {
+    bw.write( "    (dynamic)"+inVar+"\n" );
+  }
+      }
+      
+      bw.write( "   Dynamic vars to manage: "+fsen.getDynamicVarSet()+"\n");
+      
+      bw.write( "  out-set: "+fsen.getOutVarSet()+"\n" );
+      bw.write( "}\n" );
+    }
+
+    Iterator<FlatSESEEnterNode> childItr = fsen.getChildren().iterator();
+    while( childItr.hasNext() ) {
+      FlatSESEEnterNode fsenChild = childItr.next();
+      printSESEInfoTree( bw, fsenChild );
+    }
+  }
 
 }
index 5891bb0cafef6d5e3c5390fb74af9a8e6c61c20e..b69dc6c35ce42dd96f295a8489cdabc52131f318 100644 (file)
@@ -64,54 +64,6 @@ public class SESELock {
     return false;
   }
 
-  private boolean isFineNode(ConflictNode node) {
-
-    if (node.getType() < 4) {
-      return true;
-    }
-
-    return false;
-
-  }
-
-  public ConflictNode getNewNodeCoarseConnectedWithGroup(ConflictEdge newEdge) {
-
-    // check whether or not the new node has a fine-grained edges to all
-    // current nodes.
-
-    ConflictNode newNode;
-    if (conflictNodeSet.contains(newEdge.getVertexU())) {
-      newNode = newEdge.getVertexV();
-    } else if (conflictNodeSet.contains(newEdge.getVertexV())) {
-      newNode = newEdge.getVertexU();
-    } else {
-      return null;
-    }
-
-    int count = 0;
-    Set<ConflictEdge> edgeSet = newNode.getEdgeSet();
-    for (Iterator iterator = edgeSet.iterator(); iterator.hasNext();) {
-      ConflictEdge conflictEdge = (ConflictEdge) iterator.next();
-      if (!conflictEdge.getVertexU().equals(newNode)
-          && conflictNodeSet.contains(conflictEdge.getVertexU())
-          && isFineNode(conflictEdge.getVertexU())) {
-        count++;
-      } else if (!conflictEdge.getVertexV().equals(newNode)
-          && conflictNodeSet.contains(conflictEdge.getVertexV())
-          && isFineNode(conflictEdge.getVertexU())) {
-        count++;
-      }
-    }
-
-    if (count == conflictNodeSet.size()) {
-      // connected to all current nodes in group
-      return newNode;
-    }
-
-    return null;
-
-  }
-
   public ConflictNode getNewNodeConnectedWithGroup(ConflictEdge newEdge) {
 
     // check whether or not the new node has a fine-grained edges to all
diff --git a/Robust/src/Analysis/OoOJava/SESEWaitingQueue.java b/Robust/src/Analysis/OoOJava/SESEWaitingQueue.java
new file mode 100644 (file)
index 0000000..215fc97
--- /dev/null
@@ -0,0 +1,53 @@
+package Analysis.OoOJava;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Set;
+
+public class SESEWaitingQueue {
+       public static final int NORMAL= 0; // enqueue all stuff.
+       public static final int EXCEPTION= 1; // dynamically decide whether a waiting element is enqueued or not.
+       
+       private HashMap<Integer, Set<WaitingElement>>mapWaitingElement;
+       private HashMap<Integer, Integer>mapType;
+       
+       public SESEWaitingQueue(){
+               mapWaitingElement=new HashMap<Integer, Set<WaitingElement>>();
+               mapType=new HashMap<Integer, Integer>();
+       }
+       
+       public void setType(int queueID, int type){
+               mapType.put(new Integer(queueID), new Integer(type));
+       }
+       
+       public int getType(int queueID){
+               Integer type=mapType.get(new Integer(queueID));
+               if(type==null){
+                       return SESEWaitingQueue.NORMAL;
+               }else{
+                       return type.intValue();
+               }
+       }
+       
+       public void setWaitingElementSet(int queueID, Set<WaitingElement> set){
+               mapWaitingElement.put(new Integer(queueID), set);
+       }
+       
+       public Set<WaitingElement> getWaitingElementSet(int queueID){
+               return mapWaitingElement.get(new Integer(queueID));
+       }
+       
+       public Set<Integer> getQueueIDSet(){
+               return mapWaitingElement.keySet();
+       }
+       
+       public int getWaitingElementSize(){
+               int size=0;
+               Set<Integer> keySet=mapWaitingElement.keySet();
+               for (Iterator iterator = keySet.iterator(); iterator.hasNext();) {
+                       Integer key = (Integer) iterator.next();
+                       size+=mapWaitingElement.get(key).size();
+               }
+               return size;
+       }
+}
diff --git a/Robust/src/Analysis/OoOJava/WaitingElement.java b/Robust/src/Analysis/OoOJava/WaitingElement.java
new file mode 100644 (file)
index 0000000..35dc3b5
--- /dev/null
@@ -0,0 +1,83 @@
+package Analysis.OoOJava;
+
+import IR.Flat.TempDescriptor;
+
+public class WaitingElement {
+
+       private int queueID;
+       private int status;
+       private String dynID="";
+       private TempDescriptor tempDesc;
+       
+       public void setTempDesc(TempDescriptor tempDesc){
+               this.tempDesc=tempDesc;
+       }
+       
+       public TempDescriptor getTempDesc(){
+               return tempDesc;
+       }
+
+       public void setQueueID(int queueID) {
+               this.queueID = queueID;
+       }
+       
+       public String getDynID(){
+               return dynID;
+       }
+       
+       public void setDynID(String dynID){
+               this.dynID=dynID;
+       }
+       
+       public int getQueueID() {
+               return queueID;
+       }
+
+       public void setStatus(int status) {
+               this.status = status;
+       }
+
+       public int getStatus() {
+               return status;
+       }
+
+       public boolean equals(Object o) {
+
+               if (o == null) {
+                       return false;
+               }
+
+               if (!(o instanceof WaitingElement)) {
+                       return false;
+               }
+
+               WaitingElement in = (WaitingElement) o;
+
+               if (queueID == in.getQueueID() && status == in.getStatus() && dynID.equals(in.getDynID()) ) {
+                       return true;
+               } else {
+                       return false;
+               }
+
+       }
+
+       public String toString() {
+               return "[waitingID=" + queueID + " status=" + status + " dynID="
+                               + dynID + "]";
+       }
+
+       public int hashCode() {
+
+               int hash = 1;
+
+               hash = hash * 31 + queueID;
+
+               hash += status;
+               
+               hash += dynID.hashCode();
+
+               return hash;
+
+       }
+
+}
\ No newline at end of file
index ce99bd955e590aa9ce630bf4cf681914f4f93910..bdfb0ec0d7d314adb5c350549f9617bbaa92db9b 100644 (file)
@@ -101,6 +101,7 @@ public class State {
   public boolean DISJOINTDEBUGSCHEDULING=false;
 
   public boolean OOOJAVA=false;
+  public boolean OOODEBUG=false;
 
 
   public boolean OPTIONAL=false;
index 06adf6105c20a41445cc6bcd6232c64dd81bc1a3..cef1023a9341bb6b06d93ea9d7ed31db17d43d28 100644 (file)
@@ -325,7 +325,9 @@ public class Main {
        state.OOOJAVA  = true;
        state.DISJOINT = true;
 
-      }else if (option.equals("-help")) {
+      } else if (option.equals("-ooodebug") ){ 
+  state.OOODEBUG  = true;
+      } else if (option.equals("-help")) {
        System.out.println("-classlibrary classlibrarydirectory -- directory where classlibrary is located");
        System.out.println("-selfloop task -- this task doesn't self loop its parameters forever");
        System.out.println("-dir outputdirectory -- output code in outputdirectory");