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

◆ UpdateAndExecute5< T0, T1, T2, T3, T4, TRet >()

static TRet System.Dynamic.UpdateDelegates.UpdateAndExecute5< T0, T1, T2, T3, T4, TRet > ( CallSite site,
T0 arg0,
T1 arg1,
T2 arg2,
T3 arg3,
T4 arg4 )
inlinestaticpackage

Definition at line 344 of file UpdateDelegates.cs.

345 {
347 Func<CallSite, T0, T1, T2, T3, T4, TRet> target = callSite.Target;
348 site = callSite.GetMatchmaker();
349 Func<CallSite, T0, T1, T2, T3, T4, TRet>[] rules;
350 Func<CallSite, T0, T1, T2, T3, T4, TRet> func;
351 if ((rules = CallSiteOps.GetRules(callSite)) != null)
352 {
353 for (int i = 0; i < rules.Length; i++)
354 {
355 func = rules[i];
356 if ((object)func != target)
357 {
358 callSite.Target = func;
359 TRet result = func(site, arg0, arg1, arg2, arg3, arg4);
360 if (CallSiteOps.GetMatch(site))
361 {
362 CallSiteOps.UpdateRules(callSite, i);
363 callSite.ReleaseMatchmaker(site);
364 return result;
365 }
367 }
368 }
369 }
370 RuleCache<Func<CallSite, T0, T1, T2, T3, T4, TRet>> ruleCache = CallSiteOps.GetRuleCache(callSite);
371 rules = ruleCache.GetRules();
372 for (int j = 0; j < rules.Length; j++)
373 {
374 func = (callSite.Target = rules[j]);
375 try
376 {
377 TRet result = func(site, arg0, arg1, arg2, arg3, arg4);
378 if (CallSiteOps.GetMatch(site))
379 {
380 callSite.ReleaseMatchmaker(site);
381 return result;
382 }
383 }
384 finally
385 {
386 if (CallSiteOps.GetMatch(site))
387 {
388 CallSiteOps.AddRule(callSite, func);
389 CallSiteOps.MoveRule(ruleCache, func, j);
390 }
391 }
393 }
394 func = null;
395 object[] args = new object[5] { arg0, arg1, arg2, arg3, arg4 };
396 while (true)
397 {
398 callSite.Target = target;
399 func = (callSite.Target = callSite.Binder.BindCore(callSite, args));
400 try
401 {
402 TRet result = func(site, arg0, arg1, arg2, arg3, arg4);
403 if (CallSiteOps.GetMatch(site))
404 {
405 callSite.ReleaseMatchmaker(site);
406 return result;
407 }
408 }
409 finally
410 {
411 if (CallSiteOps.GetMatch(site))
412 {
413 CallSiteOps.AddRule(callSite, func);
414 }
415 }
417 }
418 }
static bool GetMatch(CallSite site)
static void ClearMatch(CallSite site)
void ReleaseMatchmaker(CallSite matchMaker)
Definition CallSite.cs:106

References System.Runtime.CompilerServices.CallSite< T >.Binder, System.Runtime.CompilerServices.CallSiteOps.ClearMatch(), System.Runtime.CompilerServices.CallSiteOps.GetMatch(), System.Runtime.CompilerServices.CallSite< T >.GetMatchmaker(), System.Runtime.CompilerServices.RuleCache< T >.GetRules(), System.Runtime.CompilerServices.CallSite< T >.ReleaseMatchmaker(), and System.Runtime.CompilerServices.CallSite< T >.Target.