1. A computer implemented method for using multiple modes in execution of a program, comprising: using at least one processor of a computing system for performing a process, the process comprising: initiating, continuing, or resuming execution of the program in a first mode using a first code of a first portion of the program; identifying a single trigger to switch the execution of the program multiple times among multiple modes including the first mode and a second mode; determining whether preparation that comprises a second code for the second mode exists, further comprising: when the preparation for the second mode is determined not to exist, stopping the execution of the program in the first mode and generating the preparation, generating the preparation further comprising at least one of: modifying a dispatch table at or before an entry point of a second portion of the program in the execution of the program in the first mode; or modifying an address at or before the entry point of the second portion of the program in the execution of the program in the first mode; switching to the second mode in response to the single trigger to improve performance of the execution of the program without re-executing the first portion of the program and without compiling a source code or an intermediate code of the program for switching to the second mode, wherein the switching is implemented by using the dispatch table with entries associated with the multiple modes and selecting an entry of the dispatch table corresponding to the second mode; generating the second code of the second portion of the program for the execution of the program in the second mode, wherein the first portion is different from the second portion; and continuing the execution of the program with the second code in the second mode.