Java Just-in-Timeコンパイラにおける動的最適化の設計と評価
Toshio Suganuma, 俊夫 菅沼 · Institutional Repositories DataBase (IRDB)
The Java TM programming language has gained widespread popularity in the industry, offering many benefits to programmers such as dynamic class loading and reflections.Unfortunately the dynamic nature of the language presents a number of challenges for implementing an efficient Java Virtual Machine (JVM), and especially a Just-In-Time (JIT) compiler.However, at the same time this dynamic execution environment presents opportunities for potential performance advantages over the traditional static compilation model, because dynamic optimizations can exploit runtime profile information.Although there are currently several Java implementations that claim to include dynamic optimizations, few of these JVMs have released detailed information about their internal designs.This dissertation presents a comprehensive study of the dynamic optimizations for Java that were designed for and implemented in an industry-leading, high performance IBM Java JIT compiler.The first contribution of this dissertation is to describe the design and implementation of a dynamic optimization framework for Java.Our system uses a multi-level execution model divided between a mixed-mode interpreter and a recompilation framework.The mixed-mode interpreter allows the efficient mixed execution of interpreted and compiled code, and covers a large number of unimportant methods without incurring any compilation costs.The dynamic compiler supports three levels of optimization to provide a balanced steps for the tradeoff between the compilation overhead and the compiled code quality.We also designed a reliable and lightweight program profiling system, combining three different techniques, depending on the profiler characteristics and target compilation levels; a counter-based profiler, a sampling-based profiler, and an instrumentation-based profiler.We implemented and evaluated our framework in the IBM JVM and JIT.Our results demonstrate that our configuration provides significant advantages in terms of performance and compilation overhead compared to other strategies, including the compile-only approach, both in the program startup and steady state phases.The second contribution of this dissertation is to describe the design and implementation of two profile-directed optimizations, profile-directed method inlining and dynamic code specialization, both built on top of the dynamic optimization framework described in the above.For method inlining, we rely solely on the runtime profile information on call site distribution and invocation frequencies to decide which methods should be inlined along which call paths.In our experiments, we obtained significant improvements in both performance and compilation iii overhead across a variety of benchmarks.For code specialization, which takes advantage of a program's runtime invariant or semi-invariant behavior for optimizations, we employ an impact analysis technique to estimate the benefit of specialization, and collect value profile information only when the optimization on a variable is deemed beneficial.Our experiments show a modest performance improvement with this technique.The third contribution of this dissertation is to describe the design and implementation of a region-based compilation technique, consisting of region formation, partial inlining, region exit handling, and region-aware optimizations, which are effective in dynamic compilation environments.This implementation is also built on top of the dynamic optimization framework described in this dissertation.Our system employs a dataflow-based intra-method region selection algorithm that uses both static heuristics and a dynamic profile, and then integrates the algorithm in the inlining process to extract effective inter-procedural regions.When the program attempts to exit from a region boundary at runtime, we trigger recompilation and perform on on-stack replacement (OSR) to continue the execution from the corresponding entry point in the recompiled code.Our empirical evaluation demonstrates that our system can improve the performance and reduce the compilation overhead significantly.iv
Cited by 0 works. Open-access PDF