×

Method for selecting active code traces for translation in a caching dynamic translator

  • US 6,351,844 B1
  • Filed: 11/05/1998
  • Issued: 02/26/2002
  • Est. Priority Date: 11/05/1998
  • Status: Expired due to Fees
First Claim
Patent Images

1. A dynamic translator for executing a non-native program, the translator comprising:

  • an interpreter configured to receive non-native code words from a non-native code image of the non-native program and interpret the non-native code words into corresponding native code words, wherein the interpreter is configured to generate branch history data for each of a series of traces during execution of the non-native program;

    a trace buffer configured to receive and store the branch history data for the series of traces;

    a trace selector configured to receive the branch history data for the series of traces stored in the trace buffer and to use the received branch history data to identify hot traces, and is further configured to receive the non-native code image and to disassemble and translate the non-native code words for each hot trace into a translated code segment, wherein the branch history data includes a start address and a branch history value and wherein the trace selector is configured to count occurrences of one of (i) the start address and (ii) a combination of the start address and corresponding branch history value, and the trace selector is configured to mark as hot those traces corresponding to a count that exceeds a threshold, and wherein the trace selector is further configured to search for first and second traces in the series of traces having the same start address value which is marked as hot and where there are intervening traces which do not have the same start address value an the first and second traces and where the start address of the intervening traces are not marked as hot, where the trace selector is further configured to compand the intervening traces with the first trace to form a cyclic trace, and wherein the trace selector disassembles each hot trace by sequentially walking through the non-native code image beginning with the start address of the hot trace and translating each non-native code word into the translated code segment for the hot trace until a branch instruction is encountered whereupon a bit of the branch history value of the hot trace corresponding to the branch instruction is checked and, if the corresponding bit indicates that the branch was taken, then the branch instruction is inverted, the branch instruction is translated into the translated code segment and disassembly resumes at the target address of the branch instruction, and, if the corresponding bit indicates that the branch was not taken, the branch instruction is translated into the translated code segment and disassembly resumes with the next instruction in the sequence of the non-native code image; and

    a translated code cache configured to receive and store the translated code segment for each hot trace.

View all claims
  • 2 Assignments
Timeline View
Assignment View
    ×
    ×