Patent ID: 8516230

Claim:
A method comprising: compiling, by a compiler, source code, wherein, during compilation of the source code: in response to encountering an indirect branch instruction in the source code, inserting a set of instruction tag (ITAG) based instructions for generating an ITAG for the indirect branch and performing a lookup operation in an instruction cache directory, into compiled code corresponding to the source code, and in response to encountering a direct branch instruction, the compiler inserts into the compiled code, a branch descriptor comprising a target instruction space address and a trampoline instruction for redirecting execution to an instruction cache manager for translating the target instruction space address, and wherein branch descriptors and trampoline instructions are inserted by the compiler only for direct branches; executing the direct branch instruction, located in an instruction cache line, the execution resulting in branching to the branch descriptor that is located in the instruction cache line; in response to branching to the branch descriptor, executing the trampoline branch instruction that sends a branch descriptor pointer to an instruction cache manager, wherein the branch descriptor pointer points back to the branch descriptor; extracting, by the instruction cache manager, the target instruction space address from the branch descriptor; and executing a target instruction corresponding to the target instruction space address.