摘要 |
A computer-implemented system, method, and product are provided for multi-branch backpatching in a dynamic translator. Such backpatching typically increases the speed of execution of translated instructions by providing a direct control path from translated multi-branch-jump instructions to their translated target instructions. In one embodiment, the multi-branch backpatching dynamic translator undertakes backpatching on an "as-needed" basis at run time. That is, backpatching is done for those branch targets that are executed rather than for all branch targets, or rather than for those branch targets that are estimated or assumed will be executed. Such backpatching is accomplished in one embodiment by generating dynamic backpatching code specific to each translated multi-branch-jump instruction. A multi-branch jump, or switch, table of each multi-branch-jump instruction is initialized so that all entries direct control to the dynamic backpatching code for that instruction. As branches of the multi-branch-jump instruction are executed, the dynamic backpatching code enables a backpatcher that replaces the corresponding entry in the translated multi-branch-jump table with pointers to the address of the translated target address, if present.
|