Dynamic Translation Optimization Method Based on Static Pre-Translation

Binary translation technology is an effective method to solve the problem of software cross-platform transplantation, especially for software porting without source code. Static binary translation has a good translation effect in general, but it faces the problem of code discovery. Dynamic binary translation can completely reproduce the execution process of the source program according to the execution order of the binary code. But it is severely limited by its low efficiency, as the time of translation is part of the whole runtime and it is no time for better code optimization in dynamic binary translation. This paper aims to optimize the execution process of dynamic binary translation by taking full advantage of the strengths of static binary translation. An optimization method of dynamic binary translation with static pre-translation was proposed in this paper. By pre-translating the source program and using more in-depth code optimization method to optimize the translated code, most of the code translation time can be cut down and the translated code will be more efficient. A new dynamic translation framework with the static pre-translation module, based on the dynamic translator named QEMU (a quick emulator), was designed to translate the $\times $ 86 program to the Sunway platform. As the experimental results show, the framework and optimization method are valid to improve the efficiency of the general dynamic translator.

[1]  John Yates,et al.  FX!32 a profile-directed binary translator , 1998, IEEE Micro.

[2]  Jun Wang,et al.  A Binary Translation Backend Registers Allocation Algorithm Based on Priority , 2017, GSKI.

[3]  Guowu Yang,et al.  Register Allocation for QEMU Dynamic Binary Translation Systems , 2015 .

[4]  Guan Haibing,et al.  Return Instruction Analysis and Optimization in Dynamic Binary Translation , 2009, 2009 Fourth International Conference on Frontier of Computer Science and Technology.

[5]  Wuu Yang,et al.  An LLVM-based hybrid binary translation system , 2012, 7th IEEE International Symposium on Industrial Embedded Systems (SIES'12).

[6]  Junaid Shuja,et al.  Analysis of Vector Code Offloading Framework in Heterogeneous Cloud and Edge Architectures , 2017, IEEE Access.

[7]  Luigi Carro,et al.  A Dynamic Modulo Scheduling with Binary Translation: Loop optimization with software compatibility , 2016, J. Signal Process. Syst..

[8]  Qin Zhao,et al.  Optimizing binary translation of dynamically generated code , 2015, 2015 IEEE/ACM International Symposium on Code Generation and Optimization (CGO).

[9]  Mike Van,et al.  UQBT: Adaptable Binary Translation at Low Cost , 2000 .

[10]  Jens Tröger,et al.  Specification-driven dynamic binary translation , 2005 .

[11]  Stephen McCamant,et al.  A General Persistent Code Caching Framework for Dynamic Binary Translation (DBT) , 2016, USENIX Annual Technical Conference.

[12]  Haoran Guo,et al.  BTMD: A Framework of Binary Translation Based Malcode Detector , 2012, 2012 International Conference on Cyber-Enabled Distributed Computing and Knowledge Discovery.

[13]  Zhang Min-xuan,et al.  Accelerating Program Behavior Analysis with Dynamic Binary Translation , 2012 .

[14]  Wuu Yang,et al.  A Retargetable Static Binary Translator for the ARM Architecture , 2014, TACO.

[15]  Wuu Yang,et al.  LLBT: an LLVM-based static binary translator , 2012, CASES '12.

[16]  Jim D. Garside,et al.  Optimizing Indirect Branches in Dynamic Binary Translators , 2016, ACM Trans. Archit. Code Optim..

[17]  Michael Gschwind,et al.  Dynamic and Transparent Binary Translation , 2000, Computer.

[18]  Cristina Cifuentes,et al.  Binary translation: static, dynamic, retargetable? , 1996, 1996 Proceedings of International Conference on Software Maintenance.

[19]  Wei Zhong Software transplant based on instruction simulation , 2010 .

[20]  Frédéric Pétrot,et al.  Optimizing Memory Access Performance Using Hardware Assisted Virtualization in Retargetable Dynamic Binary Translation , 2017, 2017 Euromicro Conference on Digital System Design (DSD).

[21]  Guo Tao,et al.  A Reconstruction Method of Type Abstraction in Binary Code , 2013 .

[22]  Wei-Chung Hsu,et al.  A dynamic binary translation system in a client/server environment , 2015, J. Syst. Archit..