Just-In-Time Compilation and the Microsoft Win32 VM for Java |
![]() Previous |
![]() Introduction |
![]() Index |
The following diagram illustrates 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 code compilation. The "compilation unit" for the JIT compiler is a single method. The VM alone decides which method to compile. Tools vendors might want to provide facilities in their tools (for example, through language constructs or user interface) to augment .class files so that they indicate which 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. <!-REMOVED 3/25/97 at request of Peter Kukol since this file is not provided in the SDK
The vm2jit.h header file gives the interfaces in full. 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 file, -->
A JIT compiler (vendor) can make the following assumptions.
At the same time, the code and data that a JIT compiler generates for the Microsoft VM for Java must meet the following criteria.
The JIT compiler decides whether to allow 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 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 must 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, it can make this decision 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:
© 1997 Microsoft Corporation. All rights reserved. Legal Notices.