Patent ID: 9552195
Date: 2017-01-24
CPC Classifications: G06F

Claim:
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, and wherein at least some of the executable blocks handle a plurality of variables of a plurality of types; identifying, by the computer, a group of the executable blocks whose profiling information satisfies an optimization criterion, the optimization criterion including a specified type of the plurality of types for a variable in the group of executable blocks, the identifying including: determining, for the specified type, a specified path of execution of the executable blocks, and identifying a first set of executable blocks of the group in the specified path for generation of an executable control region, wherein the executable blocks follow different paths of execution for different types of the variable, wherein at least one of the first set of the executable blocks is executed for any of multiple types of the variable; verifying, by guard code of a specified executable block of the group of executable blocks, the specified type of the variable in the specified executable block, based on verification of the specified type of the variable in the specified executable block, determining a path of execution for the variable, wherein the path includes a sequence of control transfers between executable blocks of the group, and wherein the executable blocks of the group follow different paths of execution for different types of the variable, identifying, based on the sequence of control transfers, a sequence of executable blocks in the path of execution for the variable for the specified type; combining, by the computer, a set of the basic blocks of the script corresponding to the sequence of executable blocks to form a region of the script in the path of execution; and generating, by the computer and from set of the basic blocks of the script, an executable control region containing the sequence of executable blocks, for the set of the basic blocks, the executable control region including instructions for executing a region of the script having the set of the basic blocks, the generating including: generating, in a single phase, the executable control region for the set of the basic blocks, and storing the generated executable control region for execution in response to subsequent requests to execute the script.