The A- implementation only uses 4 peephole patterns. The generated code is pretty bad when compared with javac. There are many more patterns that can help the optimizer reduce the size of the generated bytecode. For this deliverable you must repeatedly examine the Jasmin assembly (.j) files produced by the A- and A+ joos compilers, identify as many peephole patterns as you can, and implement them following the templates in patterns.h. As you implement patterns and shrink the generated code, you will find even more patterns that you can exploit. You should examine optimize.c to see the various primitives you can use in your patterns. In particular, a pattern may only use the given operations on the goto graph and the makeCODExxx constructors defined in tree.h. Extensions are of course possible, but they must be clearly documented. You will be graded on the 2009 JOOS benchmarks, however you can also try your optimizations with the 2010 and 2011 benchmarks if that helps (all of them are in the GitHub repository). We expect you to at least reach the A+ compiler. Anything better would be nice.

See the instructions for running the benchmarks.

You should check in the following: