state.MULTICORE=true;
else if (option.equals("-ownership"))
state.OWNERSHIP=true;
+ else if (option.equals("-ownallocdepth")) {
+ state.OWNERSHIPALLOCDEPTH=Integer.parseInt(args[++i]);
+ } else if (option.equals("-ownwritedots")) {
+ state.OWNERSHIPWRITEDOTS=true;
+ if (args[++i].equals("all")) {
+ state.OWNERSHIPWRITEALL=true;
+ }
+ } else if (option.equals("-ownaliasfile"))
+ state.OWNERSHIPALIASFILE=args[++i];
else if (option.equals("-optional"))
state.OPTIONAL=true;
else if (option.equals("-raw"))
System.out.println("-flatirlibmethods -- create dot files for flat IR graphs of library class methods");
System.out.println(" note: -flatirusermethods or -flatirlibmethods currently generate all class method flat IR graphs");
System.out.println("-ownership -- do ownership analysis");
+ System.out.println("-ownallocdepth <d> -- set allocation depth for ownership analysis");
+ System.out.println("-ownwritedots <all/final> -- write ownership graphs; can be all results or just final results");
+ System.out.println("-ownaliasfile <filename> -- write a text file showing all detected aliases in program tasks");
System.out.println("-optional -- enable optional arguments");
System.out.println("-webinterface -- enable web interface");
System.out.println("-help -- print out help");
readSourceFile(state, ClassLibraryPrefix+"gnu/Random.java");
readSourceFile(state, ClassLibraryPrefix+"Vector.java");
readSourceFile(state, ClassLibraryPrefix+"Enumeration.java");
+ readSourceFile(state, ClassLibraryPrefix+"Dictionary.java");
+ readSourceFile(state, ClassLibraryPrefix+"Writer.java");
+ readSourceFile(state, ClassLibraryPrefix+"BufferedWriter.java");
+ readSourceFile(state, ClassLibraryPrefix+"OutputStreamWriter.java");
+ readSourceFile(state, ClassLibraryPrefix+"FileWriter.java");
+ readSourceFile(state, ClassLibraryPrefix+"Date.java");
if (state.TASK) {
readSourceFile(state, ClassLibraryPrefix+"Object.java");
int tint = 0;
for(Iterator it_classes=state.getClassSymbolTable().getDescriptorsIterator(); it_classes.hasNext();) {
ClassDescriptor cd=(ClassDescriptor) it_classes.next();
- if(cd.hasFlags()){
+ if(cd.hasFlags()) {
Vector rootnodes=ta.getRootNodes(cd);
if(rootnodes!=null)
- for(Iterator it_rootnodes=rootnodes.iterator(); it_rootnodes.hasNext();){
+ for(Iterator it_rootnodes=rootnodes.iterator(); it_rootnodes.hasNext();) {
FlagState root=(FlagState)it_rootnodes.next();
Vector allocatingTasks = root.getAllocatingTasks();
if(allocatingTasks != null) {
if(numEdges - j == 1) {
pfe.setProbability(total);
} else {
- if((total != 0) && (total != 1)){
+ if((total != 0) && (total != 1)) {
do {
tint = r.nextInt()%total;
} while(tint <= 0);
}
if (state.OWNERSHIP) {
- CallGraph callGraph = new CallGraph(state);
- int allocationDepth = 3;
- OwnershipAnalysis oa =
- new OwnershipAnalysis(state, callGraph, allocationDepth);
- //This was breaking the compile
- // oa.writeAllAliases( "identifiedAliases.txt" );
+ CallGraph callGraph = new CallGraph(state);
+ OwnershipAnalysis oa = new OwnershipAnalysis(state,
+ tu,
+ callGraph,
+ state.OWNERSHIPALLOCDEPTH,
+ state.OWNERSHIPWRITEDOTS,
+ state.OWNERSHIPWRITEALL,
+ state.OWNERSHIPALIASFILE);
}
System.exit(0);