Dynamic Binary Translator Native Code Interleaving
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing program code conversion methods face challenges in efficiently translating and executing code across different processor architectures, particularly when using native libraries, as they lose execution control and optimization opportunities, and lead to inaccurate emulated states.
Innovation Solution
A dynamic binary translation method that employs a translator apparatus to convert subject program code into target code, utilizing native binding and reverse binding techniques to interleave execution with native code, while maintaining control and optimizing performance.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If native binding is used to execute native library functions, then execution performance is improved, but execution control is lost and optimization opportunities are reduced
Solution Approach 1:
The patent introduces an intermediary mechanism (the translation/execution system) that sits between the native code execution and the host environment. This intermediary maintains execution control by intercepting and managing function calls, allowing the system to benefit from native code performance while retaining the ability to monitor, control, and optimize execution flow through the translation layer.
2Productivity
If native binding is used to execute native library functions, then execution performance is improved, but optimization opportunities are lost
Solution Approach 1:
The system dynamically adapts its behavior based on execution context. It can switch between executing native functions directly (for performance) and translating/executing through the system (for optimization opportunities). This dynamic approach allows the system to capture optimization opportunities when needed while maintaining high performance when possible, making the execution model flexible and adaptable rather than static.
3Productivity
If native binding is used to execute native library functions, then execution performance is improved, but emulated subject state accuracy becomes poor
Solution Approach 1:
The system implements feedback mechanisms where the execution state is continuously monitored and compared against the expected emulated state. When native functions are executed, their effects on the execution state are tracked and fed back to maintain accuracy of the emulated subject state. This feedback loop ensures that even when using fast native execution paths, the system maintains precise knowledge of the execution state for correct emulation.
Data Source
Figure 1~2
Figure 3~4
Figure 5
AI summary
In program code conversion, particularly dynamic binary translation, subject code (17) is translated into target code (21) through a translator (19) for execution on a target processor (13). Selected portions of subject code, such as library functions SFuncA (172), are replaced by instead executing a portion of native code such as a native function NFuncA (282). The native function is native to the target processor (13). The method further includes executing a subject code portion such as a subject function SFuncB (173) in place of a native code portion (282) such library function NFuncB (283). This reverse binding technique substitutes subject code for selected portions of the native code, particularly native library functions in order to keep control within the translator (19). This helps to maintain an accurate subject state in the translator (19), amongst other advantages.