Welcome!

Java Authors: Sharon Barkai, Elizabeth White, Liz McMillan, Pat Romanski, Kevin Benedict

Related Topics: Java, SOA & WOA

Java: Article

Graal, a Dynamic Java Compiler in the Works

A dynamic compiler in Java that produces excellent code quality without compromising memory usage

Graal is a compiler in Java that will work with Hotspot VM and Maxim VM. Currently the team (Oracle labs VM research team) is focused on integrating it into Hotspot VM and the effort is known as Graals VM. It's a new project to explore implementing a dynamic compiler in Java that can be used in a native JVM such as HotSpot as well as in a meta-circular JVM such as Maxine VM.

The Graal compiler allows Java libraries to extend their functionality to support customizations. For example, it enables custom optimization phases that we cannot achieve with the traditional Java compilers. It provides a Java API to control the compiler phases and it even allows us to introduce new phases, thus it opens the door for efficient implementations of new languages.

In addition, the Graal compiler is a bytecode-agnostic compiler. With Compiler Runtime Interface (CRI), the Graal compiler can work in different VMs written in multiple languages. It can work in Maxine VM as Maxine permits alternate implementations of subsystems such as compilation and GC, whereas Hotspot VM needs an adapter to permit the alternate compilation to be plugged-in.

Graal JVM is going to be a meta-circular JVM, meaning it will be implemented in Java and Java code runs on itself without requiring an additional virtual machine.

Traditionally JVMs are written in C or C++. Java implementation enables seamless integration between a virtual machine and application resources such as objects and threads.Think about coding in Java, compiling it using a compiler written in Java, and running it in a JVM, which is again written in Java- it's Java all the way and imagine the seamless integration between an application and a VM.

More Stories By Hari Gottipati

Hari K Gottipati is a software professional, consultant, speaker and freelance writer who specializes in Java, mobile computing, cloud computing, virtualization and Ajax. Proven Java enterprise lead, competitive analyst, technical architect and loves coding. Expert in analyzing market landscape for startup ideas and molding them into successful products with the technical/competitive advantage. Regularly writes for Syscon media, O'Reilly publications and his quotes can be often found in various technology news/magazines. Well known blogger and his blogs can be found at sys-con.com, onjava.com and xml.com. Speaks at various events on latest technologies including Mobile, Cloud computing, Ajax, Web 2.0, Web OS and of course Java. Hari serves on technical advisory board for various small to medium size companies where he provides technical vision for the future. Worked for many wireless startups, as well as big companies including Yahoo, Travelocity, and Motorola. Passionate about technologies and spends most of his time exploring bleeding edge software technologies.