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

◆ UpdateAndExecuteVoid3< T0, T1, T2 >()

static void System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid3< T0, T1, T2 > ( CallSite site,
T0 arg0,
T1 arg1,
T2 arg2 )
inlinestaticpackage

Definition at line 1014 of file UpdateDelegates.cs.

1015 {
1017 Action<CallSite, T0, T1, T2> target = callSite.Target;
1018 site = callSite.GetMatchmaker();
1019 Action<CallSite, T0, T1, T2>[] rules;
1020 Action<CallSite, T0, T1, T2> action;
1021 if ((rules = CallSiteOps.GetRules(callSite)) != null)
1022 {
1023 for (int i = 0; i < rules.Length; i++)
1024 {
1025 action = rules[i];
1026 if ((object)action != target)
1027 {
1028 callSite.Target = action;
1029 action(site, arg0, arg1, arg2);
1030 if (CallSiteOps.GetMatch(site))
1031 {
1032 CallSiteOps.UpdateRules(callSite, i);
1033 callSite.ReleaseMatchmaker(site);
1034 return;
1035 }
1036 CallSiteOps.ClearMatch(site);
1037 }
1038 }
1039 }
1040 RuleCache<Action<CallSite, T0, T1, T2>> ruleCache = CallSiteOps.GetRuleCache(callSite);
1041 rules = ruleCache.GetRules();
1042 for (int j = 0; j < rules.Length; j++)
1043 {
1044 action = (callSite.Target = rules[j]);
1045 try
1046 {
1047 action(site, arg0, arg1, arg2);
1048 if (CallSiteOps.GetMatch(site))
1049 {
1050 callSite.ReleaseMatchmaker(site);
1051 return;
1052 }
1053 }
1054 finally
1055 {
1056 if (CallSiteOps.GetMatch(site))
1057 {
1058 CallSiteOps.AddRule(callSite, action);
1059 CallSiteOps.MoveRule(ruleCache, action, j);
1060 }
1061 }
1062 CallSiteOps.ClearMatch(site);
1063 }
1064 action = null;
1065 object[] args = new object[3] { arg0, arg1, arg2 };
1066 while (true)
1067 {
1068 callSite.Target = target;
1069 action = (callSite.Target = callSite.Binder.BindCore(callSite, args));
1070 try
1071 {
1072 action(site, arg0, arg1, arg2);
1073 if (CallSiteOps.GetMatch(site))
1074 {
1075 callSite.ReleaseMatchmaker(site);
1076 break;
1077 }
1078 }
1079 finally
1080 {
1081 if (CallSiteOps.GetMatch(site))
1082 {
1083 CallSiteOps.AddRule(callSite, action);
1084 }
1085 }
1086 CallSiteOps.ClearMatch(site);
1087 }
1088 }
static bool GetMatch(CallSite site)
static void ClearMatch(CallSite site)
void ReleaseMatchmaker(CallSite matchMaker)
Definition CallSite.cs:106

References System.action, 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.