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

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

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

Definition at line 428 of file UpdateDelegates.cs.

429 {
431 Func<CallSite, T0, T1, T2, T3, T4, T5, TRet> target = callSite.Target;
432 site = callSite.GetMatchmaker();
433 Func<CallSite, T0, T1, T2, T3, T4, T5, TRet>[] rules;
434 Func<CallSite, T0, T1, T2, T3, T4, T5, TRet> func;
435 if ((rules = CallSiteOps.GetRules(callSite)) != null)
436 {
437 for (int i = 0; i < rules.Length; i++)
438 {
439 func = rules[i];
440 if ((object)func != target)
441 {
442 callSite.Target = func;
443 TRet result = func(site, arg0, arg1, arg2, arg3, arg4, arg5);
444 if (CallSiteOps.GetMatch(site))
445 {
446 CallSiteOps.UpdateRules(callSite, i);
447 callSite.ReleaseMatchmaker(site);
448 return result;
449 }
451 }
452 }
453 }
455 rules = ruleCache.GetRules();
456 for (int j = 0; j < rules.Length; j++)
457 {
458 func = (callSite.Target = rules[j]);
459 try
460 {
461 TRet result = func(site, arg0, arg1, arg2, arg3, arg4, arg5);
462 if (CallSiteOps.GetMatch(site))
463 {
464 callSite.ReleaseMatchmaker(site);
465 return result;
466 }
467 }
468 finally
469 {
470 if (CallSiteOps.GetMatch(site))
471 {
472 CallSiteOps.AddRule(callSite, func);
473 CallSiteOps.MoveRule(ruleCache, func, j);
474 }
475 }
477 }
478 func = null;
479 object[] args = new object[6] { arg0, arg1, arg2, arg3, arg4, arg5 };
480 while (true)
481 {
482 callSite.Target = target;
483 func = (callSite.Target = callSite.Binder.BindCore(callSite, args));
484 try
485 {
486 TRet result = func(site, arg0, arg1, arg2, arg3, arg4, arg5);
487 if (CallSiteOps.GetMatch(site))
488 {
489 callSite.ReleaseMatchmaker(site);
490 return result;
491 }
492 }
493 finally
494 {
495 if (CallSiteOps.GetMatch(site))
496 {
497 CallSiteOps.AddRule(callSite, func);
498 }
499 }
501 }
502 }
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.