Patent ID: 8332833

Claim:
A computer program product comprising: a computer storage medium having computer usable program code for specializing code, the computer program product including: computer usable program code for scanning the source code to identify a candidate region, wherein the source code of the candidate region includes memory allocation commands; computer usable program code for generating a procedure control descriptor, wherein the procedure control descriptor comprises a data structure containing a list of region procedure control descriptors containing context dependent information which corresponds to the candidate region, and wherein the procedure control descriptor identifies, for the candidate region, a condition which, if true at runtime means that the candidate region can be specialized; and computer usable program code, responsive to a determination during compile time that satisfaction of at least one condition will be known only at runtime, for using the procedure control descriptor to specialize the candidate region at compile time to create a first version of the candidate region for execution in a case where the condition is true and a second version of the candidate region for execution in a case where the condition is false, and further generating code to correctly select one of the first region and the second region at runtime.