Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ EmitConstant()

void System.Linq.Expressions.Compiler.BoundConstants.EmitConstant ( LambdaCompiler lc,
object value,
Type type )
inlinepackage

Definition at line 71 of file BoundConstants.cs.

72 {
73 if (_cache.TryGetValue(new TypedConstant(value, type), out var value2))
74 {
75 lc.IL.Emit(OpCodes.Ldloc, value2);
76 return;
77 }
80 }
bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
void EmitConstantFromArray(LambdaCompiler lc, object value, Type type)
static void EmitConstantsArray(LambdaCompiler lc)
readonly Dictionary< TypedConstant, LocalBuilder > _cache
static readonly OpCode Ldloc
Definition OpCodes.cs:425

References System.Linq.Expressions.Compiler.BoundConstants._cache, System.Linq.Expressions.Compiler.BoundConstants.EmitConstantFromArray(), System.Linq.Expressions.Compiler.BoundConstants.EmitConstantsArray(), System.Reflection.Emit.OpCodes.Ldloc, System.Collections.Generic.Dictionary< TKey, TValue >.TryGetValue(), System.type, and System.value.

Referenced by System.Linq.Expressions.Compiler.LambdaCompiler.EmitClosureCreation(), System.Linq.Expressions.Compiler.LambdaCompiler.EmitConstant(), and System.Linq.Expressions.Compiler.LambdaCompiler.EmitDelegateConstruction().