BindingFlags.Public needed here as Exception.HResult is now public in .NET 4.5. This...
[mono.git] / mcs / class / dlr / Runtime / Microsoft.Scripting.Core / Actions / UpdateDelegates.Generated.cs
1 /* ****************************************************************************
2  *
3  * Copyright (c) Microsoft Corporation. 
4  *
5  * This source code is subject to terms and conditions of the Apache License, Version 2.0. 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  Apache License, Version 2.0, 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 Apache License, Version 2.0.
10  *
11  * You must not remove this notice, or any other, from this software.
12  *
13  *
14  * ***************************************************************************/
15 #if CLR2
16 using Microsoft.Scripting.Utils;
17 #endif
18
19 using System.Runtime.CompilerServices;
20 using System.Threading;
21
22 namespace System.Dynamic {
23     internal static partial class UpdateDelegates {
24
25         //
26         // WARNING: do not edit these methods here. The real source code lives
27         // in two places: generate_dynsites.py, which generates the methods in
28         // this file, and UpdateDelegates.cs, which dynamically generates
29         // methods like these at run time. If you want to make a change, edit
30         // *both* of those files instead
31         //
32
33         #region Generated UpdateAndExecute Methods
34
35         // *** BEGIN GENERATED CODE ***
36         // generated by function: gen_update_targets from: generate_dynsites.py
37
38
39         [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
40         internal static TRet UpdateAndExecute0<TRet>(CallSite site) {
41             //
42             // Declare the locals here upfront. It actually saves JIT stack space.
43             //
44             var @this = (CallSite<Func<CallSite, TRet>>)site;
45             Func<CallSite, TRet>[] applicable;
46             Func<CallSite, TRet> rule, originalRule = @this.Target;
47             TRet result;
48
49
50             //
51             // Create matchmaker and its site. We'll need them regardless.
52             //
53             site = CallSiteOps.CreateMatchmaker(@this);
54
55             //
56             // Level 1 cache lookup
57             //
58             if ((applicable = CallSiteOps.GetRules(@this)) != null) {
59                 for (int i = 0; i < applicable.Length; i++) {
60                     rule = applicable[i];
61
62                     //
63                     // Execute the rule
64                     //
65
66                     // if we've already tried it skip it...
67                     if ((object)rule != (object)originalRule) {
68                         @this.Target = rule;
69                         result = rule(site);
70
71                         if (CallSiteOps.GetMatch(site)) {
72                             CallSiteOps.UpdateRules(@this, i);
73                             return result;
74                         }        
75
76                         // Rule didn't match, try the next one
77                         CallSiteOps.ClearMatch(site);            
78                     }
79                 }
80             }
81
82             //
83             // Level 2 cache lookup
84             //
85
86             //
87             // Any applicable rules in level 2 cache?
88             //
89
90             var cache = CallSiteOps.GetRuleCache(@this);
91
92             applicable = cache.GetRules();
93             for (int i = 0; i < applicable.Length; i++) {
94                 rule = applicable[i];
95
96                 //
97                 // Execute the rule
98                 //
99                 @this.Target = rule;
100
101                 try {
102                     result = rule(site);
103                     if (CallSiteOps.GetMatch(site)) {
104                         return result;
105                     }
106                 } finally {
107                     if (CallSiteOps.GetMatch(site)) {
108                         //
109                         // Rule worked. Add it to level 1 cache
110                         //
111                         CallSiteOps.AddRule(@this, rule);
112                         // and then move it to the front of the L2 cache
113                         CallSiteOps.MoveRule(cache, rule, i);
114                     }
115                 }
116
117                 // Rule didn't match, try the next one
118                 CallSiteOps.ClearMatch(site);
119             }
120
121             //
122             // Miss on Level 0, 1 and 2 caches. Create new rule
123             //
124
125             rule = null;
126             var args = new object[] {  };
127
128             for (; ; ) {
129                 @this.Target = originalRule;
130                 rule = @this.Target = @this.Binder.BindCore(@this, args);
131
132                 //
133                 // Execute the rule on the matchmaker site
134                 //
135
136                 try {
137                     result = rule(site);
138                     if (CallSiteOps.GetMatch(site)) {
139                         return result;
140                     }
141                 } finally {
142                     if (CallSiteOps.GetMatch(site)) {
143                         //
144                         // The rule worked. Add it to level 1 cache.
145                         //
146                         CallSiteOps.AddRule(@this, rule);
147                     }
148                 }
149
150                 // Rule we got back didn't work, try another one
151                 CallSiteOps.ClearMatch(site);
152             }
153         }
154
155         [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
156         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")]
157         internal static TRet NoMatch0<TRet>(CallSite site) {
158             site._match = false;
159             return default(TRet);
160         }
161
162
163
164         [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
165         internal static TRet UpdateAndExecute1<T0, TRet>(CallSite site, T0 arg0) {
166             //
167             // Declare the locals here upfront. It actually saves JIT stack space.
168             //
169             var @this = (CallSite<Func<CallSite, T0, TRet>>)site;
170             Func<CallSite, T0, TRet>[] applicable;
171             Func<CallSite, T0, TRet> rule, originalRule = @this.Target;
172             TRet result;
173
174
175             //
176             // Create matchmaker and its site. We'll need them regardless.
177             //
178             site = CallSiteOps.CreateMatchmaker(@this);
179
180             //
181             // Level 1 cache lookup
182             //
183             if ((applicable = CallSiteOps.GetRules(@this)) != null) {
184                 for (int i = 0; i < applicable.Length; i++) {
185                     rule = applicable[i];
186
187                     //
188                     // Execute the rule
189                     //
190
191                     // if we've already tried it skip it...
192                     if ((object)rule != (object)originalRule) {
193                         @this.Target = rule;
194                         result = rule(site, arg0);
195
196                         if (CallSiteOps.GetMatch(site)) {
197                             CallSiteOps.UpdateRules(@this, i);
198                             return result;
199                         }        
200
201                         // Rule didn't match, try the next one
202                         CallSiteOps.ClearMatch(site);            
203                     }
204                 }
205             }
206
207             //
208             // Level 2 cache lookup
209             //
210
211             //
212             // Any applicable rules in level 2 cache?
213             //
214
215             var cache = CallSiteOps.GetRuleCache(@this);
216
217             applicable = cache.GetRules();
218             for (int i = 0; i < applicable.Length; i++) {
219                 rule = applicable[i];
220
221                 //
222                 // Execute the rule
223                 //
224                 @this.Target = rule;
225
226                 try {
227                     result = rule(site, arg0);
228                     if (CallSiteOps.GetMatch(site)) {
229                         return result;
230                     }
231                 } finally {
232                     if (CallSiteOps.GetMatch(site)) {
233                         //
234                         // Rule worked. Add it to level 1 cache
235                         //
236                         CallSiteOps.AddRule(@this, rule);
237                         // and then move it to the front of the L2 cache
238                         CallSiteOps.MoveRule(cache, rule, i);
239                     }
240                 }
241
242                 // Rule didn't match, try the next one
243                 CallSiteOps.ClearMatch(site);
244             }
245
246             //
247             // Miss on Level 0, 1 and 2 caches. Create new rule
248             //
249
250             rule = null;
251             var args = new object[] { arg0 };
252
253             for (; ; ) {
254                 @this.Target = originalRule;
255                 rule = @this.Target = @this.Binder.BindCore(@this, args);
256
257                 //
258                 // Execute the rule on the matchmaker site
259                 //
260
261                 try {
262                     result = rule(site, arg0);
263                     if (CallSiteOps.GetMatch(site)) {
264                         return result;
265                     }
266                 } finally {
267                     if (CallSiteOps.GetMatch(site)) {
268                         //
269                         // The rule worked. Add it to level 1 cache.
270                         //
271                         CallSiteOps.AddRule(@this, rule);
272                     }
273                 }
274
275                 // Rule we got back didn't work, try another one
276                 CallSiteOps.ClearMatch(site);
277             }
278         }
279
280         [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
281         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")]
282         internal static TRet NoMatch1<T0, TRet>(CallSite site, T0 arg0) {
283             site._match = false;
284             return default(TRet);
285         }
286
287
288
289         [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
290         internal static TRet UpdateAndExecute2<T0, T1, TRet>(CallSite site, T0 arg0, T1 arg1) {
291             //
292             // Declare the locals here upfront. It actually saves JIT stack space.
293             //
294             var @this = (CallSite<Func<CallSite, T0, T1, TRet>>)site;
295             Func<CallSite, T0, T1, TRet>[] applicable;
296             Func<CallSite, T0, T1, TRet> rule, originalRule = @this.Target;
297             TRet result;
298
299
300             //
301             // Create matchmaker and its site. We'll need them regardless.
302             //
303             site = CallSiteOps.CreateMatchmaker(@this);
304
305             //
306             // Level 1 cache lookup
307             //
308             if ((applicable = CallSiteOps.GetRules(@this)) != null) {
309                 for (int i = 0; i < applicable.Length; i++) {
310                     rule = applicable[i];
311
312                     //
313                     // Execute the rule
314                     //
315
316                     // if we've already tried it skip it...
317                     if ((object)rule != (object)originalRule) {
318                         @this.Target = rule;
319                         result = rule(site, arg0, arg1);
320
321                         if (CallSiteOps.GetMatch(site)) {
322                             CallSiteOps.UpdateRules(@this, i);
323                             return result;
324                         }        
325
326                         // Rule didn't match, try the next one
327                         CallSiteOps.ClearMatch(site);            
328                     }
329                 }
330             }
331
332             //
333             // Level 2 cache lookup
334             //
335
336             //
337             // Any applicable rules in level 2 cache?
338             //
339
340             var cache = CallSiteOps.GetRuleCache(@this);
341
342             applicable = cache.GetRules();
343             for (int i = 0; i < applicable.Length; i++) {
344                 rule = applicable[i];
345
346                 //
347                 // Execute the rule
348                 //
349                 @this.Target = rule;
350
351                 try {
352                     result = rule(site, arg0, arg1);
353                     if (CallSiteOps.GetMatch(site)) {
354                         return result;
355                     }
356                 } finally {
357                     if (CallSiteOps.GetMatch(site)) {
358                         //
359                         // Rule worked. Add it to level 1 cache
360                         //
361                         CallSiteOps.AddRule(@this, rule);
362                         // and then move it to the front of the L2 cache
363                         CallSiteOps.MoveRule(cache, rule, i);
364                     }
365                 }
366
367                 // Rule didn't match, try the next one
368                 CallSiteOps.ClearMatch(site);
369             }
370
371             //
372             // Miss on Level 0, 1 and 2 caches. Create new rule
373             //
374
375             rule = null;
376             var args = new object[] { arg0, arg1 };
377
378             for (; ; ) {
379                 @this.Target = originalRule;
380                 rule = @this.Target = @this.Binder.BindCore(@this, args);
381
382                 //
383                 // Execute the rule on the matchmaker site
384                 //
385
386                 try {
387                     result = rule(site, arg0, arg1);
388                     if (CallSiteOps.GetMatch(site)) {
389                         return result;
390                     }
391                 } finally {
392                     if (CallSiteOps.GetMatch(site)) {
393                         //
394                         // The rule worked. Add it to level 1 cache.
395                         //
396                         CallSiteOps.AddRule(@this, rule);
397                     }
398                 }
399
400                 // Rule we got back didn't work, try another one
401                 CallSiteOps.ClearMatch(site);
402             }
403         }
404
405         [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
406         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")]
407         internal static TRet NoMatch2<T0, T1, TRet>(CallSite site, T0 arg0, T1 arg1) {
408             site._match = false;
409             return default(TRet);
410         }
411
412
413
414         [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
415         internal static TRet UpdateAndExecute3<T0, T1, T2, TRet>(CallSite site, T0 arg0, T1 arg1, T2 arg2) {
416             //
417             // Declare the locals here upfront. It actually saves JIT stack space.
418             //
419             var @this = (CallSite<Func<CallSite, T0, T1, T2, TRet>>)site;
420             Func<CallSite, T0, T1, T2, TRet>[] applicable;
421             Func<CallSite, T0, T1, T2, TRet> rule, originalRule = @this.Target;
422             TRet result;
423
424
425             //
426             // Create matchmaker and its site. We'll need them regardless.
427             //
428             site = CallSiteOps.CreateMatchmaker(@this);
429
430             //
431             // Level 1 cache lookup
432             //
433             if ((applicable = CallSiteOps.GetRules(@this)) != null) {
434                 for (int i = 0; i < applicable.Length; i++) {
435                     rule = applicable[i];
436
437                     //
438                     // Execute the rule
439                     //
440
441                     // if we've already tried it skip it...
442                     if ((object)rule != (object)originalRule) {
443                         @this.Target = rule;
444                         result = rule(site, arg0, arg1, arg2);
445
446                         if (CallSiteOps.GetMatch(site)) {
447                             CallSiteOps.UpdateRules(@this, i);
448                             return result;
449                         }        
450
451                         // Rule didn't match, try the next one
452                         CallSiteOps.ClearMatch(site);            
453                     }
454                 }
455             }
456
457             //
458             // Level 2 cache lookup
459             //
460
461             //
462             // Any applicable rules in level 2 cache?
463             //
464
465             var cache = CallSiteOps.GetRuleCache(@this);
466
467             applicable = cache.GetRules();
468             for (int i = 0; i < applicable.Length; i++) {
469                 rule = applicable[i];
470
471                 //
472                 // Execute the rule
473                 //
474                 @this.Target = rule;
475
476                 try {
477                     result = rule(site, arg0, arg1, arg2);
478                     if (CallSiteOps.GetMatch(site)) {
479                         return result;
480                     }
481                 } finally {
482                     if (CallSiteOps.GetMatch(site)) {
483                         //
484                         // Rule worked. Add it to level 1 cache
485                         //
486                         CallSiteOps.AddRule(@this, rule);
487                         // and then move it to the front of the L2 cache
488                         CallSiteOps.MoveRule(cache, rule, i);
489                     }
490                 }
491
492                 // Rule didn't match, try the next one
493                 CallSiteOps.ClearMatch(site);
494             }
495
496             //
497             // Miss on Level 0, 1 and 2 caches. Create new rule
498             //
499
500             rule = null;
501             var args = new object[] { arg0, arg1, arg2 };
502
503             for (; ; ) {
504                 @this.Target = originalRule;
505                 rule = @this.Target = @this.Binder.BindCore(@this, args);
506
507                 //
508                 // Execute the rule on the matchmaker site
509                 //
510
511                 try {
512                     result = rule(site, arg0, arg1, arg2);
513                     if (CallSiteOps.GetMatch(site)) {
514                         return result;
515                     }
516                 } finally {
517                     if (CallSiteOps.GetMatch(site)) {
518                         //
519                         // The rule worked. Add it to level 1 cache.
520                         //
521                         CallSiteOps.AddRule(@this, rule);
522                     }
523                 }
524
525                 // Rule we got back didn't work, try another one
526                 CallSiteOps.ClearMatch(site);
527             }
528         }
529
530         [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
531         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")]
532         internal static TRet NoMatch3<T0, T1, T2, TRet>(CallSite site, T0 arg0, T1 arg1, T2 arg2) {
533             site._match = false;
534             return default(TRet);
535         }
536
537
538
539         [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
540         internal static TRet UpdateAndExecute4<T0, T1, T2, T3, TRet>(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) {
541             //
542             // Declare the locals here upfront. It actually saves JIT stack space.
543             //
544             var @this = (CallSite<Func<CallSite, T0, T1, T2, T3, TRet>>)site;
545             Func<CallSite, T0, T1, T2, T3, TRet>[] applicable;
546             Func<CallSite, T0, T1, T2, T3, TRet> rule, originalRule = @this.Target;
547             TRet result;
548
549
550             //
551             // Create matchmaker and its site. We'll need them regardless.
552             //
553             site = CallSiteOps.CreateMatchmaker(@this);
554
555             //
556             // Level 1 cache lookup
557             //
558             if ((applicable = CallSiteOps.GetRules(@this)) != null) {
559                 for (int i = 0; i < applicable.Length; i++) {
560                     rule = applicable[i];
561
562                     //
563                     // Execute the rule
564                     //
565
566                     // if we've already tried it skip it...
567                     if ((object)rule != (object)originalRule) {
568                         @this.Target = rule;
569                         result = rule(site, arg0, arg1, arg2, arg3);
570
571                         if (CallSiteOps.GetMatch(site)) {
572                             CallSiteOps.UpdateRules(@this, i);
573                             return result;
574                         }        
575
576                         // Rule didn't match, try the next one
577                         CallSiteOps.ClearMatch(site);            
578                     }
579                 }
580             }
581
582             //
583             // Level 2 cache lookup
584             //
585
586             //
587             // Any applicable rules in level 2 cache?
588             //
589
590             var cache = CallSiteOps.GetRuleCache(@this);
591
592             applicable = cache.GetRules();
593             for (int i = 0; i < applicable.Length; i++) {
594                 rule = applicable[i];
595
596                 //
597                 // Execute the rule
598                 //
599                 @this.Target = rule;
600
601                 try {
602                     result = rule(site, arg0, arg1, arg2, arg3);
603                     if (CallSiteOps.GetMatch(site)) {
604                         return result;
605                     }
606                 } finally {
607                     if (CallSiteOps.GetMatch(site)) {
608                         //
609                         // Rule worked. Add it to level 1 cache
610                         //
611                         CallSiteOps.AddRule(@this, rule);
612                         // and then move it to the front of the L2 cache
613                         CallSiteOps.MoveRule(cache, rule, i);
614                     }
615                 }
616
617                 // Rule didn't match, try the next one
618                 CallSiteOps.ClearMatch(site);
619             }
620
621             //
622             // Miss on Level 0, 1 and 2 caches. Create new rule
623             //
624
625             rule = null;
626             var args = new object[] { arg0, arg1, arg2, arg3 };
627
628             for (; ; ) {
629                 @this.Target = originalRule;
630                 rule = @this.Target = @this.Binder.BindCore(@this, args);
631
632                 //
633                 // Execute the rule on the matchmaker site
634                 //
635
636                 try {
637                     result = rule(site, arg0, arg1, arg2, arg3);
638                     if (CallSiteOps.GetMatch(site)) {
639                         return result;
640                     }
641                 } finally {
642                     if (CallSiteOps.GetMatch(site)) {
643                         //
644                         // The rule worked. Add it to level 1 cache.
645                         //
646                         CallSiteOps.AddRule(@this, rule);
647                     }
648                 }
649
650                 // Rule we got back didn't work, try another one
651                 CallSiteOps.ClearMatch(site);
652             }
653         }
654
655         [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
656         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")]
657         internal static TRet NoMatch4<T0, T1, T2, T3, TRet>(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) {
658             site._match = false;
659             return default(TRet);
660         }
661
662
663
664         [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
665         internal static TRet UpdateAndExecute5<T0, T1, T2, T3, T4, TRet>(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4) {
666             //
667             // Declare the locals here upfront. It actually saves JIT stack space.
668             //
669             var @this = (CallSite<Func<CallSite, T0, T1, T2, T3, T4, TRet>>)site;
670             Func<CallSite, T0, T1, T2, T3, T4, TRet>[] applicable;
671             Func<CallSite, T0, T1, T2, T3, T4, TRet> rule, originalRule = @this.Target;
672             TRet result;
673
674
675             //
676             // Create matchmaker and its site. We'll need them regardless.
677             //
678             site = CallSiteOps.CreateMatchmaker(@this);
679
680             //
681             // Level 1 cache lookup
682             //
683             if ((applicable = CallSiteOps.GetRules(@this)) != null) {
684                 for (int i = 0; i < applicable.Length; i++) {
685                     rule = applicable[i];
686
687                     //
688                     // Execute the rule
689                     //
690
691                     // if we've already tried it skip it...
692                     if ((object)rule != (object)originalRule) {
693                         @this.Target = rule;
694                         result = rule(site, arg0, arg1, arg2, arg3, arg4);
695
696                         if (CallSiteOps.GetMatch(site)) {
697                             CallSiteOps.UpdateRules(@this, i);
698                             return result;
699                         }        
700
701                         // Rule didn't match, try the next one
702                         CallSiteOps.ClearMatch(site);            
703                     }
704                 }
705             }
706
707             //
708             // Level 2 cache lookup
709             //
710
711             //
712             // Any applicable rules in level 2 cache?
713             //
714
715             var cache = CallSiteOps.GetRuleCache(@this);
716
717             applicable = cache.GetRules();
718             for (int i = 0; i < applicable.Length; i++) {
719                 rule = applicable[i];
720
721                 //
722                 // Execute the rule
723                 //
724                 @this.Target = rule;
725
726                 try {
727                     result = rule(site, arg0, arg1, arg2, arg3, arg4);
728                     if (CallSiteOps.GetMatch(site)) {
729                         return result;
730                     }
731                 } finally {
732                     if (CallSiteOps.GetMatch(site)) {
733                         //
734                         // Rule worked. Add it to level 1 cache
735                         //
736                         CallSiteOps.AddRule(@this, rule);
737                         // and then move it to the front of the L2 cache
738                         CallSiteOps.MoveRule(cache, rule, i);
739                     }
740                 }
741
742                 // Rule didn't match, try the next one
743                 CallSiteOps.ClearMatch(site);
744             }
745
746             //
747             // Miss on Level 0, 1 and 2 caches. Create new rule
748             //
749
750             rule = null;
751             var args = new object[] { arg0, arg1, arg2, arg3, arg4 };
752
753             for (; ; ) {
754                 @this.Target = originalRule;
755                 rule = @this.Target = @this.Binder.BindCore(@this, args);
756
757                 //
758                 // Execute the rule on the matchmaker site
759                 //
760
761                 try {
762                     result = rule(site, arg0, arg1, arg2, arg3, arg4);
763                     if (CallSiteOps.GetMatch(site)) {
764                         return result;
765                     }
766                 } finally {
767                     if (CallSiteOps.GetMatch(site)) {
768                         //
769                         // The rule worked. Add it to level 1 cache.
770                         //
771                         CallSiteOps.AddRule(@this, rule);
772                     }
773                 }
774
775                 // Rule we got back didn't work, try another one
776                 CallSiteOps.ClearMatch(site);
777             }
778         }
779
780         [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
781         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")]
782         internal static TRet NoMatch5<T0, T1, T2, T3, T4, TRet>(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4) {
783             site._match = false;
784             return default(TRet);
785         }
786
787
788
789         [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
790         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) {
791             //
792             // Declare the locals here upfront. It actually saves JIT stack space.
793             //
794             var @this = (CallSite<Func<CallSite, T0, T1, T2, T3, T4, T5, TRet>>)site;
795             Func<CallSite, T0, T1, T2, T3, T4, T5, TRet>[] applicable;
796             Func<CallSite, T0, T1, T2, T3, T4, T5, TRet> rule, originalRule = @this.Target;
797             TRet result;
798
799
800             //
801             // Create matchmaker and its site. We'll need them regardless.
802             //
803             site = CallSiteOps.CreateMatchmaker(@this);
804
805             //
806             // Level 1 cache lookup
807             //
808             if ((applicable = CallSiteOps.GetRules(@this)) != null) {
809                 for (int i = 0; i < applicable.Length; i++) {
810                     rule = applicable[i];
811
812                     //
813                     // Execute the rule
814                     //
815
816                     // if we've already tried it skip it...
817                     if ((object)rule != (object)originalRule) {
818                         @this.Target = rule;
819                         result = rule(site, arg0, arg1, arg2, arg3, arg4, arg5);
820
821                         if (CallSiteOps.GetMatch(site)) {
822                             CallSiteOps.UpdateRules(@this, i);
823                             return result;
824                         }        
825
826                         // Rule didn't match, try the next one
827                         CallSiteOps.ClearMatch(site);            
828                     }
829                 }
830             }
831
832             //
833             // Level 2 cache lookup
834             //
835
836             //
837             // Any applicable rules in level 2 cache?
838             //
839
840             var cache = CallSiteOps.GetRuleCache(@this);
841
842             applicable = cache.GetRules();
843             for (int i = 0; i < applicable.Length; i++) {
844                 rule = applicable[i];
845
846                 //
847                 // Execute the rule
848                 //
849                 @this.Target = rule;
850
851                 try {
852                     result = rule(site, arg0, arg1, arg2, arg3, arg4, arg5);
853                     if (CallSiteOps.GetMatch(site)) {
854                         return result;
855                     }
856                 } finally {
857                     if (CallSiteOps.GetMatch(site)) {
858                         //
859                         // Rule worked. Add it to level 1 cache
860                         //
861                         CallSiteOps.AddRule(@this, rule);
862                         // and then move it to the front of the L2 cache
863                         CallSiteOps.MoveRule(cache, rule, i);
864                     }
865                 }
866
867                 // Rule didn't match, try the next one
868                 CallSiteOps.ClearMatch(site);
869             }
870
871             //
872             // Miss on Level 0, 1 and 2 caches. Create new rule
873             //
874
875             rule = null;
876             var args = new object[] { arg0, arg1, arg2, arg3, arg4, arg5 };
877
878             for (; ; ) {
879                 @this.Target = originalRule;
880                 rule = @this.Target = @this.Binder.BindCore(@this, args);
881
882                 //
883                 // Execute the rule on the matchmaker site
884                 //
885
886                 try {
887                     result = rule(site, arg0, arg1, arg2, arg3, arg4, arg5);
888                     if (CallSiteOps.GetMatch(site)) {
889                         return result;
890                     }
891                 } finally {
892                     if (CallSiteOps.GetMatch(site)) {
893                         //
894                         // The rule worked. Add it to level 1 cache.
895                         //
896                         CallSiteOps.AddRule(@this, rule);
897                     }
898                 }
899
900                 // Rule we got back didn't work, try another one
901                 CallSiteOps.ClearMatch(site);
902             }
903         }
904
905         [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
906         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")]
907         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) {
908             site._match = false;
909             return default(TRet);
910         }
911
912
913
914         [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
915         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) {
916             //
917             // Declare the locals here upfront. It actually saves JIT stack space.
918             //
919             var @this = (CallSite<Func<CallSite, T0, T1, T2, T3, T4, T5, T6, TRet>>)site;
920             Func<CallSite, T0, T1, T2, T3, T4, T5, T6, TRet>[] applicable;
921             Func<CallSite, T0, T1, T2, T3, T4, T5, T6, TRet> rule, originalRule = @this.Target;
922             TRet result;
923
924
925             //
926             // Create matchmaker and its site. We'll need them regardless.
927             //
928             site = CallSiteOps.CreateMatchmaker(@this);
929
930             //
931             // Level 1 cache lookup
932             //
933             if ((applicable = CallSiteOps.GetRules(@this)) != null) {
934                 for (int i = 0; i < applicable.Length; i++) {
935                     rule = applicable[i];
936
937                     //
938                     // Execute the rule
939                     //
940
941                     // if we've already tried it skip it...
942                     if ((object)rule != (object)originalRule) {
943                         @this.Target = rule;
944                         result = rule(site, arg0, arg1, arg2, arg3, arg4, arg5, arg6);
945
946                         if (CallSiteOps.GetMatch(site)) {
947                             CallSiteOps.UpdateRules(@this, i);
948                             return result;
949                         }        
950
951                         // Rule didn't match, try the next one
952                         CallSiteOps.ClearMatch(site);            
953                     }
954                 }
955             }
956
957             //
958             // Level 2 cache lookup
959             //
960
961             //
962             // Any applicable rules in level 2 cache?
963             //
964
965             var cache = CallSiteOps.GetRuleCache(@this);
966
967             applicable = cache.GetRules();
968             for (int i = 0; i < applicable.Length; i++) {
969                 rule = applicable[i];
970
971                 //
972                 // Execute the rule
973                 //
974                 @this.Target = rule;
975
976                 try {
977                     result = rule(site, arg0, arg1, arg2, arg3, arg4, arg5, arg6);
978                     if (CallSiteOps.GetMatch(site)) {
979                         return result;
980                     }
981                 } finally {
982                     if (CallSiteOps.GetMatch(site)) {
983                         //
984                         // Rule worked. Add it to level 1 cache
985                         //
986                         CallSiteOps.AddRule(@this, rule);
987                         // and then move it to the front of the L2 cache
988                         CallSiteOps.MoveRule(cache, rule, i);
989                     }
990                 }
991
992                 // Rule didn't match, try the next one
993                 CallSiteOps.ClearMatch(site);
994             }
995
996             //
997             // Miss on Level 0, 1 and 2 caches. Create new rule
998             //
999
1000             rule = null;
1001             var args = new object[] { arg0, arg1, arg2, arg3, arg4, arg5, arg6 };
1002
1003             for (; ; ) {
1004                 @this.Target = originalRule;
1005                 rule = @this.Target = @this.Binder.BindCore(@this, args);
1006
1007                 //
1008                 // Execute the rule on the matchmaker site
1009                 //
1010
1011                 try {
1012                     result = rule(site, arg0, arg1, arg2, arg3, arg4, arg5, arg6);
1013                     if (CallSiteOps.GetMatch(site)) {
1014                         return result;
1015                     }
1016                 } finally {
1017                     if (CallSiteOps.GetMatch(site)) {
1018                         //
1019                         // The rule worked. Add it to level 1 cache.
1020                         //
1021                         CallSiteOps.AddRule(@this, rule);
1022                     }
1023                 }
1024
1025                 // Rule we got back didn't work, try another one
1026                 CallSiteOps.ClearMatch(site);
1027             }
1028         }
1029
1030         [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
1031         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")]
1032         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) {
1033             site._match = false;
1034             return default(TRet);
1035         }
1036
1037
1038
1039         [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
1040         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) {
1041             //
1042             // Declare the locals here upfront. It actually saves JIT stack space.
1043             //
1044             var @this = (CallSite<Func<CallSite, T0, T1, T2, T3, T4, T5, T6, T7, TRet>>)site;
1045             Func<CallSite, T0, T1, T2, T3, T4, T5, T6, T7, TRet>[] applicable;
1046             Func<CallSite, T0, T1, T2, T3, T4, T5, T6, T7, TRet> rule, originalRule = @this.Target;
1047             TRet result;
1048
1049
1050             //
1051             // Create matchmaker and its site. We'll need them regardless.
1052             //
1053             site = CallSiteOps.CreateMatchmaker(@this);
1054
1055             //
1056             // Level 1 cache lookup
1057             //
1058             if ((applicable = CallSiteOps.GetRules(@this)) != null) {
1059                 for (int i = 0; i < applicable.Length; i++) {
1060                     rule = applicable[i];
1061
1062                     //
1063                     // Execute the rule
1064                     //
1065
1066                     // if we've already tried it skip it...
1067                     if ((object)rule != (object)originalRule) {
1068                         @this.Target = rule;
1069                         result = rule(site, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
1070
1071                         if (CallSiteOps.GetMatch(site)) {
1072                             CallSiteOps.UpdateRules(@this, i);
1073                             return result;
1074                         }        
1075
1076                         // Rule didn't match, try the next one
1077                         CallSiteOps.ClearMatch(site);            
1078                     }
1079                 }
1080             }
1081
1082             //
1083             // Level 2 cache lookup
1084             //
1085
1086             //
1087             // Any applicable rules in level 2 cache?
1088             //
1089
1090             var cache = CallSiteOps.GetRuleCache(@this);
1091
1092             applicable = cache.GetRules();
1093             for (int i = 0; i < applicable.Length; i++) {
1094                 rule = applicable[i];
1095
1096                 //
1097                 // Execute the rule
1098                 //
1099                 @this.Target = rule;
1100
1101                 try {
1102                     result = rule(site, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
1103                     if (CallSiteOps.GetMatch(site)) {
1104                         return result;
1105                     }
1106                 } finally {
1107                     if (CallSiteOps.GetMatch(site)) {
1108                         //
1109                         // Rule worked. Add it to level 1 cache
1110                         //
1111                         CallSiteOps.AddRule(@this, rule);
1112                         // and then move it to the front of the L2 cache
1113                         CallSiteOps.MoveRule(cache, rule, i);
1114                     }
1115                 }
1116
1117                 // Rule didn't match, try the next one
1118                 CallSiteOps.ClearMatch(site);
1119             }
1120
1121             //
1122             // Miss on Level 0, 1 and 2 caches. Create new rule
1123             //
1124
1125             rule = null;
1126             var args = new object[] { arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7 };
1127
1128             for (; ; ) {
1129                 @this.Target = originalRule;
1130                 rule = @this.Target = @this.Binder.BindCore(@this, args);
1131
1132                 //
1133                 // Execute the rule on the matchmaker site
1134                 //
1135
1136                 try {
1137                     result = rule(site, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
1138                     if (CallSiteOps.GetMatch(site)) {
1139                         return result;
1140                     }
1141                 } finally {
1142                     if (CallSiteOps.GetMatch(site)) {
1143                         //
1144                         // The rule worked. Add it to level 1 cache.
1145                         //
1146                         CallSiteOps.AddRule(@this, rule);
1147                     }
1148                 }
1149
1150                 // Rule we got back didn't work, try another one
1151                 CallSiteOps.ClearMatch(site);
1152             }
1153         }
1154
1155         [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
1156         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")]
1157         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) {
1158             site._match = false;
1159             return default(TRet);
1160         }
1161
1162
1163
1164         [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
1165         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) {
1166             //
1167             // Declare the locals here upfront. It actually saves JIT stack space.
1168             //
1169             var @this = (CallSite<Func<CallSite, T0, T1, T2, T3, T4, T5, T6, T7, T8, TRet>>)site;
1170             Func<CallSite, T0, T1, T2, T3, T4, T5, T6, T7, T8, TRet>[] applicable;
1171             Func<CallSite, T0, T1, T2, T3, T4, T5, T6, T7, T8, TRet> rule, originalRule = @this.Target;
1172             TRet result;
1173
1174
1175             //
1176             // Create matchmaker and its site. We'll need them regardless.
1177             //
1178             site = CallSiteOps.CreateMatchmaker(@this);
1179
1180             //
1181             // Level 1 cache lookup
1182             //
1183             if ((applicable = CallSiteOps.GetRules(@this)) != null) {
1184                 for (int i = 0; i < applicable.Length; i++) {
1185                     rule = applicable[i];
1186
1187                     //
1188                     // Execute the rule
1189                     //
1190
1191                     // if we've already tried it skip it...
1192                     if ((object)rule != (object)originalRule) {
1193                         @this.Target = rule;
1194                         result = rule(site, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
1195
1196                         if (CallSiteOps.GetMatch(site)) {
1197                             CallSiteOps.UpdateRules(@this, i);
1198                             return result;
1199                         }        
1200
1201                         // Rule didn't match, try the next one
1202                         CallSiteOps.ClearMatch(site);            
1203                     }
1204                 }
1205             }
1206
1207             //
1208             // Level 2 cache lookup
1209             //
1210
1211             //
1212             // Any applicable rules in level 2 cache?
1213             //
1214
1215             var cache = CallSiteOps.GetRuleCache(@this);
1216
1217             applicable = cache.GetRules();
1218             for (int i = 0; i < applicable.Length; i++) {
1219                 rule = applicable[i];
1220
1221                 //
1222                 // Execute the rule
1223                 //
1224                 @this.Target = rule;
1225
1226                 try {
1227                     result = rule(site, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
1228                     if (CallSiteOps.GetMatch(site)) {
1229                         return result;
1230                     }
1231                 } finally {
1232                     if (CallSiteOps.GetMatch(site)) {
1233                         //
1234                         // Rule worked. Add it to level 1 cache
1235                         //
1236                         CallSiteOps.AddRule(@this, rule);
1237                         // and then move it to the front of the L2 cache
1238                         CallSiteOps.MoveRule(cache, rule, i);
1239                     }
1240                 }
1241
1242                 // Rule didn't match, try the next one
1243                 CallSiteOps.ClearMatch(site);
1244             }
1245
1246             //
1247             // Miss on Level 0, 1 and 2 caches. Create new rule
1248             //
1249
1250             rule = null;
1251             var args = new object[] { arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8 };
1252
1253             for (; ; ) {
1254                 @this.Target = originalRule;
1255                 rule = @this.Target = @this.Binder.BindCore(@this, args);
1256
1257                 //
1258                 // Execute the rule on the matchmaker site
1259                 //
1260
1261                 try {
1262                     result = rule(site, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
1263                     if (CallSiteOps.GetMatch(site)) {
1264                         return result;
1265                     }
1266                 } finally {
1267                     if (CallSiteOps.GetMatch(site)) {
1268                         //
1269                         // The rule worked. Add it to level 1 cache.
1270                         //
1271                         CallSiteOps.AddRule(@this, rule);
1272                     }
1273                 }
1274
1275                 // Rule we got back didn't work, try another one
1276                 CallSiteOps.ClearMatch(site);
1277             }
1278         }
1279
1280         [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
1281         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")]
1282         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) {
1283             site._match = false;
1284             return default(TRet);
1285         }
1286
1287
1288
1289         [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
1290         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) {
1291             //
1292             // Declare the locals here upfront. It actually saves JIT stack space.
1293             //
1294             var @this = (CallSite<Func<CallSite, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, TRet>>)site;
1295             Func<CallSite, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, TRet>[] applicable;
1296             Func<CallSite, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, TRet> rule, originalRule = @this.Target;
1297             TRet result;
1298
1299
1300             //
1301             // Create matchmaker and its site. We'll need them regardless.
1302             //
1303             site = CallSiteOps.CreateMatchmaker(@this);
1304
1305             //
1306             // Level 1 cache lookup
1307             //
1308             if ((applicable = CallSiteOps.GetRules(@this)) != null) {
1309                 for (int i = 0; i < applicable.Length; i++) {
1310                     rule = applicable[i];
1311
1312                     //
1313                     // Execute the rule
1314                     //
1315
1316                     // if we've already tried it skip it...
1317                     if ((object)rule != (object)originalRule) {
1318                         @this.Target = rule;
1319                         result = rule(site, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
1320
1321                         if (CallSiteOps.GetMatch(site)) {
1322                             CallSiteOps.UpdateRules(@this, i);
1323                             return result;
1324                         }        
1325
1326                         // Rule didn't match, try the next one
1327                         CallSiteOps.ClearMatch(site);            
1328                     }
1329                 }
1330             }
1331
1332             //
1333             // Level 2 cache lookup
1334             //
1335
1336             //
1337             // Any applicable rules in level 2 cache?
1338             //
1339
1340             var cache = CallSiteOps.GetRuleCache(@this);
1341
1342             applicable = cache.GetRules();
1343             for (int i = 0; i < applicable.Length; i++) {
1344                 rule = applicable[i];
1345
1346                 //
1347                 // Execute the rule
1348                 //
1349                 @this.Target = rule;
1350
1351                 try {
1352                     result = rule(site, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
1353                     if (CallSiteOps.GetMatch(site)) {
1354                         return result;
1355                     }
1356                 } finally {
1357                     if (CallSiteOps.GetMatch(site)) {
1358                         //
1359                         // Rule worked. Add it to level 1 cache
1360                         //
1361                         CallSiteOps.AddRule(@this, rule);
1362                         // and then move it to the front of the L2 cache
1363                         CallSiteOps.MoveRule(cache, rule, i);
1364                     }
1365                 }
1366
1367                 // Rule didn't match, try the next one
1368                 CallSiteOps.ClearMatch(site);
1369             }
1370
1371             //
1372             // Miss on Level 0, 1 and 2 caches. Create new rule
1373             //
1374
1375             rule = null;
1376             var args = new object[] { arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9 };
1377
1378             for (; ; ) {
1379                 @this.Target = originalRule;
1380                 rule = @this.Target = @this.Binder.BindCore(@this, args);
1381
1382                 //
1383                 // Execute the rule on the matchmaker site
1384                 //
1385
1386                 try {
1387                     result = rule(site, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
1388                     if (CallSiteOps.GetMatch(site)) {
1389                         return result;
1390                     }
1391                 } finally {
1392                     if (CallSiteOps.GetMatch(site)) {
1393                         //
1394                         // The rule worked. Add it to level 1 cache.
1395                         //
1396                         CallSiteOps.AddRule(@this, rule);
1397                     }
1398                 }
1399
1400                 // Rule we got back didn't work, try another one
1401                 CallSiteOps.ClearMatch(site);
1402             }
1403         }
1404
1405         [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
1406         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")]
1407         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) {
1408             site._match = false;
1409             return default(TRet);
1410         }
1411
1412
1413
1414         [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
1415         internal static void UpdateAndExecuteVoid1<T0>(CallSite site, T0 arg0) {
1416             //
1417             // Declare the locals here upfront. It actually saves JIT stack space.
1418             //
1419             var @this = (CallSite<Action<CallSite, T0>>)site;
1420             Action<CallSite, T0>[] applicable;
1421             Action<CallSite, T0> rule, originalRule = @this.Target;
1422
1423
1424             //
1425             // Create matchmaker and its site. We'll need them regardless.
1426             //
1427             site = CallSiteOps.CreateMatchmaker(@this);
1428
1429             //
1430             // Level 1 cache lookup
1431             //
1432             if ((applicable = CallSiteOps.GetRules(@this)) != null) {
1433                 for (int i = 0; i < applicable.Length; i++) {
1434                     rule = applicable[i];
1435
1436                     //
1437                     // Execute the rule
1438                     //
1439
1440                     // if we've already tried it skip it...
1441                     if ((object)rule != (object)originalRule) {
1442                         @this.Target = rule;
1443                          rule(site, arg0);
1444
1445                         if (CallSiteOps.GetMatch(site)) {
1446                             CallSiteOps.UpdateRules(@this, i);
1447                             return;
1448                         }        
1449
1450                         // Rule didn't match, try the next one
1451                         CallSiteOps.ClearMatch(site);            
1452                     }
1453                 }
1454             }
1455
1456             //
1457             // Level 2 cache lookup
1458             //
1459
1460             //
1461             // Any applicable rules in level 2 cache?
1462             //
1463
1464             var cache = CallSiteOps.GetRuleCache(@this);
1465
1466             applicable = cache.GetRules();
1467             for (int i = 0; i < applicable.Length; i++) {
1468                 rule = applicable[i];
1469
1470                 //
1471                 // Execute the rule
1472                 //
1473                 @this.Target = rule;
1474
1475                 try {
1476                      rule(site, arg0);
1477                     if (CallSiteOps.GetMatch(site)) {
1478                         return;
1479                     }
1480                 } finally {
1481                     if (CallSiteOps.GetMatch(site)) {
1482                         //
1483                         // Rule worked. Add it to level 1 cache
1484                         //
1485                         CallSiteOps.AddRule(@this, rule);
1486                         // and then move it to the front of the L2 cache
1487                         CallSiteOps.MoveRule(cache, rule, i);
1488                     }
1489                 }
1490
1491                 // Rule didn't match, try the next one
1492                 CallSiteOps.ClearMatch(site);
1493             }
1494
1495             //
1496             // Miss on Level 0, 1 and 2 caches. Create new rule
1497             //
1498
1499             rule = null;
1500             var args = new object[] { arg0 };
1501
1502             for (; ; ) {
1503                 @this.Target = originalRule;
1504                 rule = @this.Target = @this.Binder.BindCore(@this, args);
1505
1506                 //
1507                 // Execute the rule on the matchmaker site
1508                 //
1509
1510                 try {
1511                      rule(site, arg0);
1512                     if (CallSiteOps.GetMatch(site)) {
1513                         return;
1514                     }
1515                 } finally {
1516                     if (CallSiteOps.GetMatch(site)) {
1517                         //
1518                         // The rule worked. Add it to level 1 cache.
1519                         //
1520                         CallSiteOps.AddRule(@this, rule);
1521                     }
1522                 }
1523
1524                 // Rule we got back didn't work, try another one
1525                 CallSiteOps.ClearMatch(site);
1526             }
1527         }
1528
1529         [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
1530         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")]
1531         internal static void NoMatchVoid1<T0>(CallSite site, T0 arg0) {
1532             site._match = false;
1533             return;
1534         }
1535
1536
1537
1538         [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
1539         internal static void UpdateAndExecuteVoid2<T0, T1>(CallSite site, T0 arg0, T1 arg1) {
1540             //
1541             // Declare the locals here upfront. It actually saves JIT stack space.
1542             //
1543             var @this = (CallSite<Action<CallSite, T0, T1>>)site;
1544             Action<CallSite, T0, T1>[] applicable;
1545             Action<CallSite, T0, T1> rule, originalRule = @this.Target;
1546
1547
1548             //
1549             // Create matchmaker and its site. We'll need them regardless.
1550             //
1551             site = CallSiteOps.CreateMatchmaker(@this);
1552
1553             //
1554             // Level 1 cache lookup
1555             //
1556             if ((applicable = CallSiteOps.GetRules(@this)) != null) {
1557                 for (int i = 0; i < applicable.Length; i++) {
1558                     rule = applicable[i];
1559
1560                     //
1561                     // Execute the rule
1562                     //
1563
1564                     // if we've already tried it skip it...
1565                     if ((object)rule != (object)originalRule) {
1566                         @this.Target = rule;
1567                          rule(site, arg0, arg1);
1568
1569                         if (CallSiteOps.GetMatch(site)) {
1570                             CallSiteOps.UpdateRules(@this, i);
1571                             return;
1572                         }        
1573
1574                         // Rule didn't match, try the next one
1575                         CallSiteOps.ClearMatch(site);            
1576                     }
1577                 }
1578             }
1579
1580             //
1581             // Level 2 cache lookup
1582             //
1583
1584             //
1585             // Any applicable rules in level 2 cache?
1586             //
1587
1588             var cache = CallSiteOps.GetRuleCache(@this);
1589
1590             applicable = cache.GetRules();
1591             for (int i = 0; i < applicable.Length; i++) {
1592                 rule = applicable[i];
1593
1594                 //
1595                 // Execute the rule
1596                 //
1597                 @this.Target = rule;
1598
1599                 try {
1600                      rule(site, arg0, arg1);
1601                     if (CallSiteOps.GetMatch(site)) {
1602                         return;
1603                     }
1604                 } finally {
1605                     if (CallSiteOps.GetMatch(site)) {
1606                         //
1607                         // Rule worked. Add it to level 1 cache
1608                         //
1609                         CallSiteOps.AddRule(@this, rule);
1610                         // and then move it to the front of the L2 cache
1611                         CallSiteOps.MoveRule(cache, rule, i);
1612                     }
1613                 }
1614
1615                 // Rule didn't match, try the next one
1616                 CallSiteOps.ClearMatch(site);
1617             }
1618
1619             //
1620             // Miss on Level 0, 1 and 2 caches. Create new rule
1621             //
1622
1623             rule = null;
1624             var args = new object[] { arg0, arg1 };
1625
1626             for (; ; ) {
1627                 @this.Target = originalRule;
1628                 rule = @this.Target = @this.Binder.BindCore(@this, args);
1629
1630                 //
1631                 // Execute the rule on the matchmaker site
1632                 //
1633
1634                 try {
1635                      rule(site, arg0, arg1);
1636                     if (CallSiteOps.GetMatch(site)) {
1637                         return;
1638                     }
1639                 } finally {
1640                     if (CallSiteOps.GetMatch(site)) {
1641                         //
1642                         // The rule worked. Add it to level 1 cache.
1643                         //
1644                         CallSiteOps.AddRule(@this, rule);
1645                     }
1646                 }
1647
1648                 // Rule we got back didn't work, try another one
1649                 CallSiteOps.ClearMatch(site);
1650             }
1651         }
1652
1653         [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
1654         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")]
1655         internal static void NoMatchVoid2<T0, T1>(CallSite site, T0 arg0, T1 arg1) {
1656             site._match = false;
1657             return;
1658         }
1659
1660
1661
1662         [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
1663         internal static void UpdateAndExecuteVoid3<T0, T1, T2>(CallSite site, T0 arg0, T1 arg1, T2 arg2) {
1664             //
1665             // Declare the locals here upfront. It actually saves JIT stack space.
1666             //
1667             var @this = (CallSite<Action<CallSite, T0, T1, T2>>)site;
1668             Action<CallSite, T0, T1, T2>[] applicable;
1669             Action<CallSite, T0, T1, T2> rule, originalRule = @this.Target;
1670
1671
1672             //
1673             // Create matchmaker and its site. We'll need them regardless.
1674             //
1675             site = CallSiteOps.CreateMatchmaker(@this);
1676
1677             //
1678             // Level 1 cache lookup
1679             //
1680             if ((applicable = CallSiteOps.GetRules(@this)) != null) {
1681                 for (int i = 0; i < applicable.Length; i++) {
1682                     rule = applicable[i];
1683
1684                     //
1685                     // Execute the rule
1686                     //
1687
1688                     // if we've already tried it skip it...
1689                     if ((object)rule != (object)originalRule) {
1690                         @this.Target = rule;
1691                          rule(site, arg0, arg1, arg2);
1692
1693                         if (CallSiteOps.GetMatch(site)) {
1694                             CallSiteOps.UpdateRules(@this, i);
1695                             return;
1696                         }        
1697
1698                         // Rule didn't match, try the next one
1699                         CallSiteOps.ClearMatch(site);            
1700                     }
1701                 }
1702             }
1703
1704             //
1705             // Level 2 cache lookup
1706             //
1707
1708             //
1709             // Any applicable rules in level 2 cache?
1710             //
1711
1712             var cache = CallSiteOps.GetRuleCache(@this);
1713
1714             applicable = cache.GetRules();
1715             for (int i = 0; i < applicable.Length; i++) {
1716                 rule = applicable[i];
1717
1718                 //
1719                 // Execute the rule
1720                 //
1721                 @this.Target = rule;
1722
1723                 try {
1724                      rule(site, arg0, arg1, arg2);
1725                     if (CallSiteOps.GetMatch(site)) {
1726                         return;
1727                     }
1728                 } finally {
1729                     if (CallSiteOps.GetMatch(site)) {
1730                         //
1731                         // Rule worked. Add it to level 1 cache
1732                         //
1733                         CallSiteOps.AddRule(@this, rule);
1734                         // and then move it to the front of the L2 cache
1735                         CallSiteOps.MoveRule(cache, rule, i);
1736                     }
1737                 }
1738
1739                 // Rule didn't match, try the next one
1740                 CallSiteOps.ClearMatch(site);
1741             }
1742
1743             //
1744             // Miss on Level 0, 1 and 2 caches. Create new rule
1745             //
1746
1747             rule = null;
1748             var args = new object[] { arg0, arg1, arg2 };
1749
1750             for (; ; ) {
1751                 @this.Target = originalRule;
1752                 rule = @this.Target = @this.Binder.BindCore(@this, args);
1753
1754                 //
1755                 // Execute the rule on the matchmaker site
1756                 //
1757
1758                 try {
1759                      rule(site, arg0, arg1, arg2);
1760                     if (CallSiteOps.GetMatch(site)) {
1761                         return;
1762                     }
1763                 } finally {
1764                     if (CallSiteOps.GetMatch(site)) {
1765                         //
1766                         // The rule worked. Add it to level 1 cache.
1767                         //
1768                         CallSiteOps.AddRule(@this, rule);
1769                     }
1770                 }
1771
1772                 // Rule we got back didn't work, try another one
1773                 CallSiteOps.ClearMatch(site);
1774             }
1775         }
1776
1777         [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
1778         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")]
1779         internal static void NoMatchVoid3<T0, T1, T2>(CallSite site, T0 arg0, T1 arg1, T2 arg2) {
1780             site._match = false;
1781             return;
1782         }
1783
1784
1785
1786         [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
1787         internal static void UpdateAndExecuteVoid4<T0, T1, T2, T3>(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) {
1788             //
1789             // Declare the locals here upfront. It actually saves JIT stack space.
1790             //
1791             var @this = (CallSite<Action<CallSite, T0, T1, T2, T3>>)site;
1792             Action<CallSite, T0, T1, T2, T3>[] applicable;
1793             Action<CallSite, T0, T1, T2, T3> rule, originalRule = @this.Target;
1794
1795
1796             //
1797             // Create matchmaker and its site. We'll need them regardless.
1798             //
1799             site = CallSiteOps.CreateMatchmaker(@this);
1800
1801             //
1802             // Level 1 cache lookup
1803             //
1804             if ((applicable = CallSiteOps.GetRules(@this)) != null) {
1805                 for (int i = 0; i < applicable.Length; i++) {
1806                     rule = applicable[i];
1807
1808                     //
1809                     // Execute the rule
1810                     //
1811
1812                     // if we've already tried it skip it...
1813                     if ((object)rule != (object)originalRule) {
1814                         @this.Target = rule;
1815                          rule(site, arg0, arg1, arg2, arg3);
1816
1817                         if (CallSiteOps.GetMatch(site)) {
1818                             CallSiteOps.UpdateRules(@this, i);
1819                             return;
1820                         }        
1821
1822                         // Rule didn't match, try the next one
1823                         CallSiteOps.ClearMatch(site);            
1824                     }
1825                 }
1826             }
1827
1828             //
1829             // Level 2 cache lookup
1830             //
1831
1832             //
1833             // Any applicable rules in level 2 cache?
1834             //
1835
1836             var cache = CallSiteOps.GetRuleCache(@this);
1837
1838             applicable = cache.GetRules();
1839             for (int i = 0; i < applicable.Length; i++) {
1840                 rule = applicable[i];
1841
1842                 //
1843                 // Execute the rule
1844                 //
1845                 @this.Target = rule;
1846
1847                 try {
1848                      rule(site, arg0, arg1, arg2, arg3);
1849                     if (CallSiteOps.GetMatch(site)) {
1850                         return;
1851                     }
1852                 } finally {
1853                     if (CallSiteOps.GetMatch(site)) {
1854                         //
1855                         // Rule worked. Add it to level 1 cache
1856                         //
1857                         CallSiteOps.AddRule(@this, rule);
1858                         // and then move it to the front of the L2 cache
1859                         CallSiteOps.MoveRule(cache, rule, i);
1860                     }
1861                 }
1862
1863                 // Rule didn't match, try the next one
1864                 CallSiteOps.ClearMatch(site);
1865             }
1866
1867             //
1868             // Miss on Level 0, 1 and 2 caches. Create new rule
1869             //
1870
1871             rule = null;
1872             var args = new object[] { arg0, arg1, arg2, arg3 };
1873
1874             for (; ; ) {
1875                 @this.Target = originalRule;
1876                 rule = @this.Target = @this.Binder.BindCore(@this, args);
1877
1878                 //
1879                 // Execute the rule on the matchmaker site
1880                 //
1881
1882                 try {
1883                      rule(site, arg0, arg1, arg2, arg3);
1884                     if (CallSiteOps.GetMatch(site)) {
1885                         return;
1886                     }
1887                 } finally {
1888                     if (CallSiteOps.GetMatch(site)) {
1889                         //
1890                         // The rule worked. Add it to level 1 cache.
1891                         //
1892                         CallSiteOps.AddRule(@this, rule);
1893                     }
1894                 }
1895
1896                 // Rule we got back didn't work, try another one
1897                 CallSiteOps.ClearMatch(site);
1898             }
1899         }
1900
1901         [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
1902         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")]
1903         internal static void NoMatchVoid4<T0, T1, T2, T3>(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) {
1904             site._match = false;
1905             return;
1906         }
1907
1908
1909
1910         [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
1911         internal static void UpdateAndExecuteVoid5<T0, T1, T2, T3, T4>(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4) {
1912             //
1913             // Declare the locals here upfront. It actually saves JIT stack space.
1914             //
1915             var @this = (CallSite<Action<CallSite, T0, T1, T2, T3, T4>>)site;
1916             Action<CallSite, T0, T1, T2, T3, T4>[] applicable;
1917             Action<CallSite, T0, T1, T2, T3, T4> rule, originalRule = @this.Target;
1918
1919
1920             //
1921             // Create matchmaker and its site. We'll need them regardless.
1922             //
1923             site = CallSiteOps.CreateMatchmaker(@this);
1924
1925             //
1926             // Level 1 cache lookup
1927             //
1928             if ((applicable = CallSiteOps.GetRules(@this)) != null) {
1929                 for (int i = 0; i < applicable.Length; i++) {
1930                     rule = applicable[i];
1931
1932                     //
1933                     // Execute the rule
1934                     //
1935
1936                     // if we've already tried it skip it...
1937                     if ((object)rule != (object)originalRule) {
1938                         @this.Target = rule;
1939                          rule(site, arg0, arg1, arg2, arg3, arg4);
1940
1941                         if (CallSiteOps.GetMatch(site)) {
1942                             CallSiteOps.UpdateRules(@this, i);
1943                             return;
1944                         }        
1945
1946                         // Rule didn't match, try the next one
1947                         CallSiteOps.ClearMatch(site);            
1948                     }
1949                 }
1950             }
1951
1952             //
1953             // Level 2 cache lookup
1954             //
1955
1956             //
1957             // Any applicable rules in level 2 cache?
1958             //
1959
1960             var cache = CallSiteOps.GetRuleCache(@this);
1961
1962             applicable = cache.GetRules();
1963             for (int i = 0; i < applicable.Length; i++) {
1964                 rule = applicable[i];
1965
1966                 //
1967                 // Execute the rule
1968                 //
1969                 @this.Target = rule;
1970
1971                 try {
1972                      rule(site, arg0, arg1, arg2, arg3, arg4);
1973                     if (CallSiteOps.GetMatch(site)) {
1974                         return;
1975                     }
1976                 } finally {
1977                     if (CallSiteOps.GetMatch(site)) {
1978                         //
1979                         // Rule worked. Add it to level 1 cache
1980                         //
1981                         CallSiteOps.AddRule(@this, rule);
1982                         // and then move it to the front of the L2 cache
1983                         CallSiteOps.MoveRule(cache, rule, i);
1984                     }
1985                 }
1986
1987                 // Rule didn't match, try the next one
1988                 CallSiteOps.ClearMatch(site);
1989             }
1990
1991             //
1992             // Miss on Level 0, 1 and 2 caches. Create new rule
1993             //
1994
1995             rule = null;
1996             var args = new object[] { arg0, arg1, arg2, arg3, arg4 };
1997
1998             for (; ; ) {
1999                 @this.Target = originalRule;
2000                 rule = @this.Target = @this.Binder.BindCore(@this, args);
2001
2002                 //
2003                 // Execute the rule on the matchmaker site
2004                 //
2005
2006                 try {
2007                      rule(site, arg0, arg1, arg2, arg3, arg4);
2008                     if (CallSiteOps.GetMatch(site)) {
2009                         return;
2010                     }
2011                 } finally {
2012                     if (CallSiteOps.GetMatch(site)) {
2013                         //
2014                         // The rule worked. Add it to level 1 cache.
2015                         //
2016                         CallSiteOps.AddRule(@this, rule);
2017                     }
2018                 }
2019
2020                 // Rule we got back didn't work, try another one
2021                 CallSiteOps.ClearMatch(site);
2022             }
2023         }
2024
2025         [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
2026         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")]
2027         internal static void NoMatchVoid5<T0, T1, T2, T3, T4>(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4) {
2028             site._match = false;
2029             return;
2030         }
2031
2032
2033
2034         [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
2035         internal static void UpdateAndExecuteVoid6<T0, T1, T2, T3, T4, T5>(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5) {
2036             //
2037             // Declare the locals here upfront. It actually saves JIT stack space.
2038             //
2039             var @this = (CallSite<Action<CallSite, T0, T1, T2, T3, T4, T5>>)site;
2040             Action<CallSite, T0, T1, T2, T3, T4, T5>[] applicable;
2041             Action<CallSite, T0, T1, T2, T3, T4, T5> rule, originalRule = @this.Target;
2042
2043
2044             //
2045             // Create matchmaker and its site. We'll need them regardless.
2046             //
2047             site = CallSiteOps.CreateMatchmaker(@this);
2048
2049             //
2050             // Level 1 cache lookup
2051             //
2052             if ((applicable = CallSiteOps.GetRules(@this)) != null) {
2053                 for (int i = 0; i < applicable.Length; i++) {
2054                     rule = applicable[i];
2055
2056                     //
2057                     // Execute the rule
2058                     //
2059
2060                     // if we've already tried it skip it...
2061                     if ((object)rule != (object)originalRule) {
2062                         @this.Target = rule;
2063                          rule(site, arg0, arg1, arg2, arg3, arg4, arg5);
2064
2065                         if (CallSiteOps.GetMatch(site)) {
2066                             CallSiteOps.UpdateRules(@this, i);
2067                             return;
2068                         }        
2069
2070                         // Rule didn't match, try the next one
2071                         CallSiteOps.ClearMatch(site);            
2072                     }
2073                 }
2074             }
2075
2076             //
2077             // Level 2 cache lookup
2078             //
2079
2080             //
2081             // Any applicable rules in level 2 cache?
2082             //
2083
2084             var cache = CallSiteOps.GetRuleCache(@this);
2085
2086             applicable = cache.GetRules();
2087             for (int i = 0; i < applicable.Length; i++) {
2088                 rule = applicable[i];
2089
2090                 //
2091                 // Execute the rule
2092                 //
2093                 @this.Target = rule;
2094
2095                 try {
2096                      rule(site, arg0, arg1, arg2, arg3, arg4, arg5);
2097                     if (CallSiteOps.GetMatch(site)) {
2098                         return;
2099                     }
2100                 } finally {
2101                     if (CallSiteOps.GetMatch(site)) {
2102                         //
2103                         // Rule worked. Add it to level 1 cache
2104                         //
2105                         CallSiteOps.AddRule(@this, rule);
2106                         // and then move it to the front of the L2 cache
2107                         CallSiteOps.MoveRule(cache, rule, i);
2108                     }
2109                 }
2110
2111                 // Rule didn't match, try the next one
2112                 CallSiteOps.ClearMatch(site);
2113             }
2114
2115             //
2116             // Miss on Level 0, 1 and 2 caches. Create new rule
2117             //
2118
2119             rule = null;
2120             var args = new object[] { arg0, arg1, arg2, arg3, arg4, arg5 };
2121
2122             for (; ; ) {
2123                 @this.Target = originalRule;
2124                 rule = @this.Target = @this.Binder.BindCore(@this, args);
2125
2126                 //
2127                 // Execute the rule on the matchmaker site
2128                 //
2129
2130                 try {
2131                      rule(site, arg0, arg1, arg2, arg3, arg4, arg5);
2132                     if (CallSiteOps.GetMatch(site)) {
2133                         return;
2134                     }
2135                 } finally {
2136                     if (CallSiteOps.GetMatch(site)) {
2137                         //
2138                         // The rule worked. Add it to level 1 cache.
2139                         //
2140                         CallSiteOps.AddRule(@this, rule);
2141                     }
2142                 }
2143
2144                 // Rule we got back didn't work, try another one
2145                 CallSiteOps.ClearMatch(site);
2146             }
2147         }
2148
2149         [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
2150         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")]
2151         internal static void NoMatchVoid6<T0, T1, T2, T3, T4, T5>(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5) {
2152             site._match = false;
2153             return;
2154         }
2155
2156
2157
2158         [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
2159         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) {
2160             //
2161             // Declare the locals here upfront. It actually saves JIT stack space.
2162             //
2163             var @this = (CallSite<Action<CallSite, T0, T1, T2, T3, T4, T5, T6>>)site;
2164             Action<CallSite, T0, T1, T2, T3, T4, T5, T6>[] applicable;
2165             Action<CallSite, T0, T1, T2, T3, T4, T5, T6> rule, originalRule = @this.Target;
2166
2167
2168             //
2169             // Create matchmaker and its site. We'll need them regardless.
2170             //
2171             site = CallSiteOps.CreateMatchmaker(@this);
2172
2173             //
2174             // Level 1 cache lookup
2175             //
2176             if ((applicable = CallSiteOps.GetRules(@this)) != null) {
2177                 for (int i = 0; i < applicable.Length; i++) {
2178                     rule = applicable[i];
2179
2180                     //
2181                     // Execute the rule
2182                     //
2183
2184                     // if we've already tried it skip it...
2185                     if ((object)rule != (object)originalRule) {
2186                         @this.Target = rule;
2187                          rule(site, arg0, arg1, arg2, arg3, arg4, arg5, arg6);
2188
2189                         if (CallSiteOps.GetMatch(site)) {
2190                             CallSiteOps.UpdateRules(@this, i);
2191                             return;
2192                         }        
2193
2194                         // Rule didn't match, try the next one
2195                         CallSiteOps.ClearMatch(site);            
2196                     }
2197                 }
2198             }
2199
2200             //
2201             // Level 2 cache lookup
2202             //
2203
2204             //
2205             // Any applicable rules in level 2 cache?
2206             //
2207
2208             var cache = CallSiteOps.GetRuleCache(@this);
2209
2210             applicable = cache.GetRules();
2211             for (int i = 0; i < applicable.Length; i++) {
2212                 rule = applicable[i];
2213
2214                 //
2215                 // Execute the rule
2216                 //
2217                 @this.Target = rule;
2218
2219                 try {
2220                      rule(site, arg0, arg1, arg2, arg3, arg4, arg5, arg6);
2221                     if (CallSiteOps.GetMatch(site)) {
2222                         return;
2223                     }
2224                 } finally {
2225                     if (CallSiteOps.GetMatch(site)) {
2226                         //
2227                         // Rule worked. Add it to level 1 cache
2228                         //
2229                         CallSiteOps.AddRule(@this, rule);
2230                         // and then move it to the front of the L2 cache
2231                         CallSiteOps.MoveRule(cache, rule, i);
2232                     }
2233                 }
2234
2235                 // Rule didn't match, try the next one
2236                 CallSiteOps.ClearMatch(site);
2237             }
2238
2239             //
2240             // Miss on Level 0, 1 and 2 caches. Create new rule
2241             //
2242
2243             rule = null;
2244             var args = new object[] { arg0, arg1, arg2, arg3, arg4, arg5, arg6 };
2245
2246             for (; ; ) {
2247                 @this.Target = originalRule;
2248                 rule = @this.Target = @this.Binder.BindCore(@this, args);
2249
2250                 //
2251                 // Execute the rule on the matchmaker site
2252                 //
2253
2254                 try {
2255                      rule(site, arg0, arg1, arg2, arg3, arg4, arg5, arg6);
2256                     if (CallSiteOps.GetMatch(site)) {
2257                         return;
2258                     }
2259                 } finally {
2260                     if (CallSiteOps.GetMatch(site)) {
2261                         //
2262                         // The rule worked. Add it to level 1 cache.
2263                         //
2264                         CallSiteOps.AddRule(@this, rule);
2265                     }
2266                 }
2267
2268                 // Rule we got back didn't work, try another one
2269                 CallSiteOps.ClearMatch(site);
2270             }
2271         }
2272
2273         [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
2274         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")]
2275         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) {
2276             site._match = false;
2277             return;
2278         }
2279
2280
2281
2282         [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
2283         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) {
2284             //
2285             // Declare the locals here upfront. It actually saves JIT stack space.
2286             //
2287             var @this = (CallSite<Action<CallSite, T0, T1, T2, T3, T4, T5, T6, T7>>)site;
2288             Action<CallSite, T0, T1, T2, T3, T4, T5, T6, T7>[] applicable;
2289             Action<CallSite, T0, T1, T2, T3, T4, T5, T6, T7> rule, originalRule = @this.Target;
2290
2291
2292             //
2293             // Create matchmaker and its site. We'll need them regardless.
2294             //
2295             site = CallSiteOps.CreateMatchmaker(@this);
2296
2297             //
2298             // Level 1 cache lookup
2299             //
2300             if ((applicable = CallSiteOps.GetRules(@this)) != null) {
2301                 for (int i = 0; i < applicable.Length; i++) {
2302                     rule = applicable[i];
2303
2304                     //
2305                     // Execute the rule
2306                     //
2307
2308                     // if we've already tried it skip it...
2309                     if ((object)rule != (object)originalRule) {
2310                         @this.Target = rule;
2311                          rule(site, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
2312
2313                         if (CallSiteOps.GetMatch(site)) {
2314                             CallSiteOps.UpdateRules(@this, i);
2315                             return;
2316                         }        
2317
2318                         // Rule didn't match, try the next one
2319                         CallSiteOps.ClearMatch(site);            
2320                     }
2321                 }
2322             }
2323
2324             //
2325             // Level 2 cache lookup
2326             //
2327
2328             //
2329             // Any applicable rules in level 2 cache?
2330             //
2331
2332             var cache = CallSiteOps.GetRuleCache(@this);
2333
2334             applicable = cache.GetRules();
2335             for (int i = 0; i < applicable.Length; i++) {
2336                 rule = applicable[i];
2337
2338                 //
2339                 // Execute the rule
2340                 //
2341                 @this.Target = rule;
2342
2343                 try {
2344                      rule(site, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
2345                     if (CallSiteOps.GetMatch(site)) {
2346                         return;
2347                     }
2348                 } finally {
2349                     if (CallSiteOps.GetMatch(site)) {
2350                         //
2351                         // Rule worked. Add it to level 1 cache
2352                         //
2353                         CallSiteOps.AddRule(@this, rule);
2354                         // and then move it to the front of the L2 cache
2355                         CallSiteOps.MoveRule(cache, rule, i);
2356                     }
2357                 }
2358
2359                 // Rule didn't match, try the next one
2360                 CallSiteOps.ClearMatch(site);
2361             }
2362
2363             //
2364             // Miss on Level 0, 1 and 2 caches. Create new rule
2365             //
2366
2367             rule = null;
2368             var args = new object[] { arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7 };
2369
2370             for (; ; ) {
2371                 @this.Target = originalRule;
2372                 rule = @this.Target = @this.Binder.BindCore(@this, args);
2373
2374                 //
2375                 // Execute the rule on the matchmaker site
2376                 //
2377
2378                 try {
2379                      rule(site, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
2380                     if (CallSiteOps.GetMatch(site)) {
2381                         return;
2382                     }
2383                 } finally {
2384                     if (CallSiteOps.GetMatch(site)) {
2385                         //
2386                         // The rule worked. Add it to level 1 cache.
2387                         //
2388                         CallSiteOps.AddRule(@this, rule);
2389                     }
2390                 }
2391
2392                 // Rule we got back didn't work, try another one
2393                 CallSiteOps.ClearMatch(site);
2394             }
2395         }
2396
2397         [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
2398         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")]
2399         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) {
2400             site._match = false;
2401             return;
2402         }
2403
2404
2405
2406         [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
2407         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) {
2408             //
2409             // Declare the locals here upfront. It actually saves JIT stack space.
2410             //
2411             var @this = (CallSite<Action<CallSite, T0, T1, T2, T3, T4, T5, T6, T7, T8>>)site;
2412             Action<CallSite, T0, T1, T2, T3, T4, T5, T6, T7, T8>[] applicable;
2413             Action<CallSite, T0, T1, T2, T3, T4, T5, T6, T7, T8> rule, originalRule = @this.Target;
2414
2415
2416             //
2417             // Create matchmaker and its site. We'll need them regardless.
2418             //
2419             site = CallSiteOps.CreateMatchmaker(@this);
2420
2421             //
2422             // Level 1 cache lookup
2423             //
2424             if ((applicable = CallSiteOps.GetRules(@this)) != null) {
2425                 for (int i = 0; i < applicable.Length; i++) {
2426                     rule = applicable[i];
2427
2428                     //
2429                     // Execute the rule
2430                     //
2431
2432                     // if we've already tried it skip it...
2433                     if ((object)rule != (object)originalRule) {
2434                         @this.Target = rule;
2435                          rule(site, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
2436
2437                         if (CallSiteOps.GetMatch(site)) {
2438                             CallSiteOps.UpdateRules(@this, i);
2439                             return;
2440                         }        
2441
2442                         // Rule didn't match, try the next one
2443                         CallSiteOps.ClearMatch(site);            
2444                     }
2445                 }
2446             }
2447
2448             //
2449             // Level 2 cache lookup
2450             //
2451
2452             //
2453             // Any applicable rules in level 2 cache?
2454             //
2455
2456             var cache = CallSiteOps.GetRuleCache(@this);
2457
2458             applicable = cache.GetRules();
2459             for (int i = 0; i < applicable.Length; i++) {
2460                 rule = applicable[i];
2461
2462                 //
2463                 // Execute the rule
2464                 //
2465                 @this.Target = rule;
2466
2467                 try {
2468                      rule(site, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
2469                     if (CallSiteOps.GetMatch(site)) {
2470                         return;
2471                     }
2472                 } finally {
2473                     if (CallSiteOps.GetMatch(site)) {
2474                         //
2475                         // Rule worked. Add it to level 1 cache
2476                         //
2477                         CallSiteOps.AddRule(@this, rule);
2478                         // and then move it to the front of the L2 cache
2479                         CallSiteOps.MoveRule(cache, rule, i);
2480                     }
2481                 }
2482
2483                 // Rule didn't match, try the next one
2484                 CallSiteOps.ClearMatch(site);
2485             }
2486
2487             //
2488             // Miss on Level 0, 1 and 2 caches. Create new rule
2489             //
2490
2491             rule = null;
2492             var args = new object[] { arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8 };
2493
2494             for (; ; ) {
2495                 @this.Target = originalRule;
2496                 rule = @this.Target = @this.Binder.BindCore(@this, args);
2497
2498                 //
2499                 // Execute the rule on the matchmaker site
2500                 //
2501
2502                 try {
2503                      rule(site, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
2504                     if (CallSiteOps.GetMatch(site)) {
2505                         return;
2506                     }
2507                 } finally {
2508                     if (CallSiteOps.GetMatch(site)) {
2509                         //
2510                         // The rule worked. Add it to level 1 cache.
2511                         //
2512                         CallSiteOps.AddRule(@this, rule);
2513                     }
2514                 }
2515
2516                 // Rule we got back didn't work, try another one
2517                 CallSiteOps.ClearMatch(site);
2518             }
2519         }
2520
2521         [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
2522         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")]
2523         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) {
2524             site._match = false;
2525             return;
2526         }
2527
2528
2529
2530         [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
2531         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) {
2532             //
2533             // Declare the locals here upfront. It actually saves JIT stack space.
2534             //
2535             var @this = (CallSite<Action<CallSite, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>>)site;
2536             Action<CallSite, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>[] applicable;
2537             Action<CallSite, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> rule, originalRule = @this.Target;
2538
2539
2540             //
2541             // Create matchmaker and its site. We'll need them regardless.
2542             //
2543             site = CallSiteOps.CreateMatchmaker(@this);
2544
2545             //
2546             // Level 1 cache lookup
2547             //
2548             if ((applicable = CallSiteOps.GetRules(@this)) != null) {
2549                 for (int i = 0; i < applicable.Length; i++) {
2550                     rule = applicable[i];
2551
2552                     //
2553                     // Execute the rule
2554                     //
2555
2556                     // if we've already tried it skip it...
2557                     if ((object)rule != (object)originalRule) {
2558                         @this.Target = rule;
2559                          rule(site, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
2560
2561                         if (CallSiteOps.GetMatch(site)) {
2562                             CallSiteOps.UpdateRules(@this, i);
2563                             return;
2564                         }        
2565
2566                         // Rule didn't match, try the next one
2567                         CallSiteOps.ClearMatch(site);            
2568                     }
2569                 }
2570             }
2571
2572             //
2573             // Level 2 cache lookup
2574             //
2575
2576             //
2577             // Any applicable rules in level 2 cache?
2578             //
2579
2580             var cache = CallSiteOps.GetRuleCache(@this);
2581
2582             applicable = cache.GetRules();
2583             for (int i = 0; i < applicable.Length; i++) {
2584                 rule = applicable[i];
2585
2586                 //
2587                 // Execute the rule
2588                 //
2589                 @this.Target = rule;
2590
2591                 try {
2592                      rule(site, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
2593                     if (CallSiteOps.GetMatch(site)) {
2594                         return;
2595                     }
2596                 } finally {
2597                     if (CallSiteOps.GetMatch(site)) {
2598                         //
2599                         // Rule worked. Add it to level 1 cache
2600                         //
2601                         CallSiteOps.AddRule(@this, rule);
2602                         // and then move it to the front of the L2 cache
2603                         CallSiteOps.MoveRule(cache, rule, i);
2604                     }
2605                 }
2606
2607                 // Rule didn't match, try the next one
2608                 CallSiteOps.ClearMatch(site);
2609             }
2610
2611             //
2612             // Miss on Level 0, 1 and 2 caches. Create new rule
2613             //
2614
2615             rule = null;
2616             var args = new object[] { arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9 };
2617
2618             for (; ; ) {
2619                 @this.Target = originalRule;
2620                 rule = @this.Target = @this.Binder.BindCore(@this, args);
2621
2622                 //
2623                 // Execute the rule on the matchmaker site
2624                 //
2625
2626                 try {
2627                      rule(site, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
2628                     if (CallSiteOps.GetMatch(site)) {
2629                         return;
2630                     }
2631                 } finally {
2632                     if (CallSiteOps.GetMatch(site)) {
2633                         //
2634                         // The rule worked. Add it to level 1 cache.
2635                         //
2636                         CallSiteOps.AddRule(@this, rule);
2637                     }
2638                 }
2639
2640                 // Rule we got back didn't work, try another one
2641                 CallSiteOps.ClearMatch(site);
2642             }
2643         }
2644
2645         [Obsolete("pregenerated CallSite<T>.Update delegate", true)]
2646         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")]
2647         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) {
2648             site._match = false;
2649             return;
2650         }
2651
2652
2653
2654         // *** END GENERATED CODE ***
2655
2656         #endregion
2657     }
2658 }