Evolution of a Java just-in-time compiler for IA-32 platforms
IBM Journal of Research and Development, Sep-Nov 2004 by Suganuma, T, Ogasawara, T, Kawachiya, K, Takeuchi, M, Et al
Java(TM) has gained widespread popularity in the industry, and an efficient Java virtual machine (JVM(TM)) and just-in-time (JIT) compiler are crucial in providing high performance for Java applications. This paper describes the design and implementation of our JIT compiler for IA-32 platforms by focusing on the recent advances achieved in the past several years. We first present the dynamic optimization framework, which focuses the expensive optimization efforts only on performance-critical methods, thus helping to manage the total compilation overhead. We then describe the platform-independent features, which include the conversion from the stack-semantic Java bytecode into our register-based intermediate representation (IR) and a variety of aggressive optimizations applied to the IR. We also present some techniques specific to the IA-32 used to improve code quality, especially for the efficient use of the small number of registers on that platform. Using several industry-standard benchmark programs, the experimental results show that our approach offers high performance with low compilation overhead. Most of the techniques presented here are included in the IBM JIT compiler product, integrated into the IBM Development Kit for Microsoft Windows�, Java Technology Edition Version 1.4.0.
Introduction
Java** has gained widespread popularity, and an efficient Java virtual machine (JVM**) and just-in-time (JIT) compiler are crucial in providing high performance for Java applications. Since the compilation time overhead of a JIT compiler, in contrast to that of a conventional static compiler, is included in the program execution time, JIT compilers should be designed to manage the conflicting requirements between fast compilation speed and fast execution performance. That is, we would like the system to generate highly efficient code for good performance, but at the same time, the system should be lightweight enough to avoid any startup delays or intermittent execution pauses caused by the runtime overhead of the dynamic compilation.
We previously described the design of version 3.0 of our JIT compiler [1] that was integrated into the IBM Development Kit (DK) 1.1.7. It was designed to apply only relatively lightweight optimizations equally to all of the methods so that compilation overhead would be minimized but competitive overall performance could still be achieved at the time of product release. We used an intermediate representation (IR) called extended bylecode (EBC)-a compact and stack-based representation similar to the original Java bytecode. The conversion from the bytecode to the IR is relatively straightforward. Using the IR, we performed both classic optimizations, such as constant propagation, dead code elimination, and common subexpression elimination, and Java-specific optimizations, such as exception check elimination. Without imposing a large impact on compilation overhead, we applied method inlining only to small target methods to alleviate the performance problem caused by frequent calls of relatively small methods. The dcvirtualization of virtual method call sites was performed using the guard code for testing the target method.
In the previous version, we also introduced a mixed-mode interpreter (MMI) to allow efficient mixed execution between interpreted mode and compiled code execution mode. We begin the program execution using the MMI as the first execution mode. When the frequently executed methods or critical hot spots1 of the program are identified using method invocation and loop iteration counters, we invoke the JIT compiler to obtain better performance for those selected methods. The MMI handles a large number of performance-insensitive methods, typically 80% or more of the executed methods in the program, and thus provides an efficient execution mode with no compilation overhead.
To achieve higher performance, we needed to apply more advanced optimization techniques, including aggressive method inlining, dataflow-based optimizations, loop optimizations, and more sophisticated register allocation. However, from the viewpoint of JIT compilers, these are all relatively expensive optimizations, and simply putting these optimizations in the existing JIT framework might have caused unacceptably high compilation overhead, typically large delays in application startup time. Using a two-level execution model with the MMI and a single-level, highly optimizing JIT compiler, the system would not be able to manage the balance between optimization effectiveness and compilation overhead because of the increasing gap of the tradeoff level between the two execution modes. It was therefore imperative to provide multiple, reasonable steps in the compilation levels with well-balanced tradeoffs between cost and expected performance, from which an adequate level of optimization could be selected that would correspond to the execution context.
In this paper, we describe the design and implementation of version 4.5 of our Java JIT compiler, specifically developed for IA-32 platforms, which has been integrated into the IBM DK 1.4.0. To manage the tradeoff, we did several things:
Most Recent Technology Articles
- INTERVIEW WITH BEN BUTTERS, DIRECTOR OF EUROPEAN AFFAIRS AT EUROCHAMBRES : "A PERFECT ROAD MAP FOR EU CLUSTERS DOES NOT EXIST".
- AGENDA.(Brief article)(Conference notes)
- FIGHT AGAINST INTERNET PIRACY.
- INTERNET : AUTHORS' SOCIETIES URGE ACTION AGAINST PIRACY.
- TELECOMMUNICATIONS : BUSINESSEUROPE HOSTILE TO FURTHER CONTRACTUAL OBLIGATIONS.(Brief article)
Most Recent Technology Publications
Most Popular Technology Articles
- BizRate to monitor in-store customer satisfaction for Office Depot stores - Market Intelligence
- Speed control of separately excited DC motor
- What is precision air conditioning and why is it necessary?
- Effects of creative, educational drama activities on developing oral skills in primary school children
- 3G: naughty or nice? PhoneErotica.com generates over 300 million hits per month, and rings up more minutes of use per month than MSN



