Emulator Code Cache for Dynamic Compilation Efficiency

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Emulator software experiences performance degradation due to the time-consuming process of switching between host and guest environments for code compilation, as it requires repetitive compilation of guest platform-compatible code into host-compatible code.

Innovation Solution

Implementing a code cache within the emulator application that stores previously compiled code, using a hash table for identification and retrieval of matching code blocks, allowing for reuse instead of recompilation, thereby reducing the need for repetitive code compilation.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If code is compiled dynamically by switching between host and guest environments, then host-compatible code can be generated for execution, but processing time and performance are consumed due to repetitive compilation

Engineering Contradiction:
Improvecode compilation efficiencyVSAvoidtime for environment switching and compilation
Core Design Contradiction:
ProductivityVSLoss of time

Solution Approach 1:

The patent implements a code cache that stores previously compiled host-compatible code blocks. When the same guest code is encountered again, the system retrieves the pre-compiled code from the cache instead of re-compiling, thereby performing the compilation action in advance and avoiding repetitive compilation operations.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent creates and stores copies of compiled code blocks in a code cache. These copied code blocks can be retrieved and executed without requiring the original compilation process to be repeated, thus reducing the time and resources needed for code generation.

Inventive Principle:
Principle #26Copying

2Productivity

If the host environment is activated to compile guest code, then host-compatible executable code is produced, but the guest environment must be paused or deactivated resulting in performance degradation

Engineering Contradiction:
Improvecode compilation throughputVSAvoidemulator execution speed
Core Design Contradiction:
ProductivityVSSpeed

Solution Approach 1:

By pre-compiling code blocks and storing them in the code cache, the system eliminates the need to pause the guest environment and activate the host environment for compilation during normal execution. The preliminary compilation action is performed once, and subsequent executions use the cached code directly.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The code cache enables continuous execution of the guest environment without intermittent interruptions for compilation. Once code is in the cache, it can be retrieved and executed continuously without breaking the execution flow to switch environments.

Inventive Principle:
Principle #20Continuity of useful action

3Reliability

If repetitive code compilation is performed, then up-to-date host-compatible code is generated, but valuable processing time and resources are wasted

Engineering Contradiction:
Improvecode execution accuracyVSAvoidprocessing resources consumed
Core Design Contradiction:
ReliabilityVSLoss of energy

Solution Approach 1:

The system performs code compilation once in advance and stores the result in the code cache. This preliminary action ensures the code is ready for execution without requiring repeated compilation, thus maintaining execution accuracy while conserving processing resources.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The code cache recovers previously compiled code blocks for reuse instead of discarding them after a single use. By recovering and reusing these compiled blocks, the system avoids redundant compilation operations and conserves processing energy.

Inventive Principle:
Principle #34Discarding and recovering

Data Source

PatentUS7882499B2Caching dynamically compiled code to storage
Publication Date: 2011.02.01 ZHIGU HLDG
  • US7882499B2 patent drawing
  • US7882499B2 patent drawing
  • US7882499B2 patent drawing

AI summary

Dynamically compiled code is stored for future use by an emulator application. The emulator application may recall the previously compiled code rather than recompile the same code again. Recycling previously compiled code prevents unneeded code compilation, and saves valuable processing time and resources. Previously compiled code can be associated with code identification information. When compiled code is needed, one or more indexes of compiled code identification information is searched. If the appropriate identification information is found, the corresponding code is loaded and executed.