I have a project for a class that involves implementing some basic optimizations for a compiler that is being built for the language JO99 (JO99 is a subset of the Java language). The stages of the compiler that have already been built are a scanner using Jlex, a parser using JavaCup, and a code generator. The purpose of this assignment is to perform two optimizations on the output of the second stage, and pass the optimized code on to the code generator, and measure the performance improvement. The two optimizations that are to be performed are Loop-Invariant Code Motion, and Dead Code Elimination. Explanations of both of these will be made available. Besides my code for the other stages of the compiler, along with this assignment are supplied code to construct a control flow graph, for pointer analysis, and a dataflow solver that constructs Def-Use chains. The output of the parser is in the form of an Abstract Syntax Tree, and the optimizations are to be performed directly on the AST, and the optimized AST is to be passed on to the code generator. Test cases to measure the improvement in performance are provided. This project may involve a little understanding of compilers, but the actual implementation of the algorithms should be straightforward. I will have questions about how the code works, and would like to be able to ask them and get explanations. My suggestion to make this easier, is to have you update me by sending me whatever code you have on a daily basis, so I can keep up to speed with what you're doing. That way I'll have less questions at the end, and will pay you sooner.
1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. 2) Documentation, either separately, or preferrably, with the code itself. 3) The results of running the tests - in any reasonable form that will enable me to analyze it 4) Possibly a short report with a description of each of the major tasks involved in each of the optimizations 5) Complete ownership and distribution copyrights to all work purchased.
Language to be used: Java Platform : Unix, Solaris