作者投稿和查稿 主编审稿 专家审稿 编委审稿 远程编辑

计算机工程 ›› 2019, Vol. 45 ›› Issue (5): 72-76,83. doi: 10.19678/j.issn.1000-3428.0050157

• 体系结构与软件技术 • 上一篇    下一篇

面向国产平台的二进制翻译库函数替换优化处理机制

张家豪,单征,岳峰,傅立国,王军   

  1. 数学工程与先进计算国家重点实验室,郑州 450001
  • 收稿日期:2018-01-17 出版日期:2019-05-15 发布日期:2019-05-15
  • 作者简介:张家豪(1991—) 男,硕士研究生,主研方向为计算机体系结构;单征(通信作者),副教授、博士、博士生导师;岳峰,讲师、博士;傅立国,博士;王军,硕士研究生。
  • 基金资助:

    国家自然科学基金(61472447);国家高技术研究发展计划(2009AA012201);“核高基”重大专项(2009ZX01036-001-001)

Binary translation library function replacement optimization processing mechanism for domestic platform

ZHANG Jiahao,SHAN Zheng,YUE Feng,FU Liguo,WANG Jun   

  1. State Key Laboratory of Mathematical Engineering and Advanced Computing,Zhengzhou 450001,China
  • Received:2018-01-17 Online:2019-05-15 Published:2019-05-15

摘要:

在二进制翻译中,库函数本地化处理是指不直接翻译源文件中的库函数而是使用本地目标机的库函数进行替换,以此提高翻译性能。针对国产平台二进制翻译中库函数处理翻译模式的相关特性,提出一种库函数解析处理机制,借助helper函数实现库函数替换操作。通过修改基本块划分规则,将库函数替换部分翻译的基本块进行合并,构建超级块,减少源程序中基本块划分数量与程序执行跳转次数,在保证翻译正确性基础上有效提高翻译效率。在动态二进制翻译器QEMU上进行的实验结果表明,与未优化的库函数处理翻译方式相比,翻译后程序加速比平均提升9%,有效提高了翻译效率。

关键词: 二进制翻译, 库函数解析, 基本块合并, QEMU翻译器, 国产平台

Abstract:

In binary translation,library functions localization processings do not directly translate library functions in source files but use library functions of local target machines to improve translation performance.Aiming at the related characteristics of library function processing translation mode in binary translation of domestic platform,a library function analysis processing mechanism is proposed.The library function replacement operation is realized by the helper function.By modifying the basic block partitioning rules,the library function replaces the partially translated basic blocks to merge,constructs the super block,reduces the number of basic block partitions and program execution jumps in the source program,and effectively improves the translation efficiency on the basis of ensuring the translation correctness.Experimental results based on the dynamic binary translator QEMU show that compared with the unoptimized library function processing translation method,the post-translation program acceleration ratio is increased by 9%,which verifies the effectiveness of the mechanism.

Key words: binary translation, library function analysis, basic block merging, QEMU translator, domestic platform

中图分类号: