Method AddLazyFunctionGenerator
AddLazyFunctionGenerator(ILazyCompileExecutionEngine, String, LazyFunctionCompiler)
Add a lazy function generator
Declaration
public static void AddLazyFunctionGenerator([ValidatedNotNull] this ILazyCompileExecutionEngine jit, string name, LazyFunctionCompiler generator)
Parameters
public static void AddLazyFunctionGenerator([ValidatedNotNull] this ILazyCompileExecutionEngine jit, string name, LazyFunctionCompiler generator)
ILazyCompileExecutionEngine | jit | JIT to add the module to |
String | name | name of the function |
LazyFunctionCompiler | generator | Generator that will generate the bit-code module for the function on demand |
Remarks
A lazy function generator is an engine callback that is called when the JIT engine first encounters a symbol name during execution. If the function is never called, then the code is never generated (e.g. this is the real "JIT" part of a JIT engine.)
The generator
generates the IR module for the function. For this overload, the generator
must contain everything necessary to generate the BitcodeModule for the function. Typically, this is
a closure that captured the AST for the language and generates the IR from that state.