One embodiment of the present invention provides a system that facilitates
deferring execution of instructions with unresolved data dependencies as
they are issued for execution in program order. During a normal execution
mode, the system issues instructions for execution in program order. Upon
encountering an unresolved data dependency during execution of an
instruction, the system generates a checkpoint that can subsequently be
used to return execution of the program to the point of the instruction.
Next, the system executes the instruction and subsequent instructions in
an execute-ahead mode, wherein instructions that cannot be executed
because of an unresolved data dependency are deferred, and wherein other
non-deferred instructions are executed in program order. Upon
encountering a store during the execute-ahead mode, the system determines
if the store buffer is full. If so, the system prefetches a cache line
for the store, and defers execution of the store. If the number of stores
that are encountered during execute-ahead mode exceeds the capacity of
the store buffer, which means that the store buffer will never have
additional space to accept additional stores during the execute-ahead
mode because the store buffer is gated, the system directly enters the
scout mode, without waiting for the deferred queue to eventually fill.