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

◆ UpdateAndExecuteVoid4< T0, T1, T2, T3 >()

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

Definition at line 1097 of file UpdateDelegates.cs.

1098 {
1100 Action<CallSite, T0, T1, T2, T3> target = callSite.Target;
1101 site = callSite.GetMatchmaker();
1102 Action<CallSite, T0, T1, T2, T3>[] rules;
1103 Action<CallSite, T0, T1, T2, T3> action;
1104 if ((rules = CallSiteOps.GetRules(callSite)) != null)
1105 {
1106 for (int i = 0; i < rules.Length; i++)
1107 {
1108 action = rules[i];
1109 if ((object)action != target)
1110 {
1111 callSite.Target = action;
1112 action(site, arg0, arg1, arg2, arg3);
1113 if (CallSiteOps.GetMatch(site))
1114 {
1115 CallSiteOps.UpdateRules(callSite, i);
1116 callSite.ReleaseMatchmaker(site);
1117 return;
1118 }
1119 CallSiteOps.ClearMatch(site);
1120 }
1121 }
1122 }
1123 RuleCache<Action<CallSite, T0, T1, T2, T3>> ruleCache = CallSiteOps.GetRuleCache(callSite);
1124 rules = ruleCache.GetRules();
1125 for (int j = 0; j < rules.Length; j++)
1126 {
1127 action = (callSite.Target = rules[j]);
1128 try
1129 {
1130 action(site, arg0, arg1, arg2, arg3);
1131 if (CallSiteOps.GetMatch(site))
1132 {
1133 callSite.ReleaseMatchmaker(site);
1134 return;
1135 }
1136 }
1137 finally
1138 {
1139 if (CallSiteOps.GetMatch(site))
1140 {
1141 CallSiteOps.AddRule(callSite, action);
1142 CallSiteOps.MoveRule(ruleCache, action, j);
1143 }
1144 }
1145 CallSiteOps.ClearMatch(site);
1146 }
1147 action = null;
1148 object[] args = new object[4] { arg0, arg1, arg2, arg3 };
1149 while (true)
1150 {
1151 callSite.Target = target;
1152 action = (callSite.Target = callSite.Binder.BindCore(callSite, args));
1153 try
1154 {
1155 action(site, arg0, arg1, arg2, arg3);
1156 if (CallSiteOps.GetMatch(site))
1157 {
1158 callSite.ReleaseMatchmaker(site);
1159 break;
1160 }
1161 }
1162 finally
1163 {
1164 if (CallSiteOps.GetMatch(site))
1165 {
1166 CallSiteOps.AddRule(callSite, action);
1167 }
1168 }
1169 CallSiteOps.ClearMatch(site);
1170 }
1171 }
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.