Patent ID: 8612731

Claim:
A method for managing branch instructions in an emulation environment that is executing a program, the method comprising: populating a plurality of entries in a branch target buffer residing within an emulated environment in which the program is executing, each of the entries comprising an instruction address and a target address of a branch instruction of the program; based on an indirect branch instruction of the program being encountered, analyzing, by a processor one of the entries in the branch target buffer to determine if the instruction address of the one entry is associated with a target address of the indirect branch instruction, wherein the analyzing comprises using a hash function on a target address of the indirect branch instruction to obtain an indirect branch instruction target key, and comparing the instruction address of the one entry to the indirect branch instruction target key; and based on the instruction address of the one entry being associated with the target address of the indirect branch instruction, branching to the target address of the one entry.