Method and apparatus for preserving precise exceptions in binary translated code
DCFirst Claim
Patent Images
1. A binary translation system, comprising:
- a non-optimizing foreign code execution module configured to maintain dedicated foreign state for each foreign binary operation executed allowing for the exceptions arisen to be handled precisely; and
an optimizing binary translator configured to translate foreign binary operations into optimized sequences of host operations in such a way as to improve the speed of execution of the sequences; and
a host CPU configured to execute the host operations; and
a documentation generator configured to generate a set of documentations for optimized sequences of host operations, wherein each documentation describes operations required to calculate a corresponding foreign state for an appointed point;
a documentation tracker configured to record host operation addresses at appointed points of the host operation sequences being executed, wherein, for each host operation address, operations required to calculate a corresponding foreign state for the host operation address are added to documentation; and
a recovery mechanism configured to select a documentation in the set of documentations using a host operation address corresponding to the selected documentation, wherein the recovery mechanism is configured to perform the operations saved in the documentation to calculate the corresponding foreign state for the host operation address and to continue foreign codes execution in case of the exception arisen during the execution of the corresponding optimized host codes.
2 Assignments
Litigations
0 Petitions
Accused Products
Abstract
Precise exceptions handling in the optimized binary translated code is achieved by transitioning execution to the non-optimized step-by-step foreign code execution means in accordance with one of the several coherent foreign states designated during the optimized translation of the foreign code. A method to improve the operation by avoiding complete foreign state updates in the optimized code, an apparatus to track the switching between the states and a method to recompute the complete foreign state in accordance to the current state identification, execution context and additional documentation provided during the translation time are proposed.
30 Citations
18 Claims
-
1. A binary translation system, comprising:
-
a non-optimizing foreign code execution module configured to maintain dedicated foreign state for each foreign binary operation executed allowing for the exceptions arisen to be handled precisely; and an optimizing binary translator configured to translate foreign binary operations into optimized sequences of host operations in such a way as to improve the speed of execution of the sequences; and a host CPU configured to execute the host operations; and a documentation generator configured to generate a set of documentations for optimized sequences of host operations, wherein each documentation describes operations required to calculate a corresponding foreign state for an appointed point; a documentation tracker configured to record host operation addresses at appointed points of the host operation sequences being executed, wherein, for each host operation address, operations required to calculate a corresponding foreign state for the host operation address are added to documentation; and a recovery mechanism configured to select a documentation in the set of documentations using a host operation address corresponding to the selected documentation, wherein the recovery mechanism is configured to perform the operations saved in the documentation to calculate the corresponding foreign state for the host operation address and to continue foreign codes execution in case of the exception arisen during the execution of the corresponding optimized host codes. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14)
-
-
15. A method of recomputing a dedicated foreign state in a binary translation system from documentation generated by an optimizing translator in a case of an exception arising during execution of optimized binary translated code translated from a foreign code, the method comprising:
-
designating a set of recovery points in the optimized binary translated code during optimized translation of the foreign code, wherein each recovery point represents a foreign state; generating a set of documentations during the optimized translation of the foreign code, wherein each documentation in the set of documentations corresponds to a recovery point in the optimized binary translated code and describes operations required to calculate a corresponding foreign state for the recovery point; and using one of the documentations in the set of documentations corresponding to executed optimized binary translated code when an exception arises during its execution to recover a foreign state corresponding to a recovery point for the exception, wherein the foreign state is recovered by executing the operations for the one of the documentations. - View Dependent Claims (16, 17, 18)
-
Specification