LaTTe : An Open-Source Java Virtual Machine and Just-in-Time Compiler
A new version 0.9.1 with performance improvements is now publicly available!
Number of downloads (as of Jan. 2004) : 3,500+
Recently, Java became a prominent language with a wide application
spectrum, from embedded systems to enterprise servers. One of the
major issues in using Java is performance. The Java Virtual Machine
(JVM), a software layer to execute Java bytecodes, while providing
desirable features such as a "write-once, run anywhere model" for
software developers, and security and portability for end-users, does
not immediately lend itself to high performance. In order to
circumvent the JVM overhead, a technique called Just-in-Time (JIT)
compilation is used to implement a Java virtual machine. Through
JIT compilation, a bytecode method is translated into a native method
on the fly, so as to remove the interpretation overhead. Since the
JIT compilation itself is part of the total execution time of a Java
program, it must be fast and the benefit from compilation must
outweigh the JIT compilation overhead. Consequently, the
implementation of a Java virtual machine with a JIT compiler requires
many engineering choices.
LaTTe is a virtual machine which is able to execute Java
bytecode. It includes a novel JIT compiler targeted to RISC machines
(specifically the UltraSPARC). The JIT compiler generates RISC code
of good quality through a clever mapping of Java stack operands to
registers with a negligible overhead. Additionally, the runtime
components of LaTTe, including thread synchronization, exception
handling, and garbage collection, have been optimized. As a result,
the performance of LaTTe is competitive with that of
Sun's JDK 1.2 production release and
JDK 1.3 release candidate client/server VMs (HotSpot).
This site contains software from the LaTTe project, instructions on
how to use this software, a thorough description of the algorithms and
approaches used in LaTTe, as well as actual performance numbers we
have achieved thus far with LaTTe. We are releasing this software
subject to the conditions in the
license agreement (which is similar to
the BSD license) in the hope that a
wider community may better understand our work and expand upon it for
better performance and functionality. We also hope to promote our
open source JIT compiler for research on dynamic compilation.
LaTTe was created by the
MASS (Microprocessor Architecture and System Software) Laboratory
School of Electrical Engineering
Seoul National University,
as joint work with the
VLIW research group at
IBM T.J. Watson Research Center.
We have built LaTTe starting with code from Kaffe version 0.9.2, but
we have replaced most parts of the JVM, including the JIT compiler,
the garbage collector, monitor lock handling, and exception handling
are outlined separately), in a clean room environment.
LaTTe can be
from this site.
LaTTe runs on Solaris 2.5+ running on UltraSPARCs.
As a research prototype for the study of run-time compilation
techniques, LaTTe includes the following features:
- Fast and effective JIT translation with:
- efficient register mapping and allocation (i.e., consistently
taking one or two seconds for SPECjvm98 which runs 40-70 seconds with
- traditional optimizations (e.g., common subexpression elimination
and loop invariant code motion)
- object oriented optimizations (e.g., customization and limited specialization)
- A limited framework for adaptive compilation, which is currently
based on method run counts.
- A reasonably fast bytecode interpreter, intended to be used with
the adaptive compilation framework.
- Lightweight monitors.
- On-demand translation of exception handlers.
- A fast non-incremental garbage collector.
However, compared to other commercial Java virtual machines, LaTTe lacks the
- No AWT or Swing
- Not Java 2 (only supports 1.1).
- No bytecode verifier.
- Lacks JNI support.
- Incomplete class library.
- No support for JAR or compressed ZIP archives.
The current version, LaTTe 0.9.1, differs from the previous
version (0.9.0) in the following:
More than 850 downloads have been made for the previous version.
If you want to learn more about LaTTe, please take a look at the
(only browsable using Netscape Navigator or Microsoft Internet Explorer).
We invite volunteers worldwide to join our LaTTe open-source development
team and help us implement the exciting, leading edge JIT compiler, VM and
instruction level parallelism optimizations to come.
One on-going project where we would like help now is to integrate LaTTe
back into the current version of Kaffe.
- Addition of new optimizations such as faster class inclusion tests,
lookupswitch optimization, de-virtualization of method invocations, and
the use of native 64 bit instructions. These result in a 10% performance
improvement in our benchmarks.
- Refinements in exception handling.
- Improved garbage collector, which now does selective sweeping
We would like to thank the original developers of Kaffe, who
provided an initial code base for our implementation.
* Sun, Java, UltraSPARC, Solaris are trademarks of Sun Microsystems.