1. A method comprising: generating, by a computer in a computer system, profiling information for a plurality of executable blocks of a script, each of the executable blocks corresponding to one of a plurality of basic blocks of the script; identifying, by the computer, the executable blocks whose profiling information satisfies an optimization criterion; combining, by the computer and based on the optimization criterion, the basic blocks of the script corresponding to the identified executable blocks to form a region of the script; and generating, by the computer, an executable control region corresponding to the region of the script, the executable control region including instructions for executing the region of the script.