Jeandle JDK or why developers bolt LLVM onto the Java Virtual Machine
Diving into the guts of HotSpot JVM's C2 compiler is not for the faint of heart. C2's C++ code was written over decades. It has accumulated a ton of specific optimizations, but maintaining it gets harder every year. At some point, Oracle's engineering team tried to make their lives easier with the Graal project, rewriting the JIT compiler in Java itself. The Jeandle project developers took a different approach: they decided to take the existing LLVM framework and make it the compilation engine for OpenJDK.

What is Jeandle and why does it need LLVM
Jeandle is an experimental JIT compiler for Java built directly on top of OpenJDK. Rather than relying on the built-in C1 or C2 compilers, it intercepts the execution of hot bytecode and passes it to LLVM's code generator.
Why bring LLVM into the Java Virtual Machine at all?
The main advantage of LLVM is the vast collection of low-level optimizations created by the global community for C, C++, and Rust. Automatic instruction vectorization, deep loop analysis, and optimizations tailored to specific processor features are all already present in LLVM and receive regular updates.
In traditional C2, every new optimization or support for a new processor architecture (like RISC-V) must be implemented manually. By combining OpenJDK with LLVM, the Jeandle authors aim to get a powerful machine code generator without rewriting optimizers from scratch.
How it works under the hood
The code processing in Jeandle is divided into several stages:
- The virtual machine tracks frequently called application methods.
- When a method's bytecode is deemed hot enough, Jeandle translates it into LLVM IR.
- LLVM's optimization passes are applied to the resulting IR code.
- LLVM compiles IR to native machine code for the target platform (x86_64, AArch64, etc.).
- The JVM swaps out the method reference, and execution continues with the compiled machine code.
The project repository includes thorough documentation. The guides directory contains system architecture descriptions, build instructions, and a separate debugging configuration document.
The developers exposed compiler behavior control through dedicated JVM flags. These flags allow adjusting optimization levels and requesting LLVM IR intermediate representation dumps during application runtime.
The main challenge with LLVM-based JIT
The idea of using LLVM in JIT compilers is not new. Similar attempts were made earlier in the Shark project for OpenJDK and the Falcon project at Azul. The main obstacle on this path is compilation speed itself.
LLVM was originally designed for ahead-of-time (AOT) compilation. In static compilers like Clang, the process can take minutes—the priority is that the final binary runs as fast as possible. In JIT mode, compilation time is critical. If LLVM starts spending a long time and meticulously optimizing each method, the application will simply freeze during the warmup phase.
Additionally, the Jeandle authors face a complex task of integrating with the Java runtime. The compiler needs to correctly handle safepoints for the garbage collector, work with memory barriers, and support dynamic class loading.
Current status and future outlook
Currently, Jeandle is in the active prototyping stage. The repository has accumulated around 460 stars and over 60 open issues. The code is not yet ready for production use, and the authors don't hide this.
Nevertheless, the project will be of interest to several categories of engineers:
- Those who are studying JVM internals and want to understand how JIT works with a real example.
- Compiler developers looking for practical LLVM IR integration use cases.
- Researchers creating custom optimization profiles for specific processor architectures.
The source code is open under the GPL v2.0 license. If you want to understand how to combine a Java Virtual Machine with a native compiler, check out the project documentation—it covers the build process and architectural decisions in detail.
Related projects