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

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

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

Definition at line 512 of file UpdateDelegates.cs.

513 {
515 Func<CallSite, T0, T1, T2, T3, T4, T5, T6, TRet> target = callSite.Target;
516 site = callSite.GetMatchmaker();
517 Func<CallSite, T0, T1, T2, T3, T4, T5, T6, TRet>[] rules;
518 Func<CallSite, T0, T1, T2, T3, T4, T5, T6, TRet> func;
519 if ((rules = CallSiteOps.GetRules(callSite)) != null)
520 {
521 for (int i = 0; i < rules.Length; i++)
522 {
523 func = rules[i];
524 if ((object)func != target)
525 {
526 callSite.Target = func;
527 TRet result = func(site, arg0, arg1, arg2, arg3, arg4, arg5, arg6);
528 if (CallSiteOps.GetMatch(site))
529 {
530 CallSiteOps.UpdateRules(callSite, i);
531 callSite.ReleaseMatchmaker(site);
532 return result;
533 }
535 }
536 }
537 }
539 rules = ruleCache.GetRules();
540 for (int j = 0; j < rules.Length; j++)
541 {
542 func = (callSite.Target = rules[j]);
543 try
544 {
545 TRet result = func(site, arg0, arg1, arg2, arg3, arg4, arg5, arg6);
546 if (CallSiteOps.GetMatch(site))
547 {
548 callSite.ReleaseMatchmaker(site);
549 return result;
550 }
551 }
552 finally
553 {
554 if (CallSiteOps.GetMatch(site))
555 {
556 CallSiteOps.AddRule(callSite, func);
557 CallSiteOps.MoveRule(ruleCache, func, j);
558 }
559 }
561 }
562 func = null;
563 object[] args = new object[7] { arg0, arg1, arg2, arg3, arg4, arg5, arg6 };
564 while (true)
565 {
566 callSite.Target = target;
567 func = (callSite.Target = callSite.Binder.BindCore(callSite, args));
568 try
569 {
570 TRet result = func(site, arg0, arg1, arg2, arg3, arg4, arg5, arg6);
571 if (CallSiteOps.GetMatch(site))
572 {
573 callSite.ReleaseMatchmaker(site);
574 return result;
575 }
576 }
577 finally
578 {
579 if (CallSiteOps.GetMatch(site))
580 {
581 CallSiteOps.AddRule(callSite, func);
582 }
583 }
585 }
586 }
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.