Patent ID: 7774531

Claim:
A method, comprising: executing instructions in a normal-execution mode on a processor that supports speculative execution; upon encountering a condition which causes the processor to enter a speculative-execution mode, performing a checkpoint and commencing execution of instructions in the speculative-execution mode; upon encountering an instruction which requires the allocation of an instance of a limited processor resource during the execution of instructions in speculative-execution mode, checking a speculative-use indicator associated with each instance of the limited processor resource, wherein the speculative-use indicator is asserted for an instance of the limited processor resource when the instance of the limited processor resource is allocated during speculative execution; upon finding that the speculative-use indicators are asserted for all instances of the limited processor resource which are available to be allocated for the instruction, aborting the instruction; and otherwise, upon finding that the speculative-use indicator is deasserted for an instance of the limited processor resource which is available to be allocated for the instruction, asserting the speculative-use indicator associated with the instance and executing the instruction.