Deprecate WebKit2 plug-in support.
[WebKit-https.git] / JSTests / slowMicrobenchmarks / bigswitch-indirect-symbol-or-undefined.js
1 var thing0 = Symbol();
2 var thing1 = Symbol();
3 var thing2 = Symbol();
4 var thing3 = Symbol();
5 var thing4 = Symbol();
6 var thing5 = Symbol();
7 var thing6 = Symbol();
8 var thing7 = Symbol();
9 var thing8 = Symbol();
10 var thing9 = Symbol();
11 var thing10 = Symbol();
12 var thing11 = Symbol();
13 var thing12 = Symbol();
14 var thing13 = Symbol();
15 var thing14 = Symbol();
16 var thing15 = Symbol();
17 var thing16 = Symbol();
18 var thing17 = Symbol();
19 var thing18 = Symbol();
20 var thing19 = Symbol();
21 var thing20 = Symbol();
22 var thing21 = Symbol();
23 var thing22 = Symbol();
24 var thing23 = Symbol();
25 var thing24 = Symbol();
26 var thing25 = Symbol();
27 var thing26 = Symbol();
28 var thing27 = Symbol();
29 var thing28 = Symbol();
30 var thing29 = Symbol();
31 var thing30 = Symbol();
32 var thing31 = Symbol();
33 var thing32 = Symbol();
34 var thing33 = Symbol();
35 var thing34 = Symbol();
36 var thing35 = Symbol();
37 var thing36 = Symbol();
38 var thing37 = Symbol();
39 var thing38 = Symbol();
40 var thing39 = Symbol();
41 var thing40 = Symbol();
42 var thing41 = Symbol();
43 var thing42 = Symbol();
44 var thing43 = Symbol();
45 var thing44 = Symbol();
46 var thing45 = Symbol();
47 var thing46 = Symbol();
48 var thing47 = Symbol();
49 var thing48 = Symbol();
50 var thing49 = Symbol();
51 var thing50 = Symbol();
52 var thing51 = Symbol();
53 var thing52 = Symbol();
54 var thing53 = Symbol();
55 var thing54 = Symbol();
56 var thing55 = Symbol();
57 var thing56 = Symbol();
58 var thing57 = Symbol();
59 var thing58 = Symbol();
60 var thing59 = Symbol();
61 var thing60 = Symbol();
62 var thing61 = Symbol();
63 var thing62 = Symbol();
64
65 var things = [];
66 for (var i = 0; i < 63; ++i)
67     things.push(eval("thing" + i));
68
69 function foo(o) {
70     var result = 0;
71     for (var i = 0; i < 1000; ++i) {
72         var value = things[i & 63];
73         switch (value) {
74         case thing0:
75             result += o.a;
76             break;
77         case thing1:
78             result += o.b;
79             break;
80         case thing2:
81             result += o.c;
82             break;
83         case thing3:
84             result += o.d;
85             break;
86         case thing4:
87             result += o.e;
88             break;
89         case thing5:
90             result += o.f;
91             break;
92         case thing6:
93             result += o.g;
94             break;
95         case thing7:
96             result += o.h;
97             break;
98         case thing8:
99             result += o.i;
100             break;
101         case thing9:
102             result += o.j;
103             break;
104         case thing10:
105             result += o.k;
106             break;
107         case thing11:
108             result += o.a;
109             break;
110         case thing12:
111             result += o.b;
112             break;
113         case thing13:
114             result += o.c;
115             break;
116         case thing14:
117             result += o.d;
118             break;
119         case thing15:
120             result += o.e;
121             break;
122         case thing16:
123             result += o.f;
124             break;
125         case thing17:
126             result += o.g;
127             break;
128         case thing18:
129             result += o.h;
130             break;
131         case thing19:
132             result += o.i;
133             break;
134         case thing20:
135             result += o.j;
136             break;
137         case thing21:
138             result += o.k;
139             break;
140         case thing22:
141             result += o.k;
142             break;
143         case thing23:
144             result += o.a;
145             break;
146         case thing24:
147             result += o.b;
148             break;
149         case thing25:
150             result += o.c;
151             break;
152         case thing26:
153             result += o.d;
154             break;
155         case thing27:
156             result += o.e;
157             break;
158         case thing28:
159             result += o.f;
160             break;
161         case thing29:
162             result += o.g;
163             break;
164         case thing30:
165             result += o.h;
166             break;
167         case thing31:
168             result += o.i;
169             break;
170         case thing32:
171             result += o.j;
172             break;
173         case thing33:
174             result += o.k;
175             break;
176         case thing34:
177             result += o.k;
178             break;
179         case thing35:
180             result += o.k;
181             break;
182         case thing36:
183             result += o.a;
184             break;
185         case thing37:
186             result += o.b;
187             break;
188         case thing38:
189             result += o.c;
190             break;
191         case thing39:
192             result += o.d;
193             break;
194         case thing40:
195             result += o.e;
196             break;
197         case thing41:
198             result += o.f;
199             break;
200         case thing42:
201             result += o.g;
202             break;
203         case thing43:
204             result += o.h;
205             break;
206         case thing44:
207             result += o.i;
208             break;
209         case thing45:
210             result += o.j;
211             break;
212         case thing46:
213             result += o.k;
214             break;
215         case thing47:
216             result += o.i;
217             break;
218         case thing48:
219             result += o.j;
220             break;
221         case thing49:
222             result += o.k;
223             break;
224         case thing50:
225             result += o.k;
226             break;
227         case thing51:
228             result += o.k;
229             break;
230         case thing52:
231             result += o.a;
232             break;
233         case thing53:
234             result += o.b;
235             break;
236         case thing54:
237             result += o.c;
238             break;
239         case thing55:
240             result += o.d;
241             break;
242         case thing56:
243             result += o.e;
244             break;
245         case thing57:
246             result += o.f;
247             break;
248         case thing58:
249             result += o.g;
250             break;
251         case thing59:
252             result += o.h;
253             break;
254         case thing60:
255             result += o.i;
256             break;
257         case thing61:
258             result += o.j;
259             break;
260         case thing62:
261             result += o.k;
262             break;
263         default:
264             result += o.z;
265             break;
266         }
267     }
268     return result;
269 }
270
271 (function() {
272     var o = {a:1, b:2, c:3, d:4, e:5, f:6, g:7, h:8, i:9, j:10, k:11, z:100};
273     var result = 0;
274     for (var i = 0; i < 1000; ++i)
275         result += foo(o);
276     if (result != 7966000)
277         throw "Error: bad result: " + result;
278 })();
279