7
Design of the Java HotSpot
TM
Client
Compiler for Java 6
THOMAS KOTZMANN, CHRISTIAN WIMMER
and HANSPETER M
¨
OSSENB
¨
OCK
Johannes Kepler University Linz
and
THOMAS RODRIGUEZ, KENNETH RUSSELL, and DAVID COX
Sun Microsystems, Inc.
Version 6 of Sun Microsystems’ Java HotSpot
TM
VM ships with a redesigned version of the client
just-in-time compiler that includes several research results of the last years. The client compiler
is at the heart of the VM configuration used by default for interactive desktop applications. For
such applications, low startup and pause times are more important than peak performance. This
paper outlines the new architecture of the client compiler and shows how it interacts with the
VM. It presents the intermediate representation that now uses static single-assignment (SSA)
form and the linear scan algorithm for global register allocation. Efficient support for exception
handling and deoptimization fulfills the demands that are imposed by the dynamic features of
the Java programming language. The evaluation shows that the new client compiler generates
better code in less time. The popular SPECjvm98 benchmark suite is executed 45% faster, while
the compilation speed is also up to 40% better. This indicates that a carefully selected set of global
optimizations can also be integrated in just-in-time compilers that focus on compilation speed and
not on peak performance. In addition, the paper presents the impact of several optimizations on
execution and compilation speed. As the source code is freely available, the Java HotSpot
TM
VM and
the client compiler are the ideal basis for experiments with new feedback-directed optimizations
in a production-level Java just-in-time compiler. The paper outlines research projects that add fast
algorithms for escape analysis, automatic object inlining, and array bounds check elimination.
Categories and Subject Descriptors: D.3.4 [Programming Languages]: Processors—Compilers,
Optimization, Code generation
General Terms: Algorithms, Languages, Performance
Additional Key Words and Phrases: Java, compiler, just-in-time compilation, optimization,
intermediate representation, register allocation, deoptimization
Authors’ addresses: Thomas Kotzmann, Christian Wimmer, and Hanspeter M
¨
ossenb
¨
ock, Institute
for System Software, Christian Doppler Laboratory for Automated Software Engineering, Johannes
Kepler University Linz, Austria; email: {kotzmann, wimmer, moessenboeck}@ssw.jku.at.
Thomas Rodriguez, Kenneth Russell, and David Cox, Sun Microsystems, Inc., 4140 Network Circle,
Santa Clara, CA 95054; email: {thomas.rodriguez, kenneth.russell, david.cox}@sun.com.
Permission to make digital or hard copies of part or all of this work for personal or classroom use is
granted without fee provided that copies are not made or distributed for profit or direct commercial
advantage and that copies show this notice on the first page or initial screen of a display along
with the full citation. Copyrights for components of this work owned by others than ACM must be
honored. Abstracting with credit is permitted. To copy otherwise, to republish, to post on servers,
to redistribute to lists, or to use any component of this work in other works requires prior specific
permission and/or a fee. Permissions may be requested from Publications Dept., ACM, Inc., 2 Penn
Plaza, Suite 701, New York, NY 10121-0701 USA, fax +1 (212) 869-0481, or permissions@acm.org.
C
2008 ACM 1544-3566/2008/05-ART7 $5.00 DOI 10.1145/1369396.1370017 http://doi.acm.org/
10.1145/1369396.1370017
ACM Transactions on Architecture and Code Optimization, Vol. 5, No. 1, Article 7, Publication date: May 2008.