have a debug flag
[IRC.git] / Robust / src / IR / State.java
index d340669bbc7748c8c616aba71bc463bc3946f65c..00679763478437d06bb1a3046c88586ea6c061d6 100644 (file)
@@ -3,9 +3,11 @@ import IR.Tree.*;
 import IR.Flat.*;
 import IR.*;
 import Util.Lattice;
+import Util.Pair;
 
 import java.util.*;
 import Analysis.TaskStateAnalysis.*;
+import Analysis.CallGraph.CallGraph;
 
 public class State {
   public static long startTime;
@@ -31,8 +33,6 @@ public class State {
     this.sclasses=new SymbolTable();
     this.treemethodmap=new Hashtable();
     this.flatmethodmap=new Hashtable();
-    this.genAllMethods = true;
-    this.methods2gen = new SymbolTable();
     this.parsetrees=new HashSet();
     this.arraytypes=new HashSet();
     this.arraytonumber=new Hashtable();
@@ -40,7 +40,7 @@ public class State {
     this.selfloops=new HashSet();
     this.excprefetch=new HashSet();
     this.classpath=new Vector();
-    this.cd2locationOrderMap=new Hashtable();
+    this.fn2labelMap=new Hashtable();
     this.lines=0;
   }
 
@@ -68,6 +68,8 @@ public class State {
 
   /** Boolean flag which indicates whether compiler is compiling a task-based
    * program. */
+  public boolean JNI=false;
+  public boolean CAPTURE_NULL_DEREFERENCES=false;
   public boolean POINTER=false;
   public boolean COREPROF=false;
   public boolean WEBINTERFACE=false;
@@ -92,7 +94,7 @@ public class State {
   public String OWNERSHIPDEBUGCALLEE=null;
   public String OWNERSHIPDEBUGCALLER=null;
 
-  
+
   public boolean DISJOINT=false;
 
   public int DISJOINTALLOCDEPTH=1;
@@ -121,8 +123,20 @@ public class State {
   public int DISJOINTSNAPVISITTOSTART=0;
   public int DISJOINTSNAPNUMVISITS=0;
   public boolean DISJOINTSNAPSTOPAFTER=false;
-
   public boolean DISJOINTDEBUGSCHEDULING=false;
+  public boolean DISJOINT_WRITE_ALL_NODE_FINAL_GRAPHS=false;
+  public boolean DISJOINT_COUNT_VISITS=false;
+  public boolean DISJOINT_COUNT_GRAPH_ELEMENTS=false;
+  public String DISJOINT_COUNT_GRAPH_ELEMENTS_FILE=null;
+
+  public boolean POINTSTO_CHECK_V_RUNTIME=false;
+
+  public boolean DO_DEFINITE_REACH_ANALYSIS=false;
+  public boolean DISJOINT_USE_GLOBAL_SWEEP=true;
+  public boolean DISJOINT_USE_STRONG_UPDATE=true;
+  public boolean DISJOINT_USE_PREDICATES=true;
+  public boolean DISJOINT_SUMMARIZE_PER_CLASS=false;
+
 
   public boolean OOOJAVA=false;
   public boolean OOODEBUG=false;
@@ -130,10 +144,17 @@ public class State {
   public boolean RCR_DEBUG=false;
   public boolean RCR_DEBUG_VERBOSE=false;
   public boolean NOSTALLTR=false;
-  
+
   //SSJava
   public boolean SSJAVA=false;
-
+  public boolean SSJAVADEBUG=false;
+  public boolean SSJAVAINFER=false;
+  public boolean SSJAVA_GENCODE_PREVENT_CRASHES=false;
+  public boolean SSJAVA_INJECT_ERROR=false;
+  public boolean SSJAVA_INFER_NAIVE_WRITEDOTS=false;
+  public int     SSJAVA_INV_ERROR_PROB=0;
+  public int     SSJAVA_ERROR_SEED=0;
+  public Set<MethodDescriptor> annotationRequireSet;
 
   public boolean OPTIONAL=false;
   public boolean NOLOOP=false;
@@ -146,7 +167,7 @@ public class State {
   public boolean METHODEFFECTS=false;
   public static double TRUEPROB=0.8;
   public static boolean PRINTFLAT=false;
-  
+
   //DSM options
   public boolean DSM=false;
   public boolean DSMTASK=false;
@@ -164,10 +185,11 @@ public class State {
   public boolean DELAYCOMP=false;
   public boolean DUALVIEW=false;
   public boolean HYBRID=false;
-  
+
   // Bamboo options
   public boolean MULTICORE=false;
   public boolean MULTICOREGC=false;
+  public boolean PMC=false;
   public boolean BAMBOOCOMPILETIME = false;
   public boolean ARRAYBOUNDARYCHECK=true;
   public boolean RAW=false;
@@ -183,7 +205,7 @@ public class State {
   // MGC options
   public boolean MGC=false;
   public boolean OBJECTLOCKDEBUG=false;
-  
+
   //Other options
   public String structfile;
   public String main;
@@ -199,7 +221,6 @@ public class State {
   public Hashtable treemethodmap;
   public Hashtable flatmethodmap;
   SymbolTable methods2gen;
-  public boolean genAllMethods;
   private HashSet arraytypes;
   public Hashtable arraytonumber;
   private int numclasses=1; // start from 1 instead of 0 for multicore gc
@@ -207,7 +228,7 @@ public class State {
   private int numtasks=0;
   private int numstaticblocks=0;
   private int arraycount=0;
-  public Hashtable cd2locationOrderMap;
+  public Hashtable fn2labelMap;
   public boolean OPTIMIZE=false;
   public boolean LINENUM=false;
 
@@ -257,6 +278,11 @@ public class State {
     return td;
   }
 
+  public static TypeDescriptor getTypeDescriptor(String n) {
+    TypeDescriptor td=new TypeDescriptor(n);
+    return td;
+  }
+
   public void addClass(ClassDescriptor tdn) {
     if (classes.contains(tdn.getSymbol()))
       throw new Error("Class "+tdn.getSymbol()+" defined twice");
@@ -270,30 +296,15 @@ public class State {
       sclasses.add(tdn);
     }
   }
-  
-  public void setGenAllMethods(boolean flag) {
-    this.genAllMethods = flag;
-  }
-  
-  public void addMethod2gen(MethodDescriptor md) {
-    if(this.genAllMethods) {
-      throw new Error("The state.genAllMethods is TRUE, do not need to check methods to genenrate");
-    }
-    this.methods2gen.add(md);
-  }
-  
-  public SymbolTable getMethod2gen() {
-    return this.methods2gen;
-  }
-  
+
   public int numClasses() {
     return numclasses;
   }
-  
+
   public int numInterfaces() {
     return numinterfaces;
   }
-  
+
   public int numStaticBlocks() {
     return numstaticblocks;
   }
@@ -313,7 +324,7 @@ public class State {
   public SymbolTable getTaskSymbolTable() {
     return tasks;
   }
-  
+
   public SymbolTable getSClassSymbolTable() {
     return sclasses;
   }
@@ -366,12 +377,12 @@ public class State {
     numtasks++;
   }
   
-  public void addLocationOrder(ClassDescriptor cd, Lattice order){
-    cd2locationOrderMap.put(cd,order);
+  public void setAnnotationRequireSet(Set<MethodDescriptor> set){
+    annotationRequireSet=set;
   }
   
-  public Hashtable getCd2LocationOrder(){
-    return cd2locationOrderMap;
+  public Set<MethodDescriptor> getAnnotationRequireSet(){
+    return annotationRequireSet;
   }
-  
+
 }