A trace-based Java JIT compiler retrofitted from a method-based compiler

This paper describes our trace-based JIT compiler (trace-JIT) for Java developed from a production-quality method-based JIT compiler (method-JIT). We first describe the design and implementation of our trace-JIT with emphasis on how we retrofitted a method-JIT as a trace-based compiler. Then we show that the trace-JIT often produces better quality code than the method-JIT by extending the compilation scope. Forming longer traces that span multiple methods turns out to be more powerful than method inlining in extending the compilation scope. It reduces method-invocation overhead and also offers more compiler optimization opportunities. However, the trace-JIT incurs additional runtime overhead compared to the method-JIT that may be offset by gains from the improved code quality. Overall, our trace-JIT achieved performance roughly comparable to the baseline method-JIT. We also discuss the issues in trace-based compilation from the viewpoint of compiler optimizations. Our results show the potentials of trace-based compilation as an alternative or complementary approach to compiling languages with mature method-based compilers.

[1]  Carl Friedrich Bolz,et al.  Tracing the meta-level: PyPy's tracing JIT compiler , 2009, ICOOOLPS@ECOOP.

[2]  Toshiaki Yasue,et al.  A region-based compilation technique for dynamic compilers , 2006, TOPL.

[3]  Derek Bruening,et al.  An infrastructure for adaptive dynamic optimization , 2003, International Symposium on Code Generation and Optimization, 2003. CGO 2003..

[4]  Michael Franz,et al.  Trace-based compilation in execution environments without interpreters , 2010, PPPJ.

[5]  Nikola Grcevski,et al.  Java Just-in-Time Compiler and Virtual Machine Improvements for Server and Middleware Applications , 2004, Virtual Machine Research and Technology Symposium.

[6]  Michael Franz,et al.  Optimization of dynamic languages using hierarchical layering of virtual machines , 2009, DLS '09.

[7]  Angela Demke Brown,et al.  YETI: a graduallY extensible trace interpreter , 2007, VEE '07.

[8]  Jens Palsberg,et al.  The essence of compiling with traces , 2011, POPL '11.

[9]  Nikolai Tillmann,et al.  SPUR: a trace-based JIT compiler for CIL , 2010, OOPSLA.

[10]  Mason Chang,et al.  Trace-based just-in-time type specialization for dynamic languages , 2009, PLDI '09.

[11]  Toshio Nakatani,et al.  Improving the performance of trace-based systems by false loop filtering , 2011, ASPLOS XVI.

[12]  Vasanth Bala,et al.  Dynamo: a transparent dynamic optimization system , 2000, SIGP.

[13]  Michael Franz,et al.  HotpathVM: an effective JIT compiler for resource-constrained devices , 2006, VEE '06.

[14]  J. Gregory Steffan,et al.  Lengthening Traces to Improve Opportunities for Dynamic Optimization , 2007 .