OpenJIT: An Open-Ended, Reflective JIT Compiler Framework for Java
OpenJIT is an open-ended, reflective JIT compiler framework for Java being researched and developed in a joint project by Tokyo Inst. Tech. and Fujitsu Ltd. Although in general self-descriptive systems have been studied in various contexts such as reflection and interpreter/compiler bootstrapping, OpenJIT is a first system we know to date that offers a stable, full-fledged Java JIT compiler that plugs into existing monolithic JVMs, and offer competitive performance to JITs typically written in C or C++. This is in contrast to previous work where compilation did not occur in the execution phase, customized VMs being developed ground-up, performance not competing with existing optimizing JIT compilers, and/or only a subset of the Java language being supported. The main contributions of this paper are, 1) we propose an architecture for a reflective JIT compiler on a monolithic VM, and identify the technical challenges as well as the techniques employed, 2) We define an API that adds to the existing JIT compiler APIs in “classic” JVM to allow reflective JITs to be constructed, 3) We show detailed benchmarks of run-time behavior of OpenJIT to demonstrate that, while being competitive with existing JITs the time- and space-overheads of compiler metaobjects that exist in the heap are small and manageable. Being an object-oriented compiler framework, OpenJIT can be configured to be small and portable or fully-fledged optimizing compiler framework in the spirit of SUIF. It is fully JCK compliant, and runs all large Java applications we have tested to date including HotJava. We are currently distributing OpenJIT for free to foster further research into advanced compiler optimization, compile-time reflection, advanced run-time support for languages, as well as other areas such as embedded computing, metacomputing, and ubiquitous computing.
KeywordsNative Code Distribute Shared Memory Intermediate Language Intermediate Code Distribute Shared Memory System
Unable to display preview. Download preview PDF.
- B. Alpern, D. Attanasio, A. Cocchi, D. Lieber, S. Smith, T. Ngo, and J. J. Barton. Implementing Jalapeno in Java. In Proceedings of OOPSLA’ 99, pages 314–324, November 1999.Google Scholar
- Y. Aridor, M. Factor, and A. Teperman. cJVM: a Single System Image of a JVM on a Cluster. In Proceedings of ICPP’ 99, September 1999.Google Scholar
- M. Atkinson, L. Daynes, M. Jordan, T. Printezis, and S. Spence. An Orthogonally Persistent Java. ACM SIGMOD Record, 25(4), December 1996.Google Scholar
- S. Chiba. A Metaobject Protocol for C++. In Proceedings of OOPSLA’ 95, pages 285–299, 1995.Google Scholar
- S. Chiba. Javassist-A Reflection-based Programming Wizard for Java. In Proceedings of OOPSLA’98 Workshop on Reflective Programming in C++ and Java, October 1998.Google Scholar
- S. Dieckman and U. Holzle. A Study of the Allocation Behavior of the SPECjvm98 Java Benchmarks. In Proceedings of ECOOP’ 99, pages 92–115, 1999.Google Scholar
- D. R. Engler and T. A. Proebsting. vcode: a retargetable, extensible, very fast dynamic ocde generation system. In Proceedings of PLDI’ 96, 1996.Google Scholar
- N. Fujinami. Automatic and Efficient Run-Time Code Generation Using Object-Oriented Languages. In Proceedings of ISCOPE’ 97, December 1997.Google Scholar
- A. Goldberg and D. Robson. Smalltalk-80: The Language and Its Implementation. Addison-Wesley, Reading, MA, 1983.Google Scholar
- M. Golm. metaXa and the Futre of Reflection. In Proceedings of OOPSLA’98 Workshop on Reflective Programming in C++ and Java, October 1998.Google Scholar
- B. Grant, M. Philipose, M. Mock, C. Chambers, and S. Eggers. An Evaluation of Staged Run-time Optimization in DyC. In Proceedings of PLDI’ 99, 1999.Google Scholar
- U. Holzle. Adaptive optimization for Self: Reconciling High Performance with Exploratory Programming. Technical Report STAN-CS-TR-94-1520, Stanford CSD, 1995.Google Scholar
- Y. Ichisugi and Y. Roudier. Extensible Java Preprocessor Kit and Tiny Data-Parallel Java. In Proceedings of ISCOPE’ 97, December 1997.Google Scholar
- D. Ingalls, T. Kaehler, J. Maloney, S. Wallace, and A. Kay. Back to the Future: The Story of Squeak-A Usable Small talk Written in Itself. In Proceedings of OOPSLA’ 97, pages 318–326, October 1997.Google Scholar
- M. Karaorman, U. Holzle, and J. Bruno. iContractor: A Reflective Java Library to Support Design by Contract. In Proceedings of Reflection’ 99, pages 175–196, July1999.Google Scholar
- G. Kiczales, J. Lamping, A. Mendhekar, C. Maeda, C. Lopes, J.-M. Loingtier, and J. Irwin. Aspect-Oriented Programming. In Proceedings of ECOOP’ 97, pages 220–242, 1997.Google Scholar
- H. Masuhara, S. Matsuoka, K. Asai, and A. Yonezawa. Compiling Away the Meta-Level in Object-Oriented Concurrent Reflective Languages Using Partial Evaluation. In Proceedings of OOPSLA’ 95, pages 57–64, October 1995.Google Scholar
- H. Masuhara and A. Yonezawa. Design and Partial Evaluation of Meta-objects for a Concurrent Reflective Language. In Proceedings of ECOOP’ 98, pages 418–439, July 1998.Google Scholar
- S. Matsuoka, H. Ogawa, K. Shimura, Y. Kimura, and K. Hotta. OpenJIT-A Reflective Java JIT Compiler. In Proceedings of OOPSLA’98 Workshop on Reflective Programming in C++ and Java, October 1998.Google Scholar
- H. Ogawa, K. Shimura, S. Matsuoka, F. Maruyama, Y. Sohda, and Y. Kimura. OpenJIT Frontend System: an implementation of the reflective JIT compiler frontend. LNCS 1826: Reflection and Software Engineering, 2000 (to appear).Google Scholar
- I. Piumarta and F. Riccardi. Optimizing Direct-threaded Code by Selective Inlining. In ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI’ 98), pages 291–300, June 1998.Google Scholar
- U. P. Schultz, J. L. Lawall, C. Consel, and G. Muller. Towards Automatic Specialization of Java Programs. In Proceedings of ECOOP’ 99, June 1999.Google Scholar
- K. Shimura. OpenJIT Backend Compiler. http://www.openjit.org/docs/backend-compiler/openjit-shimura-doc-1.pdf, June 1998.
- K. Shimura and Y. Kimura. Experimental development of java jit compiler. In IPSJ SIG Notes 96-ARC-120, pages 37–42, October 1996.Google Scholar
- K. Shimura and S. Matsuoka. OpenJIT Backend Compiler (Runtime) Internal Specification version 1.1.7. http://www.openjit.org/docs/backend-internal/index.html, October 1999.
- Y. Sohda, H. Ogawa, and S. Matsuoka. OMPC++-A Portable High-Performance Implementation of DSM using OpenC++ Reflection. In Proceedings of Reflection’ 99, pages 215–234, July 1999.Google Scholar
- M. Tatsubori and S. Chiba. Programming Support of Design Patterns with Compile-time Reflection. In Proceedings of OOPSLA’98 Workshop on Reflective Programming in C++ and Java, October 1998.Google Scholar
- Stanford University. SUIF Homepage. http://www-suif.stanford.edu/.
- E. N. Volanschi, C. Consel, and C. Cowan. Declarative Specialization of Object-Oriented Programs. In Proceedings of OOPSLA’ 97, pages 286–300, October 1997.Google Scholar
- I. Welch and R. Stroud. From Dalang to Kava-the Evolution of a Reflective Java Extention. In Proceedings of Reflection’ 99, pages 2–21, July 1999.Google Scholar
- M. Welsh and D. Culler. Jaguar: Enabling Efficient Communication and I/O from Java. Concurrency: Practice and Experience, December 1999. Special Issue on Java for High-Performance Applications.Google Scholar