Patent ID: 8694978

Claim:
A computer-implement method, comprising: receiving a function declaration for a program function, the function declaration referring to a first prototype function for the program function, the first prototype function differing from the program function, wherein source code of the first prototype function is a simplified version of source code of the program function and written in a same programming language as the source code of the program function, and the source code of the first prototype function includes an indicator that informs a compiler of a relationship among the program function, the first prototype function, and a functional side-effect behavior simulated by the first prototype function; simulating, by a processor, at least a first function side-effect behavior of the program function based on a first function side-effect behavior of the first prototype function; based on the simulated first function side-effect behavior of the program function, identifying one or more optimizations for a program that includes at least a first call to invoke the program function; generating intermediate source code based on the source code of the program function and the one or more optimizations; and generating object code based on the intermediate source code, while ignoring the first prototype function.