Ilya Sergey, Jan Midtgaard and Dave Clarke1
1Katholieke Universiteit Leuven, DistriNet, Dept. Computer Science
2Aarhus University, Dept. Computer Science
The dominance analysis is in the form of a front-end compiler. It takes a program in a subset of Java with ownership annotations as an input and returns a whole-program abstract dominance tree as an output in the from of Graphviz .gv
-file.
All tools needed (Scala compiler, Scala SDK, ScalaTest, etc.) are included into the archive with sources. You only need to have javac and Apache Ant installed in order to build. You also need Graphviz installed to see the result files. The ant script build.xml is located in the root folder of the archive. Inspect the README file for more information about the project structure and examples.
To build the jar file with the compiler, run
> ant rebuild.allor just
> antfrom the root folder of the unpacked archive.
To run compiler tests:
> ant run.tests
How to run the DominanceAnalysis
(make sure that DominanceAnalysis.jar
is included into your Java classpath):
> java DominanceAnalysis java-source-file.txt
It is also possible to specify the parameter k
for the
polyvariance (k
accounts to Shivers's call-sensitive
k-CFA and by default is equal to zero). For example, the line below runs the analysis via call-sensitive 2-CFA:
> java DominanceAnalysis -k 2 java-source-file.txtAs a result of the analysis, two new files will be produced in the same folder as
java-source-file.txt
:
java-source-file-unparse.txt
java-source-file-output-tree.gv
testdata
in the source archive. If an ownership argument is omitted, it is considered to be root by default.
Ilya Sergey, Jan Midtgaard and Dave Clarke, Report CW 615, Katholieke Universiteit Leuven, December 2011