Exception Handling Unit for Dynamic Binary Code Translation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing program code conversion methods face challenges in handling exception signals during the conversion of binary code from one computing platform to another, particularly in dynamic conversion scenarios where the execution of the translator and target code are interleaved, leading to difficulties in providing an accurate mechanism for handling exceptions and potentially exhausting available signals.
Innovation Solution
A computer system and method that includes a translator unit, a processor unit, a signal generator unit, and an exception handling unit with target-side and subject-side handlers, which selectively process and deliver exception signals through a delivery path selection unit to handle exceptions efficiently, allowing for accurate emulation of the original subject code state and reducing the need for frequent conversion of the target state to the subject state.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If dynamic code conversion is used to enable execution on different processor architectures, then code portability and adaptability are improved, but exception signal handling becomes unreliable and signals may be exhausted
Solution Approach 1:
The patent introduces an intermediary exception handling mechanism that sits between the target processor's exception system and the subject code's expectations. This intermediary captures target exceptions, translates them into subject exceptions, and manages signal delivery to prevent exhaustion while maintaining reliable exception handling across architecture boundaries.
Solution Approach 2:
The patent creates a copy of the subject exception handling environment within the target system. By replicating subject exception handlers and signal management structures in the target space, the system can reliably handle exceptions according to subject code expectations without depleting target system signals.
2Measurement precision
If frequent conversion between target state and subject state is performed to handle exceptions accurately, then exception handling precision is improved, but execution speed and productivity deteriorate
Solution Approach 1:
The patent performs preliminary setup of exception handling contexts and signal delivery paths during code translation, before execution begins. By pre-configuring how target exceptions map to subject exceptions and establishing handler relationships in advance, the system avoids costly runtime conversions while maintaining accurate exception handling.
Solution Approach 2:
The patent implements dynamic exception handling where the system adapts its conversion frequency based on execution context. Conversions between target and subject state occur only when necessary for accurate exception handling, rather than on every exception, optimizing the balance between precision and performance.
3Productivity
If a single exception signal is shared between target code and translator, then signal efficiency and resource utilization are improved, but signal delivery reliability and ease of operation worsen
Solution Approach 1:
The patent segments the single shared exception signal into distinct delivery paths - one for target code exceptions and one for translator exceptions. This segmentation allows the system to efficiently share the underlying signal resource while maintaining clear, manageable delivery routes that prevent conflicts and simplify operation.
Data Source
Figure 1
Figure 2
Figure 3
AI summary
Method and apparatus for the handling of exception signals in combination particularly with the dynamic conversion of binary code executable by a one computing platform into binary code executed instead by another computing platform. In one exemplary aspect, an exception handling unit (195, 220, 230) selectively handles some exception signals with respect to a target state (320) and handles other exception signals with respect to a subject state (330) derived from the target state (320). A plurality of signal handling sub-units (223) are arranged to selectively process the exception signal (310) with respect to the target state (320) and output a request either to return to execution or to pass on the exception signal (310). A delivery path selection unit (222) is arranged to determine a delivery path of the exception signal (310) to a selected group of the plurality of signal handling sub-units (223). A signal control unit (221 ) is arranged to deliver the exception signal (310) in turn to each of the selected group of signal handling sub-units (223) according to the delivery path and (i) where a respective one of the signal handling sub-units (223) requests the return to execution then to return to execution according to the target state (320); and (ii) where the signal handling sub- unit (223) requests to pass on the exception signal (310) then to pass on the exception signal (310) to a subsequent one of the selected group of signal handling sub-units (223) according to the delivery path and, where no further of the signal handling sub-units are specified in the delivery path, then to deliver the exception signal (310) to a subject-side exception handler unit (230).