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