From: jjenista Date: Wed, 3 Sep 2008 23:44:37 +0000 (+0000) Subject: added ownership options X-Git-Tag: buildscript^6~48 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=9a03a8bad044c808bdbd5a3a6d9f21c1ba418f08;p=IRC.git added ownership options --- diff --git a/Robust/src/Analysis/OwnershipAnalysis/OwnershipAnalysis.java b/Robust/src/Analysis/OwnershipAnalysis/OwnershipAnalysis.java index 1c3707df..05a21976 100644 --- a/Robust/src/Analysis/OwnershipAnalysis/OwnershipAnalysis.java +++ b/Robust/src/Analysis/OwnershipAnalysis/OwnershipAnalysis.java @@ -203,8 +203,8 @@ public class OwnershipAnalysis { null, false); // for controlling DOT file output - private boolean writeFinalGraphs; - private boolean writeAllUpdates; + private boolean writeDOTs; + private boolean writeAllDOTs; @@ -214,15 +214,16 @@ public class OwnershipAnalysis { TypeUtil tu, CallGraph callGraph, int allocationDepth, - boolean writeFinalGraphs, - boolean writeAllUpdates) throws java.io.IOException { + boolean writeDOTs, + boolean writeAllDOTs, + String aliasFile) throws java.io.IOException { - this.state = state; - this.typeUtil = tu; - this.callGraph = callGraph; - this.allocationDepth = allocationDepth; - this.writeFinalGraphs = writeFinalGraphs; - this.writeAllUpdates = writeAllUpdates; + this.state = state; + this.typeUtil = tu; + this.callGraph = callGraph; + this.allocationDepth = allocationDepth; + this.writeDOTs = writeDOTs; + this.writeAllDOTs = writeAllDOTs; descriptorsToAnalyze = new HashSet(); @@ -238,7 +239,7 @@ public class OwnershipAnalysis { mapDescriptorToAllocationSiteSet = new Hashtable >(); - if( writeAllUpdates ) { + if( writeAllDOTs ) { mapDescriptorToNumUpdates = new Hashtable(); } @@ -279,7 +280,11 @@ public class OwnershipAnalysis { // a method if the methods that it calls are updated analyzeMethods(); - writeAllAliases("identifiedAliases.txt"); + System.out.println(""); + + if( aliasFile != null ) { + writeAllAliases(aliasFile); + } } // called from the constructor to help initialize the set @@ -613,9 +618,9 @@ public class OwnershipAnalysis { // boolean pruneGarbage, // boolean writeReferencers - if( writeFinalGraphs ) { + if( writeDOTs ) { - if( !writeAllUpdates ) { + if( !writeAllDOTs ) { og.writeGraph(d, true, true, true, false); } else { diff --git a/Robust/src/IR/State.java b/Robust/src/IR/State.java index c700c7ff..aed4c2d5 100644 --- a/Robust/src/IR/State.java +++ b/Robust/src/IR/State.java @@ -54,6 +54,10 @@ public class State { public boolean FLATIRGRAPHLIBMETHODS=false; public boolean MULTICORE=false; public boolean OWNERSHIP=false; + public int OWNERSHIPALLOCDEPTH=3; + public boolean OWNERSHIPWRITEDOTS=false; + public boolean OWNERSHIPWRITEALL=false; + public String OWNERSHIPALIASFILE=null; public boolean OPTIONAL=false; public boolean RAW=false; public boolean SCHEDULING=false; diff --git a/Robust/src/Main/Main.java b/Robust/src/Main/Main.java index 6620e41b..05e5c99c 100644 --- a/Robust/src/Main/Main.java +++ b/Robust/src/Main/Main.java @@ -96,6 +96,15 @@ public class Main { 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")) @@ -130,6 +139,9 @@ public class Main { 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 -- set allocation depth for ownership analysis"); + System.out.println("-ownwritedots -- write ownership graphs; can be all results or just final results"); + System.out.println("-ownaliasfile -- 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"); @@ -450,11 +462,14 @@ public class Main { } if (state.OWNERSHIP) { - CallGraph callGraph = new CallGraph(state); - int allocationDepth = 3; - OwnershipAnalysis oa = - new OwnershipAnalysis(state, tu, callGraph, allocationDepth, true, false); - // 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); diff --git a/Robust/src/Runtime/multicoretask.c b/Robust/src/Runtime/multicoretask.c index df467696..5bee1d18 100644 --- a/Robust/src/Runtime/multicoretask.c +++ b/Robust/src/Runtime/multicoretask.c @@ -3404,7 +3404,7 @@ parameterpresent: }*/ /* Actually call task */ #ifdef PRECISE_GC - ((int *)taskpointerarray)[0]=currtpd->numParameters; + ((int *)taskpointerarray)[0]=currtpd->numParameters; taskpointerarray[1]=NULL; #endif execute: diff --git a/Robust/src/Runtime/task.c b/Robust/src/Runtime/task.c index e5477132..fc2ad5fd 100644 --- a/Robust/src/Runtime/task.c +++ b/Robust/src/Runtime/task.c @@ -1200,7 +1200,7 @@ parameterpresent: } /* Actually call task */ #ifdef PRECISE_GC - ((int *)taskpointerarray)[0]=currtpd->numParameters; + ((int *)taskpointerarray)[0]=currtpd->numParameters; taskpointerarray[1]=NULL; #endif #ifdef OPTIONAL