文档介绍:上海交通大学
硕士学位论文
动态二进制翻译中的TCache的设计与实现——基于动态二进制
翻译系统CrossBit的优化
姓名:马舒兰
申请学位级别:硕士
专业:软件工程
指导教师:步丰林
20080101
动态二进制翻译中的 TCache 的设计与实现
——基于动态二进制翻译系统 CrossBit 的优化
摘要
二进制翻译是一种能够在目标机器平台上本地执行异构源机器
平台二进制代码的技术。二进制翻译技术通常可以分为静态二进制翻
译和动态二进制翻译。前者将二进制执行文件通过静态翻译、分析,
生成优化后的本地代码再供用户执行,而后者则采用了边翻译边执行
的策略,为用户提供了异构代码的直接透明执行。动态二进制翻译在
执行时期收集(profile)动态信息,对翻译后的代码块进行优化,再
通过缓存翻译后的代码块,最终达到较高的代码重用,从而大大减少
了代码翻译和运行时间。在动态二进制翻译中,缓存代码块的子系统
被称为 TCache(Translated Code Cache)。
本文针对一个动态二进制翻译系统——CrossBit,研究如何为它
设计一个高效的 TCache 来存放和管理翻译优化好的目标代码块。研
究内容包括 TCache 申请、分配、组织和替换策略。文章通过对各种
动态二进制翻译系统中已有的 TCache 算法的分析和对比,针对
CrossBit 本身的特性设计了相应 TCache 替换算法,并通过 SPEC
CPU2000 基准测试程序进行性能验证。实验数据还表明,一个合适
的 TCache 的设计能够使 CrossBit 的性能大大提升。本文提出的算法,
对于其他的二进制翻译器也具有通用性。
关键字:动态二进制翻译,TCache
I
Design and Implement of The TCache
of CrossBit Binary Translator
ABSTRACT
Binary Translation is the technique which enables architectural
patible “source” platform binaries to execute natively on the “target”
platform. Generally, there are two kinds of binary translator: The static binary
translator (SBT) and the dynamic binary translator (DBT). The former
translates, analyzes binaries statically, and finally provides the user with the
optimized native executable. However, the latter executes the translated
binaries while translates their origins, which further provides the user with
the direct, transparent execution of source binaries. Meanwhile, dynamic
binary translator gathers profile information on the fly, and dynamically
optimizes the translated code blocks. The container it puts all the translated
code blocks into is a software cache sub-system. It is always called the
Translated Cache (TCache). Therefore, with the power of TCache, DBT
repeatedly reuses the translated code blocks, and thus greatly reduces the
time of translation.
This paper is the research on the design and implement of the high
efficient TCache system of CrossBit binary translator. It in