1 /* ****************************************************************************
3 * Copyright (c) Microsoft Corporation.
5 * This source code is subject to terms and conditions of the Microsoft Public License. A
6 * copy of the license can be found in the License.html file at the root of this distribution. If
7 * you cannot locate the Microsoft Public License, please send an email to
8 * dlr@microsoft.com. By using this source code in any fashion, you are agreeing to be bound
9 * by the terms of the Microsoft Public License.
11 * You must not remove this notice, or any other, from this software.
14 * ***************************************************************************/
15 using System; using Microsoft;
18 using System.Runtime.CompilerServices;
20 using Microsoft.Runtime.CompilerServices;
23 using System.Threading;
26 namespace System.Dynamic {
28 namespace Microsoft.Scripting {
30 internal static partial class UpdateDelegates {
33 // WARNING: do not edit these methods here. The real source code lives
34 // in two places: generate_dynsites.py, which generates the methods in
35 // this file, and UpdateDelegates.cs, which dynamically generates
36 // methods like these at run time. If you want to make a change, edit
37 // *both* of those files instead
40 #region Generated UpdateAndExecute Methods
42 // *** BEGIN GENERATED CODE ***
43 // generated by function: gen_update_targets from: generate_dynsites.py
46 [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
47 internal static TRet UpdateAndExecute0<TRet>(CallSite site) {
49 // Declare the locals here upfront. It actually saves JIT stack space.
51 var @this = (CallSite<Func<CallSite, TRet>>)site;
52 Func<CallSite, TRet>[] applicable;
53 Func<CallSite, TRet> rule, originalRule = @this.Target;
58 // Create matchmaker and its site. We'll need them regardless.
60 site = CallSiteOps.CreateMatchmaker(@this);
63 // Level 1 cache lookup
65 if ((applicable = CallSiteOps.GetRules(@this)) != null) {
66 for (int i = 0; i < applicable.Length; i++) {
73 // if we've already tried it skip it...
74 if ((object)rule != (object)originalRule) {
78 if (CallSiteOps.GetMatch(site)) {
79 CallSiteOps.UpdateRules(@this, i);
83 // Rule didn't match, try the next one
84 CallSiteOps.ClearMatch(site);
90 // Level 2 cache lookup
94 // Any applicable rules in level 2 cache?
97 var cache = CallSiteOps.GetRuleCache(@this);
99 applicable = cache.GetRules();
100 for (int i = 0; i < applicable.Length; i++) {
101 rule = applicable[i];
110 if (CallSiteOps.GetMatch(site)) {
114 if (CallSiteOps.GetMatch(site)) {
116 // Rule worked. Add it to level 1 cache
118 CallSiteOps.AddRule(@this, rule);
119 // and then move it to the front of the L2 cache
120 CallSiteOps.MoveRule(cache, rule, i);
124 // Rule didn't match, try the next one
125 CallSiteOps.ClearMatch(site);
129 // Miss on Level 0, 1 and 2 caches. Create new rule
133 var args = new object[] { };
136 @this.Target = originalRule;
137 rule = @this.Target = @this.Binder.BindCore(@this, args);
140 // Execute the rule on the matchmaker site
145 if (CallSiteOps.GetMatch(site)) {
149 if (CallSiteOps.GetMatch(site)) {
151 // The rule worked. Add it to level 1 cache.
153 CallSiteOps.AddRule(@this, rule);
157 // Rule we got back didn't work, try another one
158 CallSiteOps.ClearMatch(site);
162 [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
163 [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")]
164 internal static TRet NoMatch0<TRet>(CallSite site) {
166 return default(TRet);
171 [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
172 internal static TRet UpdateAndExecute1<T0, TRet>(CallSite site, T0 arg0) {
174 // Declare the locals here upfront. It actually saves JIT stack space.
176 var @this = (CallSite<Func<CallSite, T0, TRet>>)site;
177 Func<CallSite, T0, TRet>[] applicable;
178 Func<CallSite, T0, TRet> rule, originalRule = @this.Target;
183 // Create matchmaker and its site. We'll need them regardless.
185 site = CallSiteOps.CreateMatchmaker(@this);
188 // Level 1 cache lookup
190 if ((applicable = CallSiteOps.GetRules(@this)) != null) {
191 for (int i = 0; i < applicable.Length; i++) {
192 rule = applicable[i];
198 // if we've already tried it skip it...
199 if ((object)rule != (object)originalRule) {
201 result = rule(site, arg0);
203 if (CallSiteOps.GetMatch(site)) {
204 CallSiteOps.UpdateRules(@this, i);
208 // Rule didn't match, try the next one
209 CallSiteOps.ClearMatch(site);
215 // Level 2 cache lookup
219 // Any applicable rules in level 2 cache?
222 var cache = CallSiteOps.GetRuleCache(@this);
224 applicable = cache.GetRules();
225 for (int i = 0; i < applicable.Length; i++) {
226 rule = applicable[i];
234 result = rule(site, arg0);
235 if (CallSiteOps.GetMatch(site)) {
239 if (CallSiteOps.GetMatch(site)) {
241 // Rule worked. Add it to level 1 cache
243 CallSiteOps.AddRule(@this, rule);
244 // and then move it to the front of the L2 cache
245 CallSiteOps.MoveRule(cache, rule, i);
249 // Rule didn't match, try the next one
250 CallSiteOps.ClearMatch(site);
254 // Miss on Level 0, 1 and 2 caches. Create new rule
258 var args = new object[] { arg0 };
261 @this.Target = originalRule;
262 rule = @this.Target = @this.Binder.BindCore(@this, args);
265 // Execute the rule on the matchmaker site
269 result = rule(site, arg0);
270 if (CallSiteOps.GetMatch(site)) {
274 if (CallSiteOps.GetMatch(site)) {
276 // The rule worked. Add it to level 1 cache.
278 CallSiteOps.AddRule(@this, rule);
282 // Rule we got back didn't work, try another one
283 CallSiteOps.ClearMatch(site);
287 [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
288 [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")]
289 internal static TRet NoMatch1<T0, TRet>(CallSite site, T0 arg0) {
291 return default(TRet);
296 [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
297 internal static TRet UpdateAndExecute2<T0, T1, TRet>(CallSite site, T0 arg0, T1 arg1) {
299 // Declare the locals here upfront. It actually saves JIT stack space.
301 var @this = (CallSite<Func<CallSite, T0, T1, TRet>>)site;
302 Func<CallSite, T0, T1, TRet>[] applicable;
303 Func<CallSite, T0, T1, TRet> rule, originalRule = @this.Target;
308 // Create matchmaker and its site. We'll need them regardless.
310 site = CallSiteOps.CreateMatchmaker(@this);
313 // Level 1 cache lookup
315 if ((applicable = CallSiteOps.GetRules(@this)) != null) {
316 for (int i = 0; i < applicable.Length; i++) {
317 rule = applicable[i];
323 // if we've already tried it skip it...
324 if ((object)rule != (object)originalRule) {
326 result = rule(site, arg0, arg1);
328 if (CallSiteOps.GetMatch(site)) {
329 CallSiteOps.UpdateRules(@this, i);
333 // Rule didn't match, try the next one
334 CallSiteOps.ClearMatch(site);
340 // Level 2 cache lookup
344 // Any applicable rules in level 2 cache?
347 var cache = CallSiteOps.GetRuleCache(@this);
349 applicable = cache.GetRules();
350 for (int i = 0; i < applicable.Length; i++) {
351 rule = applicable[i];
359 result = rule(site, arg0, arg1);
360 if (CallSiteOps.GetMatch(site)) {
364 if (CallSiteOps.GetMatch(site)) {
366 // Rule worked. Add it to level 1 cache
368 CallSiteOps.AddRule(@this, rule);
369 // and then move it to the front of the L2 cache
370 CallSiteOps.MoveRule(cache, rule, i);
374 // Rule didn't match, try the next one
375 CallSiteOps.ClearMatch(site);
379 // Miss on Level 0, 1 and 2 caches. Create new rule
383 var args = new object[] { arg0, arg1 };
386 @this.Target = originalRule;
387 rule = @this.Target = @this.Binder.BindCore(@this, args);
390 // Execute the rule on the matchmaker site
394 result = rule(site, arg0, arg1);
395 if (CallSiteOps.GetMatch(site)) {
399 if (CallSiteOps.GetMatch(site)) {
401 // The rule worked. Add it to level 1 cache.
403 CallSiteOps.AddRule(@this, rule);
407 // Rule we got back didn't work, try another one
408 CallSiteOps.ClearMatch(site);
412 [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
413 [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")]
414 internal static TRet NoMatch2<T0, T1, TRet>(CallSite site, T0 arg0, T1 arg1) {
416 return default(TRet);
421 [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
422 internal static TRet UpdateAndExecute3<T0, T1, T2, TRet>(CallSite site, T0 arg0, T1 arg1, T2 arg2) {
424 // Declare the locals here upfront. It actually saves JIT stack space.
426 var @this = (CallSite<Func<CallSite, T0, T1, T2, TRet>>)site;
427 Func<CallSite, T0, T1, T2, TRet>[] applicable;
428 Func<CallSite, T0, T1, T2, TRet> rule, originalRule = @this.Target;
433 // Create matchmaker and its site. We'll need them regardless.
435 site = CallSiteOps.CreateMatchmaker(@this);
438 // Level 1 cache lookup
440 if ((applicable = CallSiteOps.GetRules(@this)) != null) {
441 for (int i = 0; i < applicable.Length; i++) {
442 rule = applicable[i];
448 // if we've already tried it skip it...
449 if ((object)rule != (object)originalRule) {
451 result = rule(site, arg0, arg1, arg2);
453 if (CallSiteOps.GetMatch(site)) {
454 CallSiteOps.UpdateRules(@this, i);
458 // Rule didn't match, try the next one
459 CallSiteOps.ClearMatch(site);
465 // Level 2 cache lookup
469 // Any applicable rules in level 2 cache?
472 var cache = CallSiteOps.GetRuleCache(@this);
474 applicable = cache.GetRules();
475 for (int i = 0; i < applicable.Length; i++) {
476 rule = applicable[i];
484 result = rule(site, arg0, arg1, arg2);
485 if (CallSiteOps.GetMatch(site)) {
489 if (CallSiteOps.GetMatch(site)) {
491 // Rule worked. Add it to level 1 cache
493 CallSiteOps.AddRule(@this, rule);
494 // and then move it to the front of the L2 cache
495 CallSiteOps.MoveRule(cache, rule, i);
499 // Rule didn't match, try the next one
500 CallSiteOps.ClearMatch(site);
504 // Miss on Level 0, 1 and 2 caches. Create new rule
508 var args = new object[] { arg0, arg1, arg2 };
511 @this.Target = originalRule;
512 rule = @this.Target = @this.Binder.BindCore(@this, args);
515 // Execute the rule on the matchmaker site
519 result = rule(site, arg0, arg1, arg2);
520 if (CallSiteOps.GetMatch(site)) {
524 if (CallSiteOps.GetMatch(site)) {
526 // The rule worked. Add it to level 1 cache.
528 CallSiteOps.AddRule(@this, rule);
532 // Rule we got back didn't work, try another one
533 CallSiteOps.ClearMatch(site);
537 [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
538 [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")]
539 internal static TRet NoMatch3<T0, T1, T2, TRet>(CallSite site, T0 arg0, T1 arg1, T2 arg2) {
541 return default(TRet);
546 [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
547 internal static TRet UpdateAndExecute4<T0, T1, T2, T3, TRet>(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) {
549 // Declare the locals here upfront. It actually saves JIT stack space.
551 var @this = (CallSite<Func<CallSite, T0, T1, T2, T3, TRet>>)site;
552 Func<CallSite, T0, T1, T2, T3, TRet>[] applicable;
553 Func<CallSite, T0, T1, T2, T3, TRet> rule, originalRule = @this.Target;
558 // Create matchmaker and its site. We'll need them regardless.
560 site = CallSiteOps.CreateMatchmaker(@this);
563 // Level 1 cache lookup
565 if ((applicable = CallSiteOps.GetRules(@this)) != null) {
566 for (int i = 0; i < applicable.Length; i++) {
567 rule = applicable[i];
573 // if we've already tried it skip it...
574 if ((object)rule != (object)originalRule) {
576 result = rule(site, arg0, arg1, arg2, arg3);
578 if (CallSiteOps.GetMatch(site)) {
579 CallSiteOps.UpdateRules(@this, i);
583 // Rule didn't match, try the next one
584 CallSiteOps.ClearMatch(site);
590 // Level 2 cache lookup
594 // Any applicable rules in level 2 cache?
597 var cache = CallSiteOps.GetRuleCache(@this);
599 applicable = cache.GetRules();
600 for (int i = 0; i < applicable.Length; i++) {
601 rule = applicable[i];
609 result = rule(site, arg0, arg1, arg2, arg3);
610 if (CallSiteOps.GetMatch(site)) {
614 if (CallSiteOps.GetMatch(site)) {
616 // Rule worked. Add it to level 1 cache
618 CallSiteOps.AddRule(@this, rule);
619 // and then move it to the front of the L2 cache
620 CallSiteOps.MoveRule(cache, rule, i);
624 // Rule didn't match, try the next one
625 CallSiteOps.ClearMatch(site);
629 // Miss on Level 0, 1 and 2 caches. Create new rule
633 var args = new object[] { arg0, arg1, arg2, arg3 };
636 @this.Target = originalRule;
637 rule = @this.Target = @this.Binder.BindCore(@this, args);
640 // Execute the rule on the matchmaker site
644 result = rule(site, arg0, arg1, arg2, arg3);
645 if (CallSiteOps.GetMatch(site)) {
649 if (CallSiteOps.GetMatch(site)) {
651 // The rule worked. Add it to level 1 cache.
653 CallSiteOps.AddRule(@this, rule);
657 // Rule we got back didn't work, try another one
658 CallSiteOps.ClearMatch(site);
662 [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
663 [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")]
664 internal static TRet NoMatch4<T0, T1, T2, T3, TRet>(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) {
666 return default(TRet);
671 [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
672 internal static TRet UpdateAndExecute5<T0, T1, T2, T3, T4, TRet>(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4) {
674 // Declare the locals here upfront. It actually saves JIT stack space.
676 var @this = (CallSite<Func<CallSite, T0, T1, T2, T3, T4, TRet>>)site;
677 Func<CallSite, T0, T1, T2, T3, T4, TRet>[] applicable;
678 Func<CallSite, T0, T1, T2, T3, T4, TRet> rule, originalRule = @this.Target;
683 // Create matchmaker and its site. We'll need them regardless.
685 site = CallSiteOps.CreateMatchmaker(@this);
688 // Level 1 cache lookup
690 if ((applicable = CallSiteOps.GetRules(@this)) != null) {
691 for (int i = 0; i < applicable.Length; i++) {
692 rule = applicable[i];
698 // if we've already tried it skip it...
699 if ((object)rule != (object)originalRule) {
701 result = rule(site, arg0, arg1, arg2, arg3, arg4);
703 if (CallSiteOps.GetMatch(site)) {
704 CallSiteOps.UpdateRules(@this, i);
708 // Rule didn't match, try the next one
709 CallSiteOps.ClearMatch(site);
715 // Level 2 cache lookup
719 // Any applicable rules in level 2 cache?
722 var cache = CallSiteOps.GetRuleCache(@this);
724 applicable = cache.GetRules();
725 for (int i = 0; i < applicable.Length; i++) {
726 rule = applicable[i];
734 result = rule(site, arg0, arg1, arg2, arg3, arg4);
735 if (CallSiteOps.GetMatch(site)) {
739 if (CallSiteOps.GetMatch(site)) {
741 // Rule worked. Add it to level 1 cache
743 CallSiteOps.AddRule(@this, rule);
744 // and then move it to the front of the L2 cache
745 CallSiteOps.MoveRule(cache, rule, i);
749 // Rule didn't match, try the next one
750 CallSiteOps.ClearMatch(site);
754 // Miss on Level 0, 1 and 2 caches. Create new rule
758 var args = new object[] { arg0, arg1, arg2, arg3, arg4 };
761 @this.Target = originalRule;
762 rule = @this.Target = @this.Binder.BindCore(@this, args);
765 // Execute the rule on the matchmaker site
769 result = rule(site, arg0, arg1, arg2, arg3, arg4);
770 if (CallSiteOps.GetMatch(site)) {
774 if (CallSiteOps.GetMatch(site)) {
776 // The rule worked. Add it to level 1 cache.
778 CallSiteOps.AddRule(@this, rule);
782 // Rule we got back didn't work, try another one
783 CallSiteOps.ClearMatch(site);
787 [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
788 [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")]
789 internal static TRet NoMatch5<T0, T1, T2, T3, T4, TRet>(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4) {
791 return default(TRet);
796 [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
797 internal static TRet UpdateAndExecute6<T0, T1, T2, T3, T4, T5, TRet>(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5) {
799 // Declare the locals here upfront. It actually saves JIT stack space.
801 var @this = (CallSite<Func<CallSite, T0, T1, T2, T3, T4, T5, TRet>>)site;
802 Func<CallSite, T0, T1, T2, T3, T4, T5, TRet>[] applicable;
803 Func<CallSite, T0, T1, T2, T3, T4, T5, TRet> rule, originalRule = @this.Target;
808 // Create matchmaker and its site. We'll need them regardless.
810 site = CallSiteOps.CreateMatchmaker(@this);
813 // Level 1 cache lookup
815 if ((applicable = CallSiteOps.GetRules(@this)) != null) {
816 for (int i = 0; i < applicable.Length; i++) {
817 rule = applicable[i];
823 // if we've already tried it skip it...
824 if ((object)rule != (object)originalRule) {
826 result = rule(site, arg0, arg1, arg2, arg3, arg4, arg5);
828 if (CallSiteOps.GetMatch(site)) {
829 CallSiteOps.UpdateRules(@this, i);
833 // Rule didn't match, try the next one
834 CallSiteOps.ClearMatch(site);
840 // Level 2 cache lookup
844 // Any applicable rules in level 2 cache?
847 var cache = CallSiteOps.GetRuleCache(@this);
849 applicable = cache.GetRules();
850 for (int i = 0; i < applicable.Length; i++) {
851 rule = applicable[i];
859 result = rule(site, arg0, arg1, arg2, arg3, arg4, arg5);
860 if (CallSiteOps.GetMatch(site)) {
864 if (CallSiteOps.GetMatch(site)) {
866 // Rule worked. Add it to level 1 cache
868 CallSiteOps.AddRule(@this, rule);
869 // and then move it to the front of the L2 cache
870 CallSiteOps.MoveRule(cache, rule, i);
874 // Rule didn't match, try the next one
875 CallSiteOps.ClearMatch(site);
879 // Miss on Level 0, 1 and 2 caches. Create new rule
883 var args = new object[] { arg0, arg1, arg2, arg3, arg4, arg5 };
886 @this.Target = originalRule;
887 rule = @this.Target = @this.Binder.BindCore(@this, args);
890 // Execute the rule on the matchmaker site
894 result = rule(site, arg0, arg1, arg2, arg3, arg4, arg5);
895 if (CallSiteOps.GetMatch(site)) {
899 if (CallSiteOps.GetMatch(site)) {
901 // The rule worked. Add it to level 1 cache.
903 CallSiteOps.AddRule(@this, rule);
907 // Rule we got back didn't work, try another one
908 CallSiteOps.ClearMatch(site);
912 [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
913 [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")]
914 internal static TRet NoMatch6<T0, T1, T2, T3, T4, T5, TRet>(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5) {
916 return default(TRet);
921 [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
922 internal static TRet 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) {
924 // Declare the locals here upfront. It actually saves JIT stack space.
926 var @this = (CallSite<Func<CallSite, T0, T1, T2, T3, T4, T5, T6, TRet>>)site;
927 Func<CallSite, T0, T1, T2, T3, T4, T5, T6, TRet>[] applicable;
928 Func<CallSite, T0, T1, T2, T3, T4, T5, T6, TRet> rule, originalRule = @this.Target;
933 // Create matchmaker and its site. We'll need them regardless.
935 site = CallSiteOps.CreateMatchmaker(@this);
938 // Level 1 cache lookup
940 if ((applicable = CallSiteOps.GetRules(@this)) != null) {
941 for (int i = 0; i < applicable.Length; i++) {
942 rule = applicable[i];
948 // if we've already tried it skip it...
949 if ((object)rule != (object)originalRule) {
951 result = rule(site, arg0, arg1, arg2, arg3, arg4, arg5, arg6);
953 if (CallSiteOps.GetMatch(site)) {
954 CallSiteOps.UpdateRules(@this, i);
958 // Rule didn't match, try the next one
959 CallSiteOps.ClearMatch(site);
965 // Level 2 cache lookup
969 // Any applicable rules in level 2 cache?
972 var cache = CallSiteOps.GetRuleCache(@this);
974 applicable = cache.GetRules();
975 for (int i = 0; i < applicable.Length; i++) {
976 rule = applicable[i];
984 result = rule(site, arg0, arg1, arg2, arg3, arg4, arg5, arg6);
985 if (CallSiteOps.GetMatch(site)) {
989 if (CallSiteOps.GetMatch(site)) {
991 // Rule worked. Add it to level 1 cache
993 CallSiteOps.AddRule(@this, rule);
994 // and then move it to the front of the L2 cache
995 CallSiteOps.MoveRule(cache, rule, i);
999 // Rule didn't match, try the next one
1000 CallSiteOps.ClearMatch(site);
1004 // Miss on Level 0, 1 and 2 caches. Create new rule
1008 var args = new object[] { arg0, arg1, arg2, arg3, arg4, arg5, arg6 };
1011 @this.Target = originalRule;
1012 rule = @this.Target = @this.Binder.BindCore(@this, args);
1015 // Execute the rule on the matchmaker site
1019 result = rule(site, arg0, arg1, arg2, arg3, arg4, arg5, arg6);
1020 if (CallSiteOps.GetMatch(site)) {
1024 if (CallSiteOps.GetMatch(site)) {
1026 // The rule worked. Add it to level 1 cache.
1028 CallSiteOps.AddRule(@this, rule);
1032 // Rule we got back didn't work, try another one
1033 CallSiteOps.ClearMatch(site);
1037 [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
1038 [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")]
1039 internal static TRet NoMatch7<T0, T1, T2, T3, T4, T5, T6, TRet>(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6) {
1040 site._match = false;
1041 return default(TRet);
1046 [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
1047 internal static TRet UpdateAndExecute8<T0, T1, T2, T3, T4, T5, T6, T7, TRet>(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7) {
1049 // Declare the locals here upfront. It actually saves JIT stack space.
1051 var @this = (CallSite<Func<CallSite, T0, T1, T2, T3, T4, T5, T6, T7, TRet>>)site;
1052 Func<CallSite, T0, T1, T2, T3, T4, T5, T6, T7, TRet>[] applicable;
1053 Func<CallSite, T0, T1, T2, T3, T4, T5, T6, T7, TRet> rule, originalRule = @this.Target;
1058 // Create matchmaker and its site. We'll need them regardless.
1060 site = CallSiteOps.CreateMatchmaker(@this);
1063 // Level 1 cache lookup
1065 if ((applicable = CallSiteOps.GetRules(@this)) != null) {
1066 for (int i = 0; i < applicable.Length; i++) {
1067 rule = applicable[i];
1073 // if we've already tried it skip it...
1074 if ((object)rule != (object)originalRule) {
1075 @this.Target = rule;
1076 result = rule(site, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
1078 if (CallSiteOps.GetMatch(site)) {
1079 CallSiteOps.UpdateRules(@this, i);
1083 // Rule didn't match, try the next one
1084 CallSiteOps.ClearMatch(site);
1090 // Level 2 cache lookup
1094 // Any applicable rules in level 2 cache?
1097 var cache = CallSiteOps.GetRuleCache(@this);
1099 applicable = cache.GetRules();
1100 for (int i = 0; i < applicable.Length; i++) {
1101 rule = applicable[i];
1106 @this.Target = rule;
1109 result = rule(site, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
1110 if (CallSiteOps.GetMatch(site)) {
1114 if (CallSiteOps.GetMatch(site)) {
1116 // Rule worked. Add it to level 1 cache
1118 CallSiteOps.AddRule(@this, rule);
1119 // and then move it to the front of the L2 cache
1120 CallSiteOps.MoveRule(cache, rule, i);
1124 // Rule didn't match, try the next one
1125 CallSiteOps.ClearMatch(site);
1129 // Miss on Level 0, 1 and 2 caches. Create new rule
1133 var args = new object[] { arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7 };
1136 @this.Target = originalRule;
1137 rule = @this.Target = @this.Binder.BindCore(@this, args);
1140 // Execute the rule on the matchmaker site
1144 result = rule(site, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
1145 if (CallSiteOps.GetMatch(site)) {
1149 if (CallSiteOps.GetMatch(site)) {
1151 // The rule worked. Add it to level 1 cache.
1153 CallSiteOps.AddRule(@this, rule);
1157 // Rule we got back didn't work, try another one
1158 CallSiteOps.ClearMatch(site);
1162 [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
1163 [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")]
1164 internal static TRet NoMatch8<T0, T1, T2, T3, T4, T5, T6, T7, TRet>(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7) {
1165 site._match = false;
1166 return default(TRet);
1171 [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
1172 internal static TRet UpdateAndExecute9<T0, T1, T2, T3, T4, T5, T6, T7, T8, TRet>(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8) {
1174 // Declare the locals here upfront. It actually saves JIT stack space.
1176 var @this = (CallSite<Func<CallSite, T0, T1, T2, T3, T4, T5, T6, T7, T8, TRet>>)site;
1177 Func<CallSite, T0, T1, T2, T3, T4, T5, T6, T7, T8, TRet>[] applicable;
1178 Func<CallSite, T0, T1, T2, T3, T4, T5, T6, T7, T8, TRet> rule, originalRule = @this.Target;
1183 // Create matchmaker and its site. We'll need them regardless.
1185 site = CallSiteOps.CreateMatchmaker(@this);
1188 // Level 1 cache lookup
1190 if ((applicable = CallSiteOps.GetRules(@this)) != null) {
1191 for (int i = 0; i < applicable.Length; i++) {
1192 rule = applicable[i];
1198 // if we've already tried it skip it...
1199 if ((object)rule != (object)originalRule) {
1200 @this.Target = rule;
1201 result = rule(site, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
1203 if (CallSiteOps.GetMatch(site)) {
1204 CallSiteOps.UpdateRules(@this, i);
1208 // Rule didn't match, try the next one
1209 CallSiteOps.ClearMatch(site);
1215 // Level 2 cache lookup
1219 // Any applicable rules in level 2 cache?
1222 var cache = CallSiteOps.GetRuleCache(@this);
1224 applicable = cache.GetRules();
1225 for (int i = 0; i < applicable.Length; i++) {
1226 rule = applicable[i];
1231 @this.Target = rule;
1234 result = rule(site, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
1235 if (CallSiteOps.GetMatch(site)) {
1239 if (CallSiteOps.GetMatch(site)) {
1241 // Rule worked. Add it to level 1 cache
1243 CallSiteOps.AddRule(@this, rule);
1244 // and then move it to the front of the L2 cache
1245 CallSiteOps.MoveRule(cache, rule, i);
1249 // Rule didn't match, try the next one
1250 CallSiteOps.ClearMatch(site);
1254 // Miss on Level 0, 1 and 2 caches. Create new rule
1258 var args = new object[] { arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8 };
1261 @this.Target = originalRule;
1262 rule = @this.Target = @this.Binder.BindCore(@this, args);
1265 // Execute the rule on the matchmaker site
1269 result = rule(site, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
1270 if (CallSiteOps.GetMatch(site)) {
1274 if (CallSiteOps.GetMatch(site)) {
1276 // The rule worked. Add it to level 1 cache.
1278 CallSiteOps.AddRule(@this, rule);
1282 // Rule we got back didn't work, try another one
1283 CallSiteOps.ClearMatch(site);
1287 [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
1288 [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")]
1289 internal static TRet NoMatch9<T0, T1, T2, T3, T4, T5, T6, T7, T8, TRet>(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8) {
1290 site._match = false;
1291 return default(TRet);
1296 [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
1297 internal static TRet UpdateAndExecute10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, TRet>(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9) {
1299 // Declare the locals here upfront. It actually saves JIT stack space.
1301 var @this = (CallSite<Func<CallSite, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, TRet>>)site;
1302 Func<CallSite, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, TRet>[] applicable;
1303 Func<CallSite, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, TRet> rule, originalRule = @this.Target;
1308 // Create matchmaker and its site. We'll need them regardless.
1310 site = CallSiteOps.CreateMatchmaker(@this);
1313 // Level 1 cache lookup
1315 if ((applicable = CallSiteOps.GetRules(@this)) != null) {
1316 for (int i = 0; i < applicable.Length; i++) {
1317 rule = applicable[i];
1323 // if we've already tried it skip it...
1324 if ((object)rule != (object)originalRule) {
1325 @this.Target = rule;
1326 result = rule(site, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
1328 if (CallSiteOps.GetMatch(site)) {
1329 CallSiteOps.UpdateRules(@this, i);
1333 // Rule didn't match, try the next one
1334 CallSiteOps.ClearMatch(site);
1340 // Level 2 cache lookup
1344 // Any applicable rules in level 2 cache?
1347 var cache = CallSiteOps.GetRuleCache(@this);
1349 applicable = cache.GetRules();
1350 for (int i = 0; i < applicable.Length; i++) {
1351 rule = applicable[i];
1356 @this.Target = rule;
1359 result = rule(site, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
1360 if (CallSiteOps.GetMatch(site)) {
1364 if (CallSiteOps.GetMatch(site)) {
1366 // Rule worked. Add it to level 1 cache
1368 CallSiteOps.AddRule(@this, rule);
1369 // and then move it to the front of the L2 cache
1370 CallSiteOps.MoveRule(cache, rule, i);
1374 // Rule didn't match, try the next one
1375 CallSiteOps.ClearMatch(site);
1379 // Miss on Level 0, 1 and 2 caches. Create new rule
1383 var args = new object[] { arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9 };
1386 @this.Target = originalRule;
1387 rule = @this.Target = @this.Binder.BindCore(@this, args);
1390 // Execute the rule on the matchmaker site
1394 result = rule(site, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
1395 if (CallSiteOps.GetMatch(site)) {
1399 if (CallSiteOps.GetMatch(site)) {
1401 // The rule worked. Add it to level 1 cache.
1403 CallSiteOps.AddRule(@this, rule);
1407 // Rule we got back didn't work, try another one
1408 CallSiteOps.ClearMatch(site);
1412 [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
1413 [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")]
1414 internal static TRet NoMatch10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, TRet>(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9) {
1415 site._match = false;
1416 return default(TRet);
1421 [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
1422 internal static void UpdateAndExecuteVoid1<T0>(CallSite site, T0 arg0) {
1424 // Declare the locals here upfront. It actually saves JIT stack space.
1426 var @this = (CallSite<Action<CallSite, T0>>)site;
1427 Action<CallSite, T0>[] applicable;
1428 Action<CallSite, T0> rule, originalRule = @this.Target;
1432 // Create matchmaker and its site. We'll need them regardless.
1434 site = CallSiteOps.CreateMatchmaker(@this);
1437 // Level 1 cache lookup
1439 if ((applicable = CallSiteOps.GetRules(@this)) != null) {
1440 for (int i = 0; i < applicable.Length; i++) {
1441 rule = applicable[i];
1447 // if we've already tried it skip it...
1448 if ((object)rule != (object)originalRule) {
1449 @this.Target = rule;
1452 if (CallSiteOps.GetMatch(site)) {
1453 CallSiteOps.UpdateRules(@this, i);
1457 // Rule didn't match, try the next one
1458 CallSiteOps.ClearMatch(site);
1464 // Level 2 cache lookup
1468 // Any applicable rules in level 2 cache?
1471 var cache = CallSiteOps.GetRuleCache(@this);
1473 applicable = cache.GetRules();
1474 for (int i = 0; i < applicable.Length; i++) {
1475 rule = applicable[i];
1480 @this.Target = rule;
1484 if (CallSiteOps.GetMatch(site)) {
1488 if (CallSiteOps.GetMatch(site)) {
1490 // Rule worked. Add it to level 1 cache
1492 CallSiteOps.AddRule(@this, rule);
1493 // and then move it to the front of the L2 cache
1494 CallSiteOps.MoveRule(cache, rule, i);
1498 // Rule didn't match, try the next one
1499 CallSiteOps.ClearMatch(site);
1503 // Miss on Level 0, 1 and 2 caches. Create new rule
1507 var args = new object[] { arg0 };
1510 @this.Target = originalRule;
1511 rule = @this.Target = @this.Binder.BindCore(@this, args);
1514 // Execute the rule on the matchmaker site
1519 if (CallSiteOps.GetMatch(site)) {
1523 if (CallSiteOps.GetMatch(site)) {
1525 // The rule worked. Add it to level 1 cache.
1527 CallSiteOps.AddRule(@this, rule);
1531 // Rule we got back didn't work, try another one
1532 CallSiteOps.ClearMatch(site);
1536 [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
1537 [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")]
1538 internal static void NoMatchVoid1<T0>(CallSite site, T0 arg0) {
1539 site._match = false;
1545 [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
1546 internal static void UpdateAndExecuteVoid2<T0, T1>(CallSite site, T0 arg0, T1 arg1) {
1548 // Declare the locals here upfront. It actually saves JIT stack space.
1550 var @this = (CallSite<Action<CallSite, T0, T1>>)site;
1551 Action<CallSite, T0, T1>[] applicable;
1552 Action<CallSite, T0, T1> rule, originalRule = @this.Target;
1556 // Create matchmaker and its site. We'll need them regardless.
1558 site = CallSiteOps.CreateMatchmaker(@this);
1561 // Level 1 cache lookup
1563 if ((applicable = CallSiteOps.GetRules(@this)) != null) {
1564 for (int i = 0; i < applicable.Length; i++) {
1565 rule = applicable[i];
1571 // if we've already tried it skip it...
1572 if ((object)rule != (object)originalRule) {
1573 @this.Target = rule;
1574 rule(site, arg0, arg1);
1576 if (CallSiteOps.GetMatch(site)) {
1577 CallSiteOps.UpdateRules(@this, i);
1581 // Rule didn't match, try the next one
1582 CallSiteOps.ClearMatch(site);
1588 // Level 2 cache lookup
1592 // Any applicable rules in level 2 cache?
1595 var cache = CallSiteOps.GetRuleCache(@this);
1597 applicable = cache.GetRules();
1598 for (int i = 0; i < applicable.Length; i++) {
1599 rule = applicable[i];
1604 @this.Target = rule;
1607 rule(site, arg0, arg1);
1608 if (CallSiteOps.GetMatch(site)) {
1612 if (CallSiteOps.GetMatch(site)) {
1614 // Rule worked. Add it to level 1 cache
1616 CallSiteOps.AddRule(@this, rule);
1617 // and then move it to the front of the L2 cache
1618 CallSiteOps.MoveRule(cache, rule, i);
1622 // Rule didn't match, try the next one
1623 CallSiteOps.ClearMatch(site);
1627 // Miss on Level 0, 1 and 2 caches. Create new rule
1631 var args = new object[] { arg0, arg1 };
1634 @this.Target = originalRule;
1635 rule = @this.Target = @this.Binder.BindCore(@this, args);
1638 // Execute the rule on the matchmaker site
1642 rule(site, arg0, arg1);
1643 if (CallSiteOps.GetMatch(site)) {
1647 if (CallSiteOps.GetMatch(site)) {
1649 // The rule worked. Add it to level 1 cache.
1651 CallSiteOps.AddRule(@this, rule);
1655 // Rule we got back didn't work, try another one
1656 CallSiteOps.ClearMatch(site);
1660 [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
1661 [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")]
1662 internal static void NoMatchVoid2<T0, T1>(CallSite site, T0 arg0, T1 arg1) {
1663 site._match = false;
1669 [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
1670 internal static void UpdateAndExecuteVoid3<T0, T1, T2>(CallSite site, T0 arg0, T1 arg1, T2 arg2) {
1672 // Declare the locals here upfront. It actually saves JIT stack space.
1674 var @this = (CallSite<Action<CallSite, T0, T1, T2>>)site;
1675 Action<CallSite, T0, T1, T2>[] applicable;
1676 Action<CallSite, T0, T1, T2> rule, originalRule = @this.Target;
1680 // Create matchmaker and its site. We'll need them regardless.
1682 site = CallSiteOps.CreateMatchmaker(@this);
1685 // Level 1 cache lookup
1687 if ((applicable = CallSiteOps.GetRules(@this)) != null) {
1688 for (int i = 0; i < applicable.Length; i++) {
1689 rule = applicable[i];
1695 // if we've already tried it skip it...
1696 if ((object)rule != (object)originalRule) {
1697 @this.Target = rule;
1698 rule(site, arg0, arg1, arg2);
1700 if (CallSiteOps.GetMatch(site)) {
1701 CallSiteOps.UpdateRules(@this, i);
1705 // Rule didn't match, try the next one
1706 CallSiteOps.ClearMatch(site);
1712 // Level 2 cache lookup
1716 // Any applicable rules in level 2 cache?
1719 var cache = CallSiteOps.GetRuleCache(@this);
1721 applicable = cache.GetRules();
1722 for (int i = 0; i < applicable.Length; i++) {
1723 rule = applicable[i];
1728 @this.Target = rule;
1731 rule(site, arg0, arg1, arg2);
1732 if (CallSiteOps.GetMatch(site)) {
1736 if (CallSiteOps.GetMatch(site)) {
1738 // Rule worked. Add it to level 1 cache
1740 CallSiteOps.AddRule(@this, rule);
1741 // and then move it to the front of the L2 cache
1742 CallSiteOps.MoveRule(cache, rule, i);
1746 // Rule didn't match, try the next one
1747 CallSiteOps.ClearMatch(site);
1751 // Miss on Level 0, 1 and 2 caches. Create new rule
1755 var args = new object[] { arg0, arg1, arg2 };
1758 @this.Target = originalRule;
1759 rule = @this.Target = @this.Binder.BindCore(@this, args);
1762 // Execute the rule on the matchmaker site
1766 rule(site, arg0, arg1, arg2);
1767 if (CallSiteOps.GetMatch(site)) {
1771 if (CallSiteOps.GetMatch(site)) {
1773 // The rule worked. Add it to level 1 cache.
1775 CallSiteOps.AddRule(@this, rule);
1779 // Rule we got back didn't work, try another one
1780 CallSiteOps.ClearMatch(site);
1784 [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
1785 [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")]
1786 internal static void NoMatchVoid3<T0, T1, T2>(CallSite site, T0 arg0, T1 arg1, T2 arg2) {
1787 site._match = false;
1793 [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
1794 internal static void UpdateAndExecuteVoid4<T0, T1, T2, T3>(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) {
1796 // Declare the locals here upfront. It actually saves JIT stack space.
1798 var @this = (CallSite<Action<CallSite, T0, T1, T2, T3>>)site;
1799 Action<CallSite, T0, T1, T2, T3>[] applicable;
1800 Action<CallSite, T0, T1, T2, T3> rule, originalRule = @this.Target;
1804 // Create matchmaker and its site. We'll need them regardless.
1806 site = CallSiteOps.CreateMatchmaker(@this);
1809 // Level 1 cache lookup
1811 if ((applicable = CallSiteOps.GetRules(@this)) != null) {
1812 for (int i = 0; i < applicable.Length; i++) {
1813 rule = applicable[i];
1819 // if we've already tried it skip it...
1820 if ((object)rule != (object)originalRule) {
1821 @this.Target = rule;
1822 rule(site, arg0, arg1, arg2, arg3);
1824 if (CallSiteOps.GetMatch(site)) {
1825 CallSiteOps.UpdateRules(@this, i);
1829 // Rule didn't match, try the next one
1830 CallSiteOps.ClearMatch(site);
1836 // Level 2 cache lookup
1840 // Any applicable rules in level 2 cache?
1843 var cache = CallSiteOps.GetRuleCache(@this);
1845 applicable = cache.GetRules();
1846 for (int i = 0; i < applicable.Length; i++) {
1847 rule = applicable[i];
1852 @this.Target = rule;
1855 rule(site, arg0, arg1, arg2, arg3);
1856 if (CallSiteOps.GetMatch(site)) {
1860 if (CallSiteOps.GetMatch(site)) {
1862 // Rule worked. Add it to level 1 cache
1864 CallSiteOps.AddRule(@this, rule);
1865 // and then move it to the front of the L2 cache
1866 CallSiteOps.MoveRule(cache, rule, i);
1870 // Rule didn't match, try the next one
1871 CallSiteOps.ClearMatch(site);
1875 // Miss on Level 0, 1 and 2 caches. Create new rule
1879 var args = new object[] { arg0, arg1, arg2, arg3 };
1882 @this.Target = originalRule;
1883 rule = @this.Target = @this.Binder.BindCore(@this, args);
1886 // Execute the rule on the matchmaker site
1890 rule(site, arg0, arg1, arg2, arg3);
1891 if (CallSiteOps.GetMatch(site)) {
1895 if (CallSiteOps.GetMatch(site)) {
1897 // The rule worked. Add it to level 1 cache.
1899 CallSiteOps.AddRule(@this, rule);
1903 // Rule we got back didn't work, try another one
1904 CallSiteOps.ClearMatch(site);
1908 [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
1909 [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")]
1910 internal static void NoMatchVoid4<T0, T1, T2, T3>(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) {
1911 site._match = false;
1917 [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
1918 internal static void UpdateAndExecuteVoid5<T0, T1, T2, T3, T4>(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4) {
1920 // Declare the locals here upfront. It actually saves JIT stack space.
1922 var @this = (CallSite<Action<CallSite, T0, T1, T2, T3, T4>>)site;
1923 Action<CallSite, T0, T1, T2, T3, T4>[] applicable;
1924 Action<CallSite, T0, T1, T2, T3, T4> rule, originalRule = @this.Target;
1928 // Create matchmaker and its site. We'll need them regardless.
1930 site = CallSiteOps.CreateMatchmaker(@this);
1933 // Level 1 cache lookup
1935 if ((applicable = CallSiteOps.GetRules(@this)) != null) {
1936 for (int i = 0; i < applicable.Length; i++) {
1937 rule = applicable[i];
1943 // if we've already tried it skip it...
1944 if ((object)rule != (object)originalRule) {
1945 @this.Target = rule;
1946 rule(site, arg0, arg1, arg2, arg3, arg4);
1948 if (CallSiteOps.GetMatch(site)) {
1949 CallSiteOps.UpdateRules(@this, i);
1953 // Rule didn't match, try the next one
1954 CallSiteOps.ClearMatch(site);
1960 // Level 2 cache lookup
1964 // Any applicable rules in level 2 cache?
1967 var cache = CallSiteOps.GetRuleCache(@this);
1969 applicable = cache.GetRules();
1970 for (int i = 0; i < applicable.Length; i++) {
1971 rule = applicable[i];
1976 @this.Target = rule;
1979 rule(site, arg0, arg1, arg2, arg3, arg4);
1980 if (CallSiteOps.GetMatch(site)) {
1984 if (CallSiteOps.GetMatch(site)) {
1986 // Rule worked. Add it to level 1 cache
1988 CallSiteOps.AddRule(@this, rule);
1989 // and then move it to the front of the L2 cache
1990 CallSiteOps.MoveRule(cache, rule, i);
1994 // Rule didn't match, try the next one
1995 CallSiteOps.ClearMatch(site);
1999 // Miss on Level 0, 1 and 2 caches. Create new rule
2003 var args = new object[] { arg0, arg1, arg2, arg3, arg4 };
2006 @this.Target = originalRule;
2007 rule = @this.Target = @this.Binder.BindCore(@this, args);
2010 // Execute the rule on the matchmaker site
2014 rule(site, arg0, arg1, arg2, arg3, arg4);
2015 if (CallSiteOps.GetMatch(site)) {
2019 if (CallSiteOps.GetMatch(site)) {
2021 // The rule worked. Add it to level 1 cache.
2023 CallSiteOps.AddRule(@this, rule);
2027 // Rule we got back didn't work, try another one
2028 CallSiteOps.ClearMatch(site);
2032 [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
2033 [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")]
2034 internal static void NoMatchVoid5<T0, T1, T2, T3, T4>(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4) {
2035 site._match = false;
2041 [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
2042 internal static void UpdateAndExecuteVoid6<T0, T1, T2, T3, T4, T5>(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5) {
2044 // Declare the locals here upfront. It actually saves JIT stack space.
2046 var @this = (CallSite<Action<CallSite, T0, T1, T2, T3, T4, T5>>)site;
2047 Action<CallSite, T0, T1, T2, T3, T4, T5>[] applicable;
2048 Action<CallSite, T0, T1, T2, T3, T4, T5> rule, originalRule = @this.Target;
2052 // Create matchmaker and its site. We'll need them regardless.
2054 site = CallSiteOps.CreateMatchmaker(@this);
2057 // Level 1 cache lookup
2059 if ((applicable = CallSiteOps.GetRules(@this)) != null) {
2060 for (int i = 0; i < applicable.Length; i++) {
2061 rule = applicable[i];
2067 // if we've already tried it skip it...
2068 if ((object)rule != (object)originalRule) {
2069 @this.Target = rule;
2070 rule(site, arg0, arg1, arg2, arg3, arg4, arg5);
2072 if (CallSiteOps.GetMatch(site)) {
2073 CallSiteOps.UpdateRules(@this, i);
2077 // Rule didn't match, try the next one
2078 CallSiteOps.ClearMatch(site);
2084 // Level 2 cache lookup
2088 // Any applicable rules in level 2 cache?
2091 var cache = CallSiteOps.GetRuleCache(@this);
2093 applicable = cache.GetRules();
2094 for (int i = 0; i < applicable.Length; i++) {
2095 rule = applicable[i];
2100 @this.Target = rule;
2103 rule(site, arg0, arg1, arg2, arg3, arg4, arg5);
2104 if (CallSiteOps.GetMatch(site)) {
2108 if (CallSiteOps.GetMatch(site)) {
2110 // Rule worked. Add it to level 1 cache
2112 CallSiteOps.AddRule(@this, rule);
2113 // and then move it to the front of the L2 cache
2114 CallSiteOps.MoveRule(cache, rule, i);
2118 // Rule didn't match, try the next one
2119 CallSiteOps.ClearMatch(site);
2123 // Miss on Level 0, 1 and 2 caches. Create new rule
2127 var args = new object[] { arg0, arg1, arg2, arg3, arg4, arg5 };
2130 @this.Target = originalRule;
2131 rule = @this.Target = @this.Binder.BindCore(@this, args);
2134 // Execute the rule on the matchmaker site
2138 rule(site, arg0, arg1, arg2, arg3, arg4, arg5);
2139 if (CallSiteOps.GetMatch(site)) {
2143 if (CallSiteOps.GetMatch(site)) {
2145 // The rule worked. Add it to level 1 cache.
2147 CallSiteOps.AddRule(@this, rule);
2151 // Rule we got back didn't work, try another one
2152 CallSiteOps.ClearMatch(site);
2156 [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
2157 [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")]
2158 internal static void NoMatchVoid6<T0, T1, T2, T3, T4, T5>(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5) {
2159 site._match = false;
2165 [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
2166 internal static void UpdateAndExecuteVoid7<T0, T1, T2, T3, T4, T5, T6>(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6) {
2168 // Declare the locals here upfront. It actually saves JIT stack space.
2170 var @this = (CallSite<Action<CallSite, T0, T1, T2, T3, T4, T5, T6>>)site;
2171 Action<CallSite, T0, T1, T2, T3, T4, T5, T6>[] applicable;
2172 Action<CallSite, T0, T1, T2, T3, T4, T5, T6> rule, originalRule = @this.Target;
2176 // Create matchmaker and its site. We'll need them regardless.
2178 site = CallSiteOps.CreateMatchmaker(@this);
2181 // Level 1 cache lookup
2183 if ((applicable = CallSiteOps.GetRules(@this)) != null) {
2184 for (int i = 0; i < applicable.Length; i++) {
2185 rule = applicable[i];
2191 // if we've already tried it skip it...
2192 if ((object)rule != (object)originalRule) {
2193 @this.Target = rule;
2194 rule(site, arg0, arg1, arg2, arg3, arg4, arg5, arg6);
2196 if (CallSiteOps.GetMatch(site)) {
2197 CallSiteOps.UpdateRules(@this, i);
2201 // Rule didn't match, try the next one
2202 CallSiteOps.ClearMatch(site);
2208 // Level 2 cache lookup
2212 // Any applicable rules in level 2 cache?
2215 var cache = CallSiteOps.GetRuleCache(@this);
2217 applicable = cache.GetRules();
2218 for (int i = 0; i < applicable.Length; i++) {
2219 rule = applicable[i];
2224 @this.Target = rule;
2227 rule(site, arg0, arg1, arg2, arg3, arg4, arg5, arg6);
2228 if (CallSiteOps.GetMatch(site)) {
2232 if (CallSiteOps.GetMatch(site)) {
2234 // Rule worked. Add it to level 1 cache
2236 CallSiteOps.AddRule(@this, rule);
2237 // and then move it to the front of the L2 cache
2238 CallSiteOps.MoveRule(cache, rule, i);
2242 // Rule didn't match, try the next one
2243 CallSiteOps.ClearMatch(site);
2247 // Miss on Level 0, 1 and 2 caches. Create new rule
2251 var args = new object[] { arg0, arg1, arg2, arg3, arg4, arg5, arg6 };
2254 @this.Target = originalRule;
2255 rule = @this.Target = @this.Binder.BindCore(@this, args);
2258 // Execute the rule on the matchmaker site
2262 rule(site, arg0, arg1, arg2, arg3, arg4, arg5, arg6);
2263 if (CallSiteOps.GetMatch(site)) {
2267 if (CallSiteOps.GetMatch(site)) {
2269 // The rule worked. Add it to level 1 cache.
2271 CallSiteOps.AddRule(@this, rule);
2275 // Rule we got back didn't work, try another one
2276 CallSiteOps.ClearMatch(site);
2280 [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
2281 [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")]
2282 internal static void NoMatchVoid7<T0, T1, T2, T3, T4, T5, T6>(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6) {
2283 site._match = false;
2289 [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
2290 internal static void UpdateAndExecuteVoid8<T0, T1, T2, T3, T4, T5, T6, T7>(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7) {
2292 // Declare the locals here upfront. It actually saves JIT stack space.
2294 var @this = (CallSite<Action<CallSite, T0, T1, T2, T3, T4, T5, T6, T7>>)site;
2295 Action<CallSite, T0, T1, T2, T3, T4, T5, T6, T7>[] applicable;
2296 Action<CallSite, T0, T1, T2, T3, T4, T5, T6, T7> rule, originalRule = @this.Target;
2300 // Create matchmaker and its site. We'll need them regardless.
2302 site = CallSiteOps.CreateMatchmaker(@this);
2305 // Level 1 cache lookup
2307 if ((applicable = CallSiteOps.GetRules(@this)) != null) {
2308 for (int i = 0; i < applicable.Length; i++) {
2309 rule = applicable[i];
2315 // if we've already tried it skip it...
2316 if ((object)rule != (object)originalRule) {
2317 @this.Target = rule;
2318 rule(site, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
2320 if (CallSiteOps.GetMatch(site)) {
2321 CallSiteOps.UpdateRules(@this, i);
2325 // Rule didn't match, try the next one
2326 CallSiteOps.ClearMatch(site);
2332 // Level 2 cache lookup
2336 // Any applicable rules in level 2 cache?
2339 var cache = CallSiteOps.GetRuleCache(@this);
2341 applicable = cache.GetRules();
2342 for (int i = 0; i < applicable.Length; i++) {
2343 rule = applicable[i];
2348 @this.Target = rule;
2351 rule(site, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
2352 if (CallSiteOps.GetMatch(site)) {
2356 if (CallSiteOps.GetMatch(site)) {
2358 // Rule worked. Add it to level 1 cache
2360 CallSiteOps.AddRule(@this, rule);
2361 // and then move it to the front of the L2 cache
2362 CallSiteOps.MoveRule(cache, rule, i);
2366 // Rule didn't match, try the next one
2367 CallSiteOps.ClearMatch(site);
2371 // Miss on Level 0, 1 and 2 caches. Create new rule
2375 var args = new object[] { arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7 };
2378 @this.Target = originalRule;
2379 rule = @this.Target = @this.Binder.BindCore(@this, args);
2382 // Execute the rule on the matchmaker site
2386 rule(site, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
2387 if (CallSiteOps.GetMatch(site)) {
2391 if (CallSiteOps.GetMatch(site)) {
2393 // The rule worked. Add it to level 1 cache.
2395 CallSiteOps.AddRule(@this, rule);
2399 // Rule we got back didn't work, try another one
2400 CallSiteOps.ClearMatch(site);
2404 [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
2405 [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")]
2406 internal static void NoMatchVoid8<T0, T1, T2, T3, T4, T5, T6, T7>(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7) {
2407 site._match = false;
2413 [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
2414 internal static void UpdateAndExecuteVoid9<T0, T1, T2, T3, T4, T5, T6, T7, T8>(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8) {
2416 // Declare the locals here upfront. It actually saves JIT stack space.
2418 var @this = (CallSite<Action<CallSite, T0, T1, T2, T3, T4, T5, T6, T7, T8>>)site;
2419 Action<CallSite, T0, T1, T2, T3, T4, T5, T6, T7, T8>[] applicable;
2420 Action<CallSite, T0, T1, T2, T3, T4, T5, T6, T7, T8> rule, originalRule = @this.Target;
2424 // Create matchmaker and its site. We'll need them regardless.
2426 site = CallSiteOps.CreateMatchmaker(@this);
2429 // Level 1 cache lookup
2431 if ((applicable = CallSiteOps.GetRules(@this)) != null) {
2432 for (int i = 0; i < applicable.Length; i++) {
2433 rule = applicable[i];
2439 // if we've already tried it skip it...
2440 if ((object)rule != (object)originalRule) {
2441 @this.Target = rule;
2442 rule(site, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
2444 if (CallSiteOps.GetMatch(site)) {
2445 CallSiteOps.UpdateRules(@this, i);
2449 // Rule didn't match, try the next one
2450 CallSiteOps.ClearMatch(site);
2456 // Level 2 cache lookup
2460 // Any applicable rules in level 2 cache?
2463 var cache = CallSiteOps.GetRuleCache(@this);
2465 applicable = cache.GetRules();
2466 for (int i = 0; i < applicable.Length; i++) {
2467 rule = applicable[i];
2472 @this.Target = rule;
2475 rule(site, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
2476 if (CallSiteOps.GetMatch(site)) {
2480 if (CallSiteOps.GetMatch(site)) {
2482 // Rule worked. Add it to level 1 cache
2484 CallSiteOps.AddRule(@this, rule);
2485 // and then move it to the front of the L2 cache
2486 CallSiteOps.MoveRule(cache, rule, i);
2490 // Rule didn't match, try the next one
2491 CallSiteOps.ClearMatch(site);
2495 // Miss on Level 0, 1 and 2 caches. Create new rule
2499 var args = new object[] { arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8 };
2502 @this.Target = originalRule;
2503 rule = @this.Target = @this.Binder.BindCore(@this, args);
2506 // Execute the rule on the matchmaker site
2510 rule(site, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
2511 if (CallSiteOps.GetMatch(site)) {
2515 if (CallSiteOps.GetMatch(site)) {
2517 // The rule worked. Add it to level 1 cache.
2519 CallSiteOps.AddRule(@this, rule);
2523 // Rule we got back didn't work, try another one
2524 CallSiteOps.ClearMatch(site);
2528 [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
2529 [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")]
2530 internal static void NoMatchVoid9<T0, T1, T2, T3, T4, T5, T6, T7, T8>(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8) {
2531 site._match = false;
2537 [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
2538 internal static void UpdateAndExecuteVoid10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9) {
2540 // Declare the locals here upfront. It actually saves JIT stack space.
2542 var @this = (CallSite<Action<CallSite, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>>)site;
2543 Action<CallSite, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>[] applicable;
2544 Action<CallSite, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> rule, originalRule = @this.Target;
2548 // Create matchmaker and its site. We'll need them regardless.
2550 site = CallSiteOps.CreateMatchmaker(@this);
2553 // Level 1 cache lookup
2555 if ((applicable = CallSiteOps.GetRules(@this)) != null) {
2556 for (int i = 0; i < applicable.Length; i++) {
2557 rule = applicable[i];
2563 // if we've already tried it skip it...
2564 if ((object)rule != (object)originalRule) {
2565 @this.Target = rule;
2566 rule(site, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
2568 if (CallSiteOps.GetMatch(site)) {
2569 CallSiteOps.UpdateRules(@this, i);
2573 // Rule didn't match, try the next one
2574 CallSiteOps.ClearMatch(site);
2580 // Level 2 cache lookup
2584 // Any applicable rules in level 2 cache?
2587 var cache = CallSiteOps.GetRuleCache(@this);
2589 applicable = cache.GetRules();
2590 for (int i = 0; i < applicable.Length; i++) {
2591 rule = applicable[i];
2596 @this.Target = rule;
2599 rule(site, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
2600 if (CallSiteOps.GetMatch(site)) {
2604 if (CallSiteOps.GetMatch(site)) {
2606 // Rule worked. Add it to level 1 cache
2608 CallSiteOps.AddRule(@this, rule);
2609 // and then move it to the front of the L2 cache
2610 CallSiteOps.MoveRule(cache, rule, i);
2614 // Rule didn't match, try the next one
2615 CallSiteOps.ClearMatch(site);
2619 // Miss on Level 0, 1 and 2 caches. Create new rule
2623 var args = new object[] { arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9 };
2626 @this.Target = originalRule;
2627 rule = @this.Target = @this.Binder.BindCore(@this, args);
2630 // Execute the rule on the matchmaker site
2634 rule(site, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
2635 if (CallSiteOps.GetMatch(site)) {
2639 if (CallSiteOps.GetMatch(site)) {
2641 // The rule worked. Add it to level 1 cache.
2643 CallSiteOps.AddRule(@this, rule);
2647 // Rule we got back didn't work, try another one
2648 CallSiteOps.ClearMatch(site);
2652 [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
2653 [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")]
2654 internal static void NoMatchVoid10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9) {
2655 site._match = false;
2661 // *** END GENERATED CODE ***