Just-In-Time Compilation and the Microsoft VM for Java Previous
Previous
Virtual Machine
Virtual Machine
Next
Next

The JIT Compiler/VM Interface

The following diagram describes the relationship between the JIT compiler and the Microsoft VM for Java.

The JIT compiler and the VM provide interfaces that both use to enable effective JIT compilation of code. The "compilation unit" for the JIT compiler is a single method. The decision of which particular method is compiled is made solely by the VM. Tools vendors might want to provide facilities in their tools (for example, via language constructs or UI) to augment .class files to indicate what methods to JIT (the precise format of such .class file attributes is TBD).

These interfaces are designed to allow clean separation and independence between the VM and the JIT compiler. This will enable other vendors to replace one JIT compiler with another, as appropriate.

The interfaces are given in full in the vm2jit.h header file. They cover direct access between the VM and the JIT compiler, as well as compile and run-time helper functions. Limited debugging of JIT compiled code is also provided for, but feedback from tools vendors and other JIT compiler writers is welcome.

Independent of the interface given in the header filer, a JIT compiler (vendor) can make the following assumptions.

At the same time, the code and data generated by a JIT-compiler for the Microsoft VM for Java must meet the following criteria.

It is up to the JIT compiler to decide whether it allows interruption by the garbage collector at any time or just while a method calls another method. The latter is certainly easier to implement and needs less information at run time, but in certain scenarios it could possibly disable the garbage collection process for an extended period of time (for example, a method executes a loop that does not contain a method call). In those cases the JIT compiler is required to insert code that (conditionally) invokes the garbage collector directly unless it can be determined that the code will execute method calls frequently enough. To give the JIT maximal flexibility, this decision can be made for every method individually.

Beyond just generating code for a method, the JIT must provide additional information to enable proper execution and debugging of Java applications. Depending on the type of information, that is done in two ways:



Top© 1996 Microsoft Corporation. All rights reserved.