Patent ID: 8479178

Claim:
A computer system, comprising: one or more processors; and one or more computer-readable storage media having stored thereon computer-executable instructions that, when executed by the one or more processors, cause the computer system to implement a method for compiling code at runtime, the method comprising: executing a managed application at the computer system; and during execution of the managed application at the computer system: acquiring code that is to be executed by and during runtime of the managed application; identifying a code fragment comprising a subset of the acquired code; identifying runtime metadata representing a current context of the managed application; mapping the runtime metadata to native compiler symbols of a compile-time compiler that is configured to generate native code; passing the native compiler symbols and the code fragment to the compile-time compiler for compilation of the code fragment within the context of the native compiler symbols; intercepting an intermediate representation of the code fragment from the compile-time compiler; and executing the intermediate representation of the code fragment within the managed application.