JC Virtual Machine

Welcome to JC!

JC is a Java virtual machine implementation that converts class files into C source files using the Soot Java bytecode analysis framework, compiles them with GCC, and loads them using a built-in ELF object file loader. JC utilizes the GNU Classpath class library and provides a fairly complete Java runtime including sophisticated optimizations to increase runtime performance. JC also includes a bytecode interpreter, and supports execution in either or mixed modes.

Although JC has good interpreter performance, JC doesn't try to be fast in every situation. Instead, JC focuses on this question: how fast can we go if we know some or all of the class files ahead of time? The answer is: very fast! Optimizations that are just too complex and expensive to perform at runtime are instead performed at code generation time. JC's code generator is written in Java, using the powerful Soot bytecode analysis framework. When combined with the proven power of GCC's C optimizer the results are impressive. As an additional benefit, JC contains very little architecture-specific code and is highly portable.

JC features include:

♦ Conversion of Java bytecode into C and optimized compilation using GCC into ELF object files resulting in fast execution.
♦ Java bytecode interpreter with support for compiled, interpreted, and mixed mode execution.
♦ Sophisticated code generation optimizations including method inlining, allocation of non-escaping objects on the stack, method ``nonvirtualization,'' array bounds check elimination, redundant cast elimination, redundant null pointer check elimination, and class initialization check on first "active use" elimination.
♦ On-demand or pre-generated object creation, with the ability to create ``main class'' executables.
♦ Complete thread support based on the POSIX pthread(3) library, including Thread.interrupt(), Thread.suspend(), Thread.resume(), and Thread.stop().
♦ Complete Java Native Interface (JNI 1.4) support, plus a zero overhead JC Native Interface (JCNI).
♦ Complete Java 2 style class loader support, including class loader garbage collection and unloading.
♦ Complete Java reflection API implementation.
♦ Support for object finalization and for soft, weak, and phantom references.
♦ All object pointers are direct pointers. Non-copying "stop the world" mark and sweep garbage collector.
♦ Utilizes a stock installation of the GNU Classpath Java class library.
♦ Interface method dispatch using "quick" hash tables resulting in one extra pointer dereference (typically) over virtual method dispatch.
♦ Flexible usage of ELF object files: multiple ELF objects may be linked together into a single object file (JC will then load all of the defined types simultaneously); class files are not required once ELF objects have been generated from them.
♦ Use of the Soot framework for sophisticated bytecode analysis, optimization, and code generation.
♦ Innovative spin-free thin lock algorithm from SableVM.
♦ Use of signals for efficient detection of null pointer dereferences, divide by zero, and for inter-thread communication.

You can learn more about JC by reading the manual.

Latest News

13 Nov 2005 JC 1.4.7 is released. This is a minor bug-fix release. It also updates to Classpath version 0.19. See the CHANGES file for details.
23 Jul 2005 JC 1.4.6 is released. This is a minor bug-fix release. It also updates to Classpath version 0.17. See the CHANGES file for details.
15 May 2005 JC 1.4.5 is released. This is a minor bug-fix release. It also updates to Classpath version 0.15. See the CHANGES file for details.
10 May 2005 JC 1.4.4 is released. This release adds support for different calling conventions in generated JCNI code, and with this support enables passing of function parameters in the %eax, %edx, and %ecx registers on the i386 architecture. It also fixes a bug in method interface dispatch for certain methods having float parameters. See the CHANGES file for details.
25 Apr 2005 JC 1.4.3 is released. This is a maintenance release fixing a stack crawling bug on newer versions of FreeBSD. It also removes the dependence on libffi. See the CHANGES file for details.
14 Apr 2005 JC 1.4.2 is released. This is a maintenance release containing a couple of important bug fixes. See the CHANGES file for details.


Click here to download the jc-1.4.7.tgz distribution. You can read the installation instructions to get a feel for what's involved in building and installing JC.


The manual contains details about how JC works and is included in the distribution.

Also included is Javadoc documentation for the Java classes used by JC to generate ELF objects from class files.

Mailing List

Join the jcvm-general mailing list to participate in discussions and give feedback.

SourceForge project page

The JC project is hosted by SourceForge. Go to the jcvm SourceForge project page.

Hosted by: