Class CachedLambdaCompiler
Provides a set of compilation methods for lambda expressions that support caching the compiled delegate.
Inheritance
Namespace: System.Linq.Expressions
Assembly: Nuqleon.Linq.CompilerServices.dll
Syntax
public static class CachedLambdaCompiler : Object
Methods
Compile(LambdaExpression, ICompiledDelegateCache)
Compiles the specified lambda expression by hoisting constants from the expression and consulting the cache for the resulting templatized lambda expression. This technique increases the likelihood for a cache hit.
Declaration
public static Delegate Compile(this LambdaExpression expression, ICompiledDelegateCache cache)
Parameters
Type | Name | Description |
---|---|---|
System.Linq.Expressions.LambdaExpression | expression | Lambda expression to compile. |
ICompiledDelegateCache | cache | Cache to hold the compiled delegate. |
Returns
Type | Description |
---|---|
System.Delegate | Compiled delegate for the specified lambda expression. |
Compile(LambdaExpression, ICompiledDelegateCache, Boolean)
Compiles the specified lambda expression by hoisting constants from the expression and consulting the cache for the resulting templatized lambda expression. This technique increases the likelihood for a cache hit.
Declaration
public static Delegate Compile(this LambdaExpression expression, ICompiledDelegateCache cache, bool outliningEnabled)
Parameters
Type | Name | Description |
---|---|---|
System.Linq.Expressions.LambdaExpression | expression | Lambda expression to compile. |
ICompiledDelegateCache | cache | Cache to hold the compiled delegate. |
System.Boolean | outliningEnabled | Specifies whether nested lambda expressions should be outlined into delegate constants by recursive compilation using the cache. |
Returns
Type | Description |
---|---|
System.Delegate | Compiled delegate for the specified lambda expression. |
Compile(LambdaExpression, ICompiledDelegateCache, Boolean, IConstantHoister)
Compiles the specified lambda expression by hoisting constants from the expression and consulting the cache for the resulting templatized lambda expression. This technique increases the likelihood for a cache hit.
Declaration
public static Delegate Compile(this LambdaExpression expression, ICompiledDelegateCache cache, bool outliningEnabled, IConstantHoister hoister)
Parameters
Type | Name | Description |
---|---|---|
System.Linq.Expressions.LambdaExpression | expression | Lambda expression to compile. |
ICompiledDelegateCache | cache | Cache to hold the compiled delegate. |
System.Boolean | outliningEnabled | Specifies whether nested lambda expressions should be outlined into delegate constants by recursive compilation using the cache. |
IConstantHoister | hoister | Constant hoister used to selectively hoist constants in the specified expression. |
Returns
Type | Description |
---|---|
System.Delegate | Compiled delegate for the specified lambda expression. |
Compile<T>(Expression<T>, ICompiledDelegateCache)
Compiles the specified lambda expression by hoisting constants from the expression and consulting the cache for the resulting templatized lambda expression. This technique increases the likelihood for a cache hit.
Declaration
public static T Compile<T>(this Expression<T> expression, ICompiledDelegateCache cache)
Parameters
Type | Name | Description |
---|---|---|
System.Linq.Expressions.Expression<T> | expression | Lambda expression to compile. |
ICompiledDelegateCache | cache | Cache to hold the compiled delegate. |
Returns
Type | Description |
---|---|
T | Compiled delegate for the specified lambda expression. |
Type Parameters
Name | Description |
---|---|
T | Delegate type of the lambda expression. |
Compile<T>(Expression<T>, ICompiledDelegateCache, Boolean)
Compiles the specified lambda expression by hoisting constants from the expression and consulting the cache for the resulting templatized lambda expression. This technique increases the likelihood for a cache hit.
Declaration
public static T Compile<T>(this Expression<T> expression, ICompiledDelegateCache cache, bool outliningEnabled)
Parameters
Type | Name | Description |
---|---|---|
System.Linq.Expressions.Expression<T> | expression | Lambda expression to compile. |
ICompiledDelegateCache | cache | Cache to hold the compiled delegate. |
System.Boolean | outliningEnabled | Specifies whether nested lambda expressions should be outlined into delegate constants by recursive compilation using the cache. |
Returns
Type | Description |
---|---|
T | Compiled delegate for the specified lambda expression. |
Type Parameters
Name | Description |
---|---|
T | Delegate type of the lambda expression. |
Compile<T>(Expression<T>, ICompiledDelegateCache, Boolean, IConstantHoister)
Compiles the specified lambda expression by hoisting constants from the expression and consulting the cache for the resulting templatized lambda expression. This technique increases the likelihood for a cache hit.
Declaration
public static T Compile<T>(this Expression<T> expression, ICompiledDelegateCache cache, bool outliningEnabled, IConstantHoister hoister)
Parameters
Type | Name | Description |
---|---|---|
System.Linq.Expressions.Expression<T> | expression | Lambda expression to compile. |
ICompiledDelegateCache | cache | Cache to hold the compiled delegate. |
System.Boolean | outliningEnabled | Specifies whether nested lambda expressions should be outlined into delegate constants by recursive compilation using the cache. |
IConstantHoister | hoister | Constant hoister used to selectively hoist constants in the specified expression. |
Returns
Type | Description |
---|---|
T | Compiled delegate for the specified lambda expression. |
Type Parameters
Name | Description |
---|---|
T | Delegate type of the lambda expression. |