In a method for execution control acquisition of a program, during the
execution of the program, it is determined when a hardware performance
counter has reached a threshold. When the threshold is reached, execution
control is switched to a dynamic optimizer. Thereafter, an optimized
version of the program is executed. In a method for executing an
optimized version of a program, during execution of the optimized
version, an interrupt is received and execution control is returned to an
operating system. An original version of the program is then executed.
During the execution of the original version, a hardware performance
counter is monitored. When the hardware performance counter reaches a
threshold during the execution of the original version, execution control
is switched to a dynamic optimizer. Thereafter, the execution of the
optimized version of the program is continued as directed by the dynamic
optimizer.