一句话:提出用学习提取翻译规则的轻量级JIT编译方法,跳过解释和一级优化直接生成高质量本地代码。
JIT编译中,编译/优化时间与生成代码质量之间的平衡至关重要;耗时优化会延迟优化代码部署,使短运行、频繁更新重启的Android等移动/客户端应用更多停留在解释或低优化代码上,造成性能拖累。本文提出JavART,一种轻量级、学习驱动且由规则引导的动态编译方法:离线借助现有JIT编译器自动学习翻译规则,运行时以规则驱动编译,直接生成质量较好的本地代码,无需经过解释阶段和第一级优化。作者在Android 14上实现原型,并用真实应用评估;相比默认解释器加两级JIT,平均加速1.23×,生成本地代码比Android一级JIT快5.5×且代码运行快6%;在Hotspot JVM客户端系统上平均加速1.20×。
The balance between the compilation/optimization time and the produced code quality is very important for Just-In-Time (JIT) compilation. Time-consuming optimizations can cause delayed deployment of the optimized code, and thus more execution time needs to be spent either in the interpretation or less optimized code, leading to a performance drag. Such a performance drag can be detrimental to mobile and client-side devices such as those running Android, where applications are often shorting-running, frequently restarted and updated. To tackle this issue, this paper presents a lightweight learning-based, rule-guided dynamic compilation approach to generate good-quality native code directly without the need to go through the interpretive phase and the first-level optimization at runtime. Different from existing JIT compilers, the compilation process is driven by translation rules, which are automatically learned offline by taking advantage of existing JIT compilers. We have implemented a prototype of our approach based on Android 14 to demonstrate the feasibility and effectiveness of such a lightweight rule-based approach using several real-world applications. Results show that, compared to the default mode running with the interpreter and two tiers of JIT compilers, our prototype can achieve a 1.23× speedup on average. Our proposed compilation approach can also generate native code 5.5X faster than the existing first-tier JIT compiler in Android, with the generated code running 6% faster. We also implement and evaluate our approach on a client-side system running Hotspot JVM, and the results show an average of 1.20× speedup.
@article{paperbot3174,
title = {JavART: A Lightweight Rule-Based JIT Compiler using Translation Rules Extracted from a Learning Approach},
author = {Hanzhang Wang and Wei Peng and Wenwen Wang and Yunping Lu and Pen-Chung Yew and Weihua Zhang},
journal = {Proceedings of the ACM on Programming Languages},
volume = {9},
number = {OOPSLA1},
year = {2025},
doi = {10.1145/3720418}
}