The present invention relates to a method, apparatus, and system to optimize
frequently executed code and to use compiler transformation and hardware support
to handle infrequently executed code. The method includes compiling a computer
program. The method further includes improving performance of the computer program
by optimizing frequently executed code and using compiler transformation to handle
infrequently executed code with hardware support. The method also includes storing
temporarily the results produced during execution of a region to improve performance
of the computer program. The method additionally includes committing the results
produced when the execution of the region is completed successfully.