An introduction to the basics of peephole optimization using Java Bytecode and JOOS.
JOOSA-src/: Source code for the A+ JOOS compiler (excluding the A+ patterns). It is thus more complete than the A- compiler distributed previously. For example, it supports for loops, increment expressions, and proper computation of stack heightpatterns.h: Source file containing all your patterns for this assignment. We have included a few sample patterns to get you started, but you should add many more!
JOOSexterns/: The.joosfiles that define the external signatures. They are included by the scriptsJOOSlib/: The.javafiles that serve as interfaces to Java functionalityjasmin.jar: A copy of jasmin, used by thejoosc.shscriptjooslib.jar: A copy of the JOOS libraryjoos.sh: Script that calls the joos compiler inJOOSA-src/directory. It produces one.jfile for each input.javafilejoosc.sh: Script that calls the joos compiler to generate the.jfiles and then calls jasmin to generate the.classfiles. You should be able to run those.classfiles with any Java system
PeepholeBenchmarks/: There are 6 benchmarks in this directory that you can use for testing your optimizations. Each benchmark contains a Makefile that you can use to compile. Optimizations are applied when invokingmake opt. Note that you must set the $PEEPDIR environment variable to directly invoke the Makefilecount.sh: Script that compiles all benchmarks with/without optimization and reports the bytecode size in both cases. This will likely be the sole command you run to compile and test