Phase 1
Installing the project
- Go in some directory /A/B/C which you would like to contain all your code
related to this project (phase 1 and all other phases). Execute
"cp /projects/proganalysis/SEII-project/phase1/phase1.tar ." there.
- tar xvf phase1.tar
This should create a new directory
"/A/B/C/project" with two subdirectories: "programs" and "phase1". Directory
"programs" contains 7 simple Java programs (both source code and bytecode).
Directory "phase1" contains a Perl script "run" that will be used to generate
the JIMPLE for these programs. The produced JIMPLE will be stored in "phase1".
Understanding and modifying the Perl script
Read the code in
"project/phase1/run". Things are pretty simple, you don't have to know anything
about Perl to figure out what is going on. The comments in the code contain info
about some minor changes you have to make to the script.
Generate JIMPLE
After making the changes in "run", execute it to invoke
Soot and to generate the JIMPLE representation for the 7 programs. To run the
script, go to "phase1" and type ./run (you may have to do chmod u+x
run first). You don't need to understand how the script invokes Soot.
Understand JIMPLE
Read the JIMPLE files for the 7 programs very
carefully. Try to understand the structure of the code, especially the 4
categories of calls (virtualinvoke, interfaceinvoke, specialinvoke,
staticinvoke). Also read the original Java source code (in directory "programs")
to make sure that you completely understand the semantics of the JIMPLE code. If
you have any questions, talk with me.
Class Hierarchy Analysis (CHA)
Print the JIMPLE code for the 7 programs
and manually simulate CHA for each program (as described in class). Try to
figure out the sequence of steps that CHA would take, the order in which it
would process the methods, the sequence of call graph edges/nodes it will
construct, etc. This is important because in the next phase of the project you
will implement CHA on top of Soot and will run it on the same set of 7 programs.
Phase 1 ensures that you understand how CHA should operate on JIMPLE.
Submit the call graphs
On March 7, bring to class the printouts from the
JIMPLE code, with the call graph computed by CHA. The easiest way to show the
call graphs is to take the printout and to draw an arrow from a call site to the
possible target methods. Any other representation of the call graph is OK, as
long as it clearly shows all call graph edges. Do not show call graph edges that
lead to methods in java.lang.Object
Additional Resources