Patent ID: 8549498

Claim:
A method for integrated trace selection and profiling in dynamic optimizers, comprising: selecting a trace head based on profile of basic blocks that are executed, wherein a basic block is selected as the trace head if a frequency of the basic block invoked exceeds a predetermined threshold that specifies a minimal frequency for the basic block to be selected as a trace head; recording next executed basic block as tail to the trace head forming a trace and adding the trace in a nursery in non-compiled state; and interpreting the trace in the nursery and profiling it until the trace matures, the profiling comprising maintaining a frequency of entries to the trace in the nursery and a count for each basic block where an exit has been taken on the trace, and wherein one or more counters associated with one or more basic blocks on the trace are not updated during the interpreting of the trace in the nursery; and transferring the trace out of the nursery to a compilation queue in response to determining that the trace has matured based on the frequency of entries of the profiled trace.