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

◆ CreateCustomUpdateDelegate()

T System.Runtime.CompilerServices.CallSite< T >.CreateCustomUpdateDelegate ( MethodInfo invoke)
inlineprivate

Definition at line 232 of file CallSite.cs.

233 {
234 Type returnType = invoke.GetReturnType();
235 bool flag = returnType == typeof(void);
238 ParameterExpression[] array = Array.ConvertAll(invoke.GetParametersCached(), (ParameterInfo p) => Expression.Parameter(p.ParameterType, p.Name));
240 Type[] typeArguments = new Type[1] { typeof(T) };
242 ParameterExpression[] array2 = array.RemoveFirst();
244 builder2.UncheckedAdd(parameterExpression2);
247 builder2.UncheckedAdd(parameterExpression3);
249 builder2.UncheckedAdd(parameterExpression4);
251 builder2.UncheckedAdd(parameterExpression5);
255 if (!flag)
256 {
257 builder2.UncheckedAdd(parameterExpression6 = Expression.Variable(labelTarget.Type, "result"));
258 }
260 builder2.UncheckedAdd(parameterExpression7);
262 builder2.UncheckedAdd(parameterExpression8);
277 builder2.UncheckedAdd(parameterExpression9);
288 Expression[] list2 = Array.ConvertAll(array2, (ParameterExpression p) => Convert(p, typeof(object)));
289 builder2.UncheckedAdd(parameterExpression10);
294 builder.UncheckedAdd(Expression.Loop(Expression.Block(arg6, arg3, arg5, expression2), null, null));
295 builder.UncheckedAdd(Expression.Default(labelTarget.Type));
297 return expression6.Compile();
298 }
static ConstantExpression Constant(object? value)
static BlockExpression Block(Expression arg0, Expression arg1)
static DefaultExpression Default(Type type)
static BinaryExpression NotEqual(Expression left, Expression right)
static LambdaExpression Lambda(Expression body, params ParameterExpression[]? parameters)
static UnaryExpression ArrayLength(Expression array)
static GotoExpression Return(LabelTarget target)
static MethodCallExpression Call(MethodInfo method)
static BinaryExpression Assign(Expression left, Expression right)
static ParameterExpression Parameter(Type type)
static UnaryExpression PreIncrementAssign(Expression expression)
static GotoExpression Break(LabelTarget target)
static IndexExpression Property(Expression instance, string propertyName, params Expression[]? arguments)
static LabelExpression Label(LabelTarget target)
static ConditionalExpression IfThen(Expression test, Expression ifTrue)
static LoopExpression Loop(Expression body)
static UnaryExpression Convert(Expression expression, Type type)
static MemberExpression Field(Expression? expression, FieldInfo field)
static NewArrayExpression NewArrayInit(Type type, params Expression[] initializers)
static BinaryExpression Equal(Expression left, Expression right)
static TryExpression TryFinally(Expression body, Expression? @finally)
static IndexExpression ArrayAccess(Expression array, params Expression[]? indexes)
static ParameterExpression Variable(Type type)
static InvocationExpression Invoke(Expression expression)
static ConstantExpression Constant(bool value)
Definition Utils.cs:64

References System.array, System.Linq.Expressions.Expression< TDelegate >.ArrayAccess(), System.Linq.Expressions.Expression< TDelegate >.ArrayLength(), System.Linq.Expressions.Expression< TDelegate >.Assign(), System.Linq.Expressions.Expression< TDelegate >.Block(), System.Linq.Expressions.Expression< TDelegate >.Break(), System.Linq.Expressions.Expression< TDelegate >.Call(), System.Linq.Expressions.CachedReflectionInfo.CallSiteOps_AddRule, System.Linq.Expressions.CachedReflectionInfo.CallSiteOps_Bind, System.Linq.Expressions.CachedReflectionInfo.CallSiteOps_ClearMatch, System.Linq.Expressions.CachedReflectionInfo.CallSiteOps_CreateMatchmaker, System.Linq.Expressions.CachedReflectionInfo.CallSiteOps_GetCachedRules, System.Linq.Expressions.CachedReflectionInfo.CallSiteOps_GetMatch, System.Linq.Expressions.CachedReflectionInfo.CallSiteOps_GetRuleCache, System.Linq.Expressions.CachedReflectionInfo.CallSiteOps_GetRules, System.Linq.Expressions.CachedReflectionInfo.CallSiteOps_MoveRule, System.Linq.Expressions.CachedReflectionInfo.CallSiteOps_UpdateRules, System.Linq.Expressions.Utils.Constant(), System.Linq.Expressions.Expression< TDelegate >.Constant(), System.Linq.Expressions.Expression< TDelegate >.Convert(), System.Linq.Expressions.Convert, System.Linq.Expressions.Expression< TDelegate >.Default(), System.Linq.Expressions.Expression< TDelegate >.Equal(), System.Linq.Expressions.Expression< TDelegate >.Field(), System.Reflection.GetField, System.Reflection.GetProperty, System.Linq.Expressions.Expression< TDelegate >.IfThen(), System.Linq.Expressions.Expression< TDelegate >.Invoke(), System.Linq.Expressions.Expression< TDelegate >.Label(), System.Linq.Expressions.Expression< TDelegate >.Lambda(), System.list, System.Linq.Expressions.Expression< TDelegate >.Loop(), System.Reflection.ParameterInfo.Name, System.Linq.Expressions.Expression< TDelegate >.NewArrayInit(), System.Linq.Expressions.Expression< TDelegate >.NotEqual(), System.Linq.Expressions.Expression< TDelegate >.Parameter(), System.Reflection.ParameterInfo.ParameterType, System.Linq.Expressions.Expression< TDelegate >.PreIncrementAssign(), System.Linq.Expressions.Expression< TDelegate >.Property(), System.Linq.Expressions.Expression< TDelegate >.Return(), System.Linq.Expressions.Expression< TDelegate >.TryFinally(), and System.Linq.Expressions.Expression< TDelegate >.Variable().

Referenced by System.Runtime.CompilerServices.CallSite< T >.MakeUpdateDelegate().