ABSTRACT
Creating an interpreter is a simple and fast way to implement a dynamic programming language. With this ease also come major drawbacks. Interpreters are significantly slower than compiled machine code because they have a high dispatch overhead and cannot perform optimizations. To overcome these limitations, interpreters are commonly combined with just-in-time compilers to improve the overall performance. However, this means that a just-in-time compiler has to be implemented for each language.
We explore the approach of taking an interpreter of a dynamic language and running it on top of an optimizing trace-based virtual machine, i.e., we run a guest VM on top of a host VM. The host VM uses trace recording to observe the guest VM executing the application program. Each recorded trace represents a sequence of guest VM bytecodes corresponding to a given execution path through the application program. The host VM optimizes and compiles these traces to machine code, thus eliminating the need for a custom just-in-time compiler for the guest VM. The guest VM only needs to provide basic information about its interpreter loop to the host VM.
References
- Adobe Systems Inc. ActionScript 3 Language Specification, 2006. http://livedocs.adobe.com/specs/actionscript/3/wwhelp/wwhimpl/js/html/wwhelp.htm.Google Scholar
- Adobe Systems Inc. ActionScript Virtual Machine 2 Overview, 2007. http://www.adobe.com/devnet/actionscript/articles/avm2overview.pdf.Google Scholar
- Adobe Systems Inc. Adobe FlaCC, 2008. http://llvm.org/devmtg/2008-08/Petersen_FlashCCompiler.pdf.Google Scholar
- Adobe Systems Inc. Adobe Flex SDK, 2008. http://www.adobe.com/products/flex/flexdownloads/.Google Scholar
- Adobe Systems Inc. Adobe Alchemy, 2009. http://labs.adobe.com/technologies/alchemy/.Google Scholar
- V. Bala, E. Duesterwald, and S. Banerjia. Dynamo: A transparent dynamic optimization system. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 1--12. ACM Press, 2000. Google Scholar
Digital Library
- C. F. Bolz, A. Cuni, M. Fijalkowski, and A. Rigo. Tracing the meta-level: PyPy's tracing JIT compiler. In Proceedings of the Workshop on the Implementation, Compilation, Optimization of Object-Oriented Languages and Programming Systems, pages 18--25. ACM Press, 2009. Google Scholar
Digital Library
- M. Chang, E. Smith, R. Reitmaier, M. Bebenita, A. Gal, C. Wimmer, B. Eich, and M. Franz. Tracing for Web 3.0: Trace compilation for the next generation web applications. In Proceedings of the International Conference on Virtual Execution Environments, pages 71--80. ACM Press, 2009. Google Scholar
Digital Library
- B. Chiles. CLR inside out: IronPython and the dynamic language runtime. MSDN Magazine, October 2007.Google Scholar
- R. Cytron, J. Ferrante, B. Rosen, M. Wegman, and F. Zadeck. Efficiently computing static single assignment form and the control dependence graph. ACM Transactions on Programming Languages and Systems, 13(4):451--490, 1991. Google Scholar
Digital Library
- The Da Vinci Machine Project, 2008. http://openjdk.java.net/projects/mlvm/.Google Scholar
- Dynamic Language Runtime, 2008. http://www.codeplex.com/dlr/.Google Scholar
- ECMA. Standard ECMA-262: ECMAScript Language Specification, 3rd edition, 1999. http://www.ecma-international.org/publications/standards/Ecma-262.htm.Google Scholar
- A. Gal, B. Eich, M. Shaver, D. Anderson, D. Mandelin, M. R. Haghighat, B. Kaplan, G. Hoare, B. Zbarsky, J. Orendorff, J. Ruderman, E. Smith, R. Reitmaier, M. Bebenita, M. Chang, and M. Franz. Trace-based just-in-time type specialization for dynamic languages. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 465--478. ACM Press, 2009. Google Scholar
Digital Library
- A. Gal, C. W. Probst, and M. Franz. HotpathVM: An effective JIT compiler for resource-constrained devices. In Proceedings of the International Conference on Virtual Execution Environments, pages 144--153. ACM Press, 2006. Google Scholar
Digital Library
- J. Ha, M. R. Haghighat, S. Cong, and K. S. McKinley. A concurrent trace-based just-in-time compiler for JavaScript. Technical Report TR-09-06, University of Texas, Austin, 2009.Google Scholar
- R. Ierusalimschy, L. H. de Figueiredo, and W. C. Filho. Lua - an extensible extension language. Software: Practice and Experience, 26(6):635--652, 1996. Google Scholar
Digital Library
- IronPython, 2009. http://www.codeplex.com/Wiki/View.aspx?ProjectName=IronPython.Google Scholar
- Java Specification Request 223: Scripting for the Java™ Platform, 2006. http://www.jcp.org/en/jsr/detail?id=223.Google Scholar
- The Jython Project, 2009. http://www.jython.org/Project/.Google Scholar
- The LLVM Compiler Infrastructure, 2009. http://llvm.org/.Google Scholar
- Lua Benchmarks, 2009. http://shootout.alioth.debian.org/gp4/lua.php.Google Scholar
- Lua Programming Language, 2009. http://www.lua.org/. Google Scholar
Digital Library
- D. Mandelin. Tamarin Tracing Internals, Part I to V, 2008. http://blog.mozilla.com/dmandelin/2008/05/.Google Scholar
- PyPy, 2009. http://codespeak.net/pypy/.Google Scholar
- Scripting Engines for Java, 2008. https://scripting.dev.java.net/.Google Scholar
- G. T. Sullivan, D. L. Burening, I. Baron, T. Garnett, and S. Amarasinghe. Dynamic native optimization of interpreters. In Proceedings of the Workshop on Interpreters, Virtual Machines, and Emulators, pages 50--57. ACM Press, 2003. Google Scholar
Digital Library
- R. Uhlig, G. Neiger, D. Rodgers, A. L. Santoni, F. C. M. Martins, A. V. Anderson, S. M. Bennett, A. Kagi, F. H. Leung, and L. Smith. Intel virtualization technology. Computer, 38(5):48--56, 2005. Google Scholar
Digital Library
Index Terms
Optimization of dynamic languages using hierarchical layering of virtual machines








Comments