Patent ID: 7900027

Claim:
A computer implemented method for managing a link stack in a data processing system that utilizes speculative pushes onto and pops from the link stack, the link stack comprising a set of entries, wherein each entry comprises a set of state bits, the method comprising: receiving a speculative push of a first instruction onto the link stack; storing the first instruction into a first entry of the set of entries of the link stack; responsive to receiving a speculative push of a first instruction, setting a first bit of a first set of state bits to indicate that the first instruction is a valid instruction; further responsive to receiving a speculative push of a first instruction, setting a second bit of the first set of state bits to indicate that the first instruction has been speculatively pushed onto the link stack; further responsive to receiving a speculative push of a first instruction, updating a link stack pointer control to indicate that the first entry is a top-of-data stack entry; receiving an indication that the speculative push of the first instruction is mispredicted; responsive to receiving the indication that the speculative push of the first instruction is mispredicted, clearing the first bit of the first set of state bits, clearing the second bit of the first set of state bits, and clearing a third bit of the first set of state bits; and setting the first entry as a bottom-of-data stack entry.