An Indirect Branch Prediction for Interpreters
-
摘要: 解释器广泛应用于Java虚拟机、JavaScript执行引擎等托管运行环境中.解释器通常使用间接转移指令实现字节码分派.在现代多发射多级流水的微处理器中,间接转移预测失效严重制约解释器的性能.针对解释器提出了一种字节码指针引导的间接转移预测技术,其核心思想是使用解释器特有的字节码指针值区分不同的间接转移场景.该技术使用软硬件协同的方式,解释器中插入专门的引导指令以标记字节码指针,预测器在运行时刻使用字节码指针值预测转移目标地址.实验结果表明,该技术与常用的转移目标缓冲预测器相比,能提升Java解释器的性能达34.7%,能提升JavaScript解释器的性能达8.3%,与专用的硬件间接转移预测器TTC(tagged target cache)相比,也能提升Java解释器的性能达21.9%.Abstract: Interpreters are widely used in Java virtual machines, JavaScript execution engines and other managed runtime environments. Interpreters usually use indirect branches to dispatch bytecodes. Indirect branch mispredictions are becoming a critical limit of interpreters’ performance in modern multi-issue multi-stage pipeline microprocessors. This paper proposes a bytecode pointer guided indirect (BGI) branch prediction for interpreters. The key idea is to use interpreter-specific bytecode pointer value to distinguish different indirect branch occurrences. It can improve the prediction accuracy of indirect branches in interpreters, so as to improve the performance of interpreters. Microprocessors usually use BTB to predict branch target addresses. BTB can’t accurately predict the rapidly changing branch target addresses of indirect branches in interpreters because it stores only one target address for one indirect branch. Our technique requires software-hardware cooperation, where interpreter software is augmented with specialized hint instructions to indicate bytecode pointers, and then the branch predictor makes use of the bytecode pointer value to store different target addresses of one indirect branch in different entries of BTB at runtime, so as to improve the prediction accuracy. Experimental results show that it improves the performance by 347% for Java interpreter and by 8.3% for JavaScript interpreter over the most commonly used BTB prediction, and it improves the performance by 21.9% for Java interpreter over the specialized indirect branch predictor TTC.
-
-
期刊类型引用(5)
1. 谢汶兵,田雪,漆锋滨,武成岗,王俊,罗巧玲. 二进制翻译技术综述. 软件学报. 2024(06): 2687-2723 . 百度学术
2. 刘登峰,李东亚,柴志雷,周浩杰,丁海峰. 基于QEMU的SIMD指令替换浮点指令框架. 湖南大学学报(自然科学版). 2024(08): 70-77 . 百度学术
3. 余子濠 ,陈璐 ,孙凝晖 ,包云岗 . 以RISC-V为目标的动态二进制翻译代码质量优化方法. 计算机研究与发展. 2023(10): 2322-2334 . 本站查看
4. 李明亮,庞建民,岳峰. 基于地址重用的二进制翻译本地代码替换. 信息工程大学学报. 2022(01): 38-44 . 百度学术
5. 李男,庞建民. 基于中间表示规则替换的二进制翻译中间代码优化方法. 国防科技大学学报. 2021(04): 156-162 . 百度学术
其他类型引用(2)
计量
- 文章访问数: 1261
- HTML全文浏览量: 0
- PDF下载量: 695
- 被引次数: 7