Phase 2

Install the project

This should create a new directory "/A/B/C/project/phase2" with a Perl script "run" and 5 Java classes (ChaMain.java, ...). Read "project/phase2/run". It is quite similar to the script from phase 1 — for example, you have to set the root directory again.

Generate JIMPLE

Make the appropriate changes in "run" — uncomment the call to genJimple and comment out the call to runCHA. Generate the JIMPLE for the 7 programs. Note than now the JIMPLE files are stored in a subdirectory.

Run CHA

First, compile the implementation: javac *.java. Then, edit the script and run CHA on each of the 7 programs. The implementation reads the JIMPLE files, creates in-memory representation for them, executes CHA on this representation, and writes the results to several text files. Note that it takes a while to process a program. This is because Soot loads the JIMPLE for many Java library classes, and it takes a while to process all of them. The actual CHA only takes a few seconds.

Examine the output

After running CHA, examine the following output files: There are two other output files hier_all and rmethods_all; ignore them for now.

Implement CHA

Complete the implementation of CHA, as described here.

Check Correctness

Compare the output of CHA with the call graphs you constructed manually during phase 1. Make sure that they are the same — i.e. the call graph nodes (file rmethods) and edges (file calls) are computed correctly.

Submit the results

Email to milanova@cs.rpi.edu all the source code, plus all subdirectories with files hier, rmethods, calls, hier_all, and rmethods_all. Since you are submitting by email, please DO NOT include JIMPLEs, .class files, and the run script.

Additional Resources