A region-based compilation technique for a Java just-in-time compiler

A region-based compilation technique for a Java just-in-time compiler
复制标题

Java 即时编译器的基于区域的编译技术

DOI:
10.1145/781131.781166
复制
发表时间:
2003
期刊:
Proceedings of the ACM SIGPLAN 2003 conference on Programming language design and implementation
影响因子:
--
通讯作者:
T. Nakatani
T. Nakatani
中科院分区:
--
文献类型:
--
作者:
T. Suganuma;T. Yasue;T. Nakatani

文献摘要

被引文献

相似文献

方法内部和数据流分析是有效程序转换的两个主要优化组件,但是它们通常遭受目标方法中包含的代码很少或从未执行的代码。一个主要问题在于假设编译单元是在方法边界上分区的。本文介绍了我们的动态汇编系统中基于区域的编译技术的设计和实现,其中将编译的区域选择为代码部分而无需执行代码。该技术的关键部分是区域选择,部分内部和地区出口处理。对于区域选择,我们使用静态启发式方法和动态曲线来识别罕见的代码部分。区域选择过程和方法内部决策是交织在一起的,因此内部的方法揭示了其他区域选择的目标,而在线目标中的区域选择则保守了预算,从而导致更多的方法内部。因此,可以为方法的一部分而不是整个方法执行内部过程。当程序试图从区域边界退出时,我们触发重新编译,然后依靠堆栈替换来继续从重编码代码中的相应入口处执行。我们已经在Java JIT编译器中实施了这些技术,并进行了全面的评估。实验结果表明,与传统的基于基于功能的汇编技术相比,基于区域的汇编的方法平均可实现约5%的性能提高,同时将汇编开销降低了20%至30%。
Method inlining and data flow analysis are two major optimization components for effective program transformations, however they often suffer from the existence of rarely or never executed code contained in the target method. One major problem lies in the assumption that the compilation unit is partitioned at method boundaries. This paper describes the design and implementation of a region-based compilation technique in our dynamic compilation system, in which the compiled regions are selected as code portions without rarely executed code. The key part of this technique is the region selection, partial inlining, and region exit handling. For region selection, we employ both static heuristics and dynamic profiles to identify rare sections of code. The region selection process and method inlining decision are interwoven, so that method inlining exposes other targets for region selection, while the region selection in the inline target conserves the inlining budget, leading to more method inlining. Thus the inlining process can be performed for parts of a method, not for the entire body of the method. When the program attempts to exit from a region boundary, we trigger recompilation and then rely on on-stack replacement to continue the execution from the corresponding entry point in the recompiled code. We have implemented these techniques in our Java JIT compiler, and conducted a comprehensive evaluation. The experimental results show that the approach of region-based compilation achieves approximately 5% performance improvement on average, while reducing the compilation overhead by 20 to 30%, in comparison to the traditional function-based compilation techniques.