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;
+ public static long lastTime;
+ public static void logEvent(String event) {
+ long currTime=System.nanoTime();
+ double delta=((double)(currTime-startTime))/1000000000;
+ double deltaLast=((double)(currTime-lastTime))/1000000000;
+ System.out.println("TLOG: Time of "+event+"="+delta);
+ System.out.println("TLOG: Elapsed time "+event+"="+deltaLast);
+ lastTime=currTime;
+ }
- public int lines;
+ public static void initTimer() {
+ startTime=System.nanoTime();
+ lastTime=startTime;
+ }
+
+ public int lines;
public State() {
this.classes=new SymbolTable();
this.tasks=new SymbolTable();
this.selfloops=new HashSet();
this.excprefetch=new HashSet();
this.classpath=new Vector();
+ this.fn2labelMap=new Hashtable();
this.lines=0;
}
/** 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;
public String OWNERSHIPDEBUGCALLEE=null;
public String OWNERSHIPDEBUGCALLER=null;
-
+
public boolean DISJOINT=false;
public int DISJOINTALLOCDEPTH=1;
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;
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;
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;
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;
public String outputdir = "/scratch/";
// MGC options
public boolean MGC=false;
-
+ public boolean OBJECTLOCKDEBUG=false;
+
//Other options
public String structfile;
public String main;
public Set parsetrees;
public Hashtable treemethodmap;
public Hashtable flatmethodmap;
+ SymbolTable methods2gen;
private HashSet arraytypes;
public Hashtable arraytonumber;
private int numclasses=1; // start from 1 instead of 0 for multicore gc
+ private int numinterfaces = 0;
private int numtasks=0;
private int numstaticblocks=0;
private int arraycount=0;
+ public Hashtable fn2labelMap;
public boolean OPTIMIZE=false;
+ public boolean LINENUM=false;
private Hashtable<ClassDescriptor, Hashtable<OptionalTaskDescriptor, OptionalTaskDescriptor>> optionaltaskdescriptors;
private Hashtable<ClassDescriptor, Hashtable<FlagState, Set<OptionalTaskDescriptor>>> analysisresults;
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");
classes.add(tdn);
- if(!tdn.isInterface()) {
+ if(tdn.isInterface()) {
+ numinterfaces++;
+ } else {
numclasses++;
}
if((tdn.numstaticfields != 0) || (tdn.numstaticblocks != 0)) {
sclasses.add(tdn);
}
}
-
+
public int numClasses() {
return numclasses;
}
-
+
+ public int numInterfaces() {
+ return numinterfaces;
+ }
+
public int numStaticBlocks() {
return numstaticblocks;
}
public SymbolTable getTaskSymbolTable() {
return tasks;
}
-
+
public SymbolTable getSClassSymbolTable() {
return sclasses;
}
tasks.add(td);
numtasks++;
}
+
+ public void setAnnotationRequireSet(Set<MethodDescriptor> set){
+ annotationRequireSet=set;
+ }
+
+ public Set<MethodDescriptor> getAnnotationRequireSet(){
+ return annotationRequireSet;
+ }
+
}