摘要 |
Precise exception handling relies on a precise subject state including an accurate program counter and register values of a subject processor. Subject code (17) is translated into target code (21) executable by a target processor (13). The generated target code (17) includes counterpart target instructions (214) associated with fault-vulnerable subject code instructions (174). Further, each of the counterpart target code instruction (214) is associated with recovery information (195). When an exception (e.g. a fault) occurs, the recovery information (195) is retrieved and used to recover a precise subject state, in particular by taking account of optimizations to generate the common-case target code (21). The precise subject state is then used to precisely handle the exception. Interupts to the target code execution may be handled by continuing execution until a target instruction, which corresponds to a potentially faulting subject instruction, and using the associated recovery information to handle the interrupt (figures 10 and 11).
|