Patent ID: 8370821

Claim:
A computer-implemented method of program optimization, comprising the steps of: disassembling an entire code section of post-linked executable program code; pre-profiling said disassembled program code to identify hot portions thereof, said hot portions having a first frequency of execution that exceeds a first predefined threshold, and to identify a function in said hot portions; identifying potential call sites to said function in said hot portions of said disassembled entire code section; dissecting said disassembled entire code section to identify control flow properties and edge profile data therein; responsively to said control flow properties and said edge profile data, identifying call paths comprising chains of function calls leading to said call sites, wherein said chains include cyclic paths indicative of recursive function calls from one function to another function within respective chains, and wherein said call paths have a second frequency of execution that exceeds a second predefined threshold; cloning chains of functions corresponding to the chains of function calls in the call paths said function to create a modified program code having a plurality of cloned instances of said function therein, wherein cloning comprises replacing said cyclic paths within the chains of function calls by new paths comprising chains of inlined function calls, said new paths including an inlined call from the one function to the other function; redirecting said call paths of said modified program code to said call sites of respective cloned instances of said function; executing said modified program code while accumulating respective new clone-specific profile data for said redirected call paths therein; and optimizing said modified program code responsively to said clone-specific profile data.