From IcedTea

Jump to: navigation, search


What is Zero?

Zero is an interpreter-only port of OpenJDK that uses no assembler and therefore can trivially be built on any Linux system.

Why was Zero written?

At present, OpenJDK only supports three processors: x86, x86-64 and SPARC. Linux distributions, however, typically support many more, and porting OpenJDK to a new platform is a non-trivial task. As an example, after the initial release of OpenJDK, Red Hat sponsored the creation of a PowerPC port. Getting this port to the state where it just worked -- where it could run basic applications very slowly -- required over 10,000 lines of very low-level, system-specific code, of which approximately 1,000 lines were assembler. This took of the order of half a person-year. Porting OpenJDK conventionally to every architecture the distributions wanted to support would have taken a considerable amount of time and resources. Zero -- the zero-assembler port -- was started as an experiment to see if an OpenJDK port could be written without using assembly code, such that it could be built on any Linux system without further porting work.

What is Shark?

Shark is a just-in-time (JIT) compiler for Zero.

Why was Shark written?

OpenJDK's virtual machine relies heavily on JIT compilation for performance. As an interpreter-only port of OpenJDK, Zero is very much slower than vanilla OpenJDK on the same hardware. Shark uses the LLVM compiler infrastructure to JIT compile Java methods without introducing system-specific code.

What architectures do Zero and Shark work on?

As of December 2008, Zero is known to work on Alpha, ARM, IA-64, MIPS, PowerPC, x86, x86-64 and zSeries.

Shark should be able to build on any Zero-supported system that LLVM has a JIT for. As of October 2009, this is ARM, PowerPC, x86 and x86-64.

What operating systems do Zero and Shark work on?

Zero is currently Linux- and GCC-specific.

What is the status of Zero and Shark?

Zero is stable. The bulk of its development was completed by March 2008, and while various bugs have been fixed in the meantime there have been no major reorganisations. In February 2009, OpenJDK builds using Zero passed the Java SE 6 TCK on 32- and 64-bit PowerPC. Zero was integrated into the main OpenJDK 7 tree in October 2009 and has been available in every release from build 76 onwards. Zero was backported into the OpenJDK 6 tree in March 2010, and has been available in every release from build 19 onwards.

Shark is stable on platforms with a stable LLVM JIT. In June 2010 an OpenJDK build using Shark passed the Java SE 6 TCK on x86-64. Shark was integrated into the main OpenJDK 7 tree in August 2010 and has been available in every release from build 112 onwards. Shark was backported into the OpenJDK 6 tree in August 2010 and has been available in every release from build 21 onwards.

How can I get hold of Zero and Shark?

The very latest versions of Zero and Shark can obtained by cloning the JDK7 hotspot-comp forest, though the latest OpenJDK 7 and OpenJDK 6 releases should be fairly up to date.

How do I build Zero and Shark?

To build Zero simply download IcedTea and follow its build instructions. Zero will be selected automatically if you're building on a platform OpenJDK does not support, and can be built on other platforms by adding --enable-zero to the ./configure options. Shark is not built by default; to build it you need to specify --enable-shark.

Where can I find out more?

Zero and Shark: a Zero-Assembly Port of OpenJDK is an article giving a nice overview of Zero and Shark.

Gary Benson is the main developer of Zero and Shark. His blog is chiefly about Zero and Shark, and his bug list is a good indication of what currently needs doing. As of January 2009 he is currently writing a series of technical articles called Inside Zero and Shark.

Zero and Shark have a dedicated mailing list,, but discussions relating to both often occur on too.

The #openjdk IRC channel is a good place to contact various people who are using and developing Zero and Shark.

Personal tools