Provided is a method for performing loop-unrolling optimization during program
execution. In one example, a method for loop optimization within a dynamic compiler
system is disclosed. A computer program having a loop structure is executed, wherein
the loop structure includes a loop exit test to be performed during each loop iteration.
The loop structure is compiled during the execution of the computer program, and
an unrolled loop structure is created during the compiling operation. The unrolled
loop structure includes plurality of loop bodies based on the original loop structure.
Further, the unrolled loop structure can include the loop exit test, which can
be performed once for each iteration of the plurality of loop bodies.