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