arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2403.11283cs.SEcs.PL
收藏

基于模式的窥孔优化与Java JIT测试

Pattern-Based Peephole Optimizations with Java JIT Tests

Zhiqiang Zang, Aditya Thimmaiah, Milos Gligoric

AI总结:

提出JOG框架,用Java编写模式生成JIT窥孔优化及测试,自动检测遮蔽关系,编写162个模式并提交8个PR,7个已合入OpenJDK主分支。

摘要:

我们提出了JOG,一个便于开发Java JIT窥孔优化及相应JIT测试的框架。JOG使开发者能够用Java本身编写模式,通过编写优化前后的代码以及任何必要的先决条件来指定期望的代码转换。这些模式可以像OpenJDK中已有的优化测试那样编写。JOG将每个模式转换为可集成到JIT优化过程中的C/C++代码。JOG还从模式中生成优化的Java测试。此外,JOG能自动检测一对优化之间可能的遮蔽关系,即被遮蔽优化的效果被另一个优化覆盖。我们的评估表明,JOG使得编写可读的JIT优化及相应测试更加容易,且不降低JIT优化的有效性。我们编写了162个模式,包括OpenJDK中已有的68个优化、从LLVM改编的92个新优化以及我们提出的两个新优化。我们为OpenJDK提交了八个拉取请求(PR),其中六个用于新优化,一个用于移除被遮蔽的优化,一个用于新生成的JIT测试;其中七个PR已被合并到OpenJDK的主分支。

英文摘要:

We present JOG, a framework that facilitates developing Java JIT peephole optimizations alongside JIT tests. JOG enables developers to write a pattern, in Java itself, that specifies desired code transformations by writing code before and after the optimization, as well as any necessary preconditions. Such patterns can be written in the same way that tests of the optimization are already written in OpenJDK. JOG translates each pattern into C/C++ code that can be integrated as a JIT optimization pass. JOG also generates Java tests for optimizations from patterns. Furthermore, JOG can automatically detect possible shadow relation between a pair of optimizations where the effect of the shadowed optimization is overridden by another. Our evaluation shows that JOG makes it easier to write readable JIT optimizations alongside tests without decreasing the effectiveness of JIT optimizations. We wrote 162 patterns, including 68 existing optimizations in OpenJDK, 92 new optimizations adapted from LLVM, and two new optimizations that we proposed. We opened eight pull requests (PRs) for OpenJDK, including six for new optimizations, one on removing shadowed optimizations, and one for newly generated JIT tests; seven PRs have already been integrated into the master branch of OpenJDK.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑