ABSTRACT
The design of new programming languages benefits from interpretation, which can provide a simple initial implementation, flexibility to explore new language features, and portability to many platforms. The only downside is speed of execution, as there remains a large performance gap between even efficient interpreters and mixed-mode systems that include a just-in-time compiler (or JIT for short). Augmenting an interpreter with a JIT, however, is not a small task. Today, JITs used for Java™ are loosely-coupled with the interpreter, with callsites of methods being the only transition point between interpreted and native code. To compile whole methods, the JIT must duplicate a sizable amount of functionality already provided by the interpreter, leading to a "big bang" development effort before the JIT can be deployed. Instead, adding a JIT to an interpreter would be easier if it were possible to leverage the existing functionality.
In earlier work we showed that packaging virtual instructions as lightweight callable routines is an efficient way to build an interpreter. In this paper we describe how callable bodies help our interpreter to efficiently identify and run traces. Our closely coupled dynamic compiler can fall back on the interpreter in various ways, permitting an incremental approach in which additional performance gains can be realized as it is extended in two dimensions: (i) generating code for more types of virtual instructions, and (ii) identifying larger compilation units. Currently, Yeti identifies straight line regions of code and traces, and generates non-optimized code for roughly 50 Java integer and object bytecodes. Yeti runs roughly twice as fast as a direct-threaded interpreter on SPECjvm98 benchmarks.
- V. Bala, E. Duesterwald, and S. Banerjia. Dynamo: A transparent dynamic optimization system. In Proc. of the ACM SIGPLAN 2000 Conf. on Prog. Language Design and Impl., pages 1--12, Jun. 2000. Google ScholarDigital Library
- M. Berndl, B. Vitale, M. Zaleski, and A. D. Brown. Context threading: A flexible and efficient dispatch technique for virtual machine interpreters. In Proc. of the 3rd Intl. Symp. on Code Generation and Optimization, pages 15--26, Mar. 2005. Google ScholarDigital Library
- D. Bruening and E. Duesterwald. Exploring optimal compilation unit shapes for an embedded just-in-time compiler. In Proc. of the 3rd ACM Workshop on Feedback-Directed and Dynamic Optimization (FDDO-3), Dec. 2000.Google Scholar
- D. Bruening, T. Garnett, and S. Amarasinghe. An infrastructure for adaptive dynamic optimization. In Proc. of the 1st Intl. Symp. on Code Generation and Optimization, pages 265--275, Mar. 2003. Google ScholarDigital Library
- W.-K. Chen, S. Lerner, R. Chaiken, and D. Gillies. Mojo: A dynamic optimization system. In Proc. of the 3rd ACMWorkshop on Feedback-Directed and Dynamic Optimization (FDDO-3), Dec. 2000.Google Scholar
- J. C. Dehnert, B. K. Grant, J. P. Banning, R. Johnson, T. Kistler, A. Klaiber, and J. Mattson. The Transmeta code morphing software: Using speculation, recovery, and adaptive retranslation to address real-life challenges. In Proc. of the 1st Intl. Symp. on Code Generation and Optimization, pages 15--24, Mar. 2003. Google ScholarDigital Library
- K. Driesen. Efficient Polymorphic Calls. Klumer Academic Publishers, 2001. Google ScholarDigital Library
- E. Duesterwald and V. Bala. Software profiling for hot path prediction: less is more. ACM SIGPLAN Notices, 35(11):202--211, 2000. Google ScholarDigital Library
- M. A. Ertl. Stack caching for interpreters. In Proc. of the ACM SIGPLAN 1995 Conf. on Prog. Language Design and Impl., pages 315--327, June 1995. Google ScholarDigital Library
- M. A. Ertl and D. Gregg. Optimizing indirect branch prediction accuracy in virtual machine interpreters. In Proc. of the ACM SIGPLAN 2003 Conf. on Prog. Language Design and Impl., pages 278--288, June 2003. Google ScholarDigital Library
- E. Gagnon and L. Hendren. Effective inline threading of Java bytecode using preparation sequences. In Proc. of the 12th Intl. Conf. on Compiler Construction, volume 2622 of Lecture Notes in Computer Science, pages 170--184. Springer, Apr. 2003. Google ScholarDigital Library
- A. Gal, C. W. Probst, and M. Franz. HotpathVM: an effective JIT compiler for resource-constrained devices. In Proc. of the 2nd Intl. Conf. on Virtual Execution Environments, pages 144--153, 2006. Google ScholarDigital Library
- K. Hazelwood and D. Grove. Adaptive online context-sensitive inlining. In Proc. of the 1st Intl. Symp. on Code Generation and Optimization, pages 253--264, Mar. 2003. Google ScholarDigital Library
- D. Hiniker, K. Hazelwood, and M. D. Smith. Improving region selection in dynamic optimization systems. In Proc. of the 38th Intl. Symp. on Microarchitecture, pages 141--154, Nov. 2005. Google ScholarDigital Library
- U. Hölzle. Adaptive Optimization For Self:Reconciling High Performance With Exploratory Programming. PhD thesis, Stanford University, 1994.Google Scholar
- R. Lougher. JamVM {online}. Available from: http://jamvm.sourceforge.net/.Google Scholar
- M. Paleczny, C. Vick, and C. Click. The Java HotSpot™ server compiler. In Proc. of the USENIX Java Virtual Machine Research and Technology Symposium, pages 1--12, Apr. 2001. Google ScholarDigital Library
- I. Pechtchanski and V. Sarkar. Dynamic optimistic interprocedural analysis: A framework and an application. In Proc. of the 16th ACM SIGPLAN Conf. on Object-Oriented Programming, Systems, Languages, and Applications, pages 195--210, Oct. 2001. Google ScholarDigital Library
- I. Piumarta. Ccg: A tool for writing dynamic code generators. In OOPSLA'99 Workshop on simplicity, performance and portability in virtual machine design, Nov. 1999.Google Scholar
- I. Piumarta and F. Riccardi. Optimizing direct-threaded code by selective inlining. In Proc. of the ACM SIGPLAN 1998 Conf. on Prog. Language Design and Impl., pages 291--300, June 1998. Google ScholarDigital Library
- SPECjvm98 benchmarks {online}. 1998. Available from: http://www.spec.org/osg/jvm98/.Google Scholar
- D. Sugalski. Implementing an interpreter {online}. Available from: http://www.sidhe.org/%7Edan/presentations/Parrot%20Implementation.ppt. Notes for slide 21.Google Scholar
- T. Suganuma, T. Ogasawara, M. Takeuchi, T. Yasue, M. Kawahito, K. Ishizaki, H. Komatsu, and T. Nakatani. Overview of the IBM Java just-in-time compiler. IBM Systems Journals, Java Performance Issue, 39(1), Feb. 2000. Google ScholarDigital Library
- T. Suganuma, T. Yasue, and T. Nakatani. A region-based compilation technique for dynamic compilers. ACM Trans. Program. Lang. Syst., 28(1):134--174, 2006. Google ScholarDigital Library
- V. Sundaresan, D. Maier, P. Ramarao, and M. Stoodley. Experiences with multi-threading and dynamic class loading in a Java just-in-time compiler. In Proc. of the 4th Intl. Symp. on Code Generation and Optimization, pages 87--97, Mar. 2006. Google ScholarDigital Library
- D. Ungar, R. B. Smith, C. Chambers, and U. Hölzle. Object, message, and performance: how they coexist in Self. IEEE-COMPUTER, 25(10):53--64, Oct. 1992. Google ScholarDigital Library
- J. Whaley. Partial method compilation using dynamic profile information. In Proc. of the 16th ACM SIGPLAN Conf. on Object-Oriented Programming, Systems, Languages, and Applications, pages 166--179, Oct. 2001. Google ScholarDigital Library
Index Terms
- YETI: a graduallY extensible trace interpreter
Recommendations
Amalgamating different JIT compilations in a meta-tracing JIT compiler framework
DLS 2020: Proceedings of the 16th ACM SIGPLAN International Symposium on Dynamic LanguagesMost virtual machines employ just-in-time (JIT) compilers to achieve high-performance. Trace-based compilation and method-based compilation are two major compilation strategies in JIT compilers. In general, the former excels in compiling programs with ...
Definitional Interpreters for Higher-Order Programming Languages
Higher-order programming languages (i.e., languages in which procedures or labels can occur as values) are usually defined by interpreters that are themselves written in a programming language based on the lambda calculus (i.e., an applicative language ...
Comments