Shadow Memory for Dynamic Instruction Translation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Dynamic translation systems face inefficiencies due to the time required to translate non-native instructions into native instructions during runtime, as they involve retrieval and parsing of instructions, which can lead to overhead in decoding and execution.
Innovation Solution
A method and system that utilize a shadow memory to store precompiled code fragments corresponding to non-native instructions, allowing for direct execution from the shadow memory during subsequent passes, reducing the need for repeated parsing and interpretation.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If dynamic translation is used to translate non-native instructions to native instructions during runtime, then the system can execute non-native code without pre-compilation, but the translation time and processing overhead increase significantly
Solution Approach 1:
The patent applies preliminary action by pre-compiling translation code sequences before they are needed during runtime execution. The system identifies non-native instructions, compiles their corresponding native instruction sequences in advance, and stores them in a code cache. When the same non-native instructions are encountered during execution, the pre-compiled native sequences are directly retrieved and executed, eliminating the need for repeated parsing and translation at runtime, thus significantly reducing translation time while maintaining the ability to execute non-native code
2Productivity
If dynamic translation parses each non-native instruction to determine opcode, source, and destination locations, then the translation can be performed at runtime, but the processing overhead and execution time increase
Solution Approach 1:
The patent applies copying by creating and storing copies of translation information in a code cache. Instead of repeatedly parsing non-native instructions during runtime, the system compiles translation sequences once and stores them as cached entries. These cached copies contain pre-analyzed opcode, source, and destination location information. During execution, the system directly retrieves these cached copies without re-parsing, significantly reducing processing overhead while maintaining runtime translation capability
Data Source
AI summary
Systems and methods for executing non-native instructions in a computing system having a processor configured to execute native instructions are provided. A dynamic translator uses instruction code translation in parallel with just-in-time (JIT) compilation to execute the non-native instructions. Non-native instructions may be interpreted to generate instruction codes, which may be stored in a shadow memory. During a subsequent scheduling of a non-native instruction for execution, the corresponding instruction code may be retrieved from the shadow memory and executed, thereby avoiding reinterpreting the non-native instruction. In addition, the JIT compiler may compile instruction codes to generate native instructions, which may be made available for execution, further speeding up the execution process. A system implementing the aforementioned translator may improve performance and speed associated with executing non-native instructions by optimizing the use of instruction codes and JIT-compiled native instructions corresponding to the instruction codes when executing the non-native instructions.


