Flex is a compiler written in Java for Java. Native backends exist for the StrongARM and MIPS processors. It is also possible to generate C code. It supports both Boehm-Demers-Weiser conservative garbage collection and our own precise garbage collector. We also support region-based allocation via our implementation of the Real-Time Specification for Java. It fully supports several implementations of the standard Java threads package, including a standard heavyweight threads implementation as well as a lightweight user-level implementation. It provides a range of standard compiler analyses and optimizations.
The Flex distribution is available here, distributed under the GNU GPL. The distribution includes source code, the runtime system, and documentation.
We have used the Flex compiler system as a platform for our pointer and escape analysis research. Here are several publications that use Flex:
Presents a new pointer and escape analysis. Instead of analyzing the whole program, the algorithm incrementally analyzes only those parts of the program that may deliver useful results. An analysis policy monitors the analysis results to direct the incremental investment of analysis resources to those parts of the program that offer the highest expected optimization return.
The experimental results show that almost all of the objects are allocated at a small number of allocation sites and that an incremental analysis of a small region of the program surrounding each site can deliver almost all of the benefit of a whole-program analysis. The policy is usually able to deliver this benefit at a fraction of the whole-program analysis cost.
Presents a combined pointer and escape analysis for Java programs with unstructured multithreading. The algorithm analyzes interactions between threads to obtain precise points-to and escape information for objects accessible to multiple threads. The results are used for synchronization elimination and elimination of dynamic checks associated with the use of region-based memory allocation.