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 static void initTimer() {
+ startTime=System.nanoTime();
+ lastTime=startTime;
+ }
- public int lines;
+ public int lines;
public State() {
this.classes=new SymbolTable();
this.tasks=new SymbolTable();
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();
this.excprefetch=new HashSet();
this.classpath=new Vector();
this.cd2locationOrderMap=new Hashtable();
+ this.cd2locationPropertyMap=new Hashtable();
this.lines=0;
}
/** Boolean flag which indicates whether compiler is compiling a task-based
* program. */
+ public boolean JNI=false;
public boolean POINTER=false;
public boolean COREPROF=false;
public boolean WEBINTERFACE=false;
public String outputdir = "/scratch/";
// MGC options
public boolean MGC=false;
+ public boolean OBJECTLOCKDEBUG=false;
//Other options
public String structfile;
public Hashtable treemethodmap;
public Hashtable flatmethodmap;
SymbolTable methods2gen;
- boolean genAllMethods;
private HashSet arraytypes;
public Hashtable arraytonumber;
private int numclasses=1; // start from 1 instead of 0 for multicore gc
private int numstaticblocks=0;
private int arraycount=0;
public Hashtable cd2locationOrderMap;
+ public Hashtable cd2locationPropertyMap;
public boolean OPTIMIZE=false;
+ public boolean LINENUM=false;
private Hashtable<ClassDescriptor, Hashtable<OptionalTaskDescriptor, OptionalTaskDescriptor>> optionaltaskdescriptors;
private Hashtable<ClassDescriptor, Hashtable<FlagState, Set<OptionalTaskDescriptor>>> analysisresults;
TypeDescriptor td=new TypeDescriptor(n);
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()))
}
}
- 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;
}
return cd2locationOrderMap;
}
+ public void addLocationPropertySet(ClassDescriptor cd, Set<String> set){
+ cd2locationPropertyMap.put(cd,set);
+ }
+
+ public Hashtable getCd2LocationPropertyMap(){
+ return cd2locationPropertyMap;
+ }
+
}