1. A method comprising: compiling, with a first compiler, source code of a target function to generate ahead-of-time (AOT) compiled machine code for the target function; compiling, with a second compiler, the source code of the target function to generate an intermediate representation (IR) of the target function; determining that the target function should be just-in-time (JIT) compiled; in response to determining that the target function should be JIT compiled, linking the AOT-compiled machine code for the target function to the IR of the target function; wherein the method is performed by one or more computing devices.