OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 157 matching lines...) Loading... |
168 return literal; | 168 return literal; |
169 } | 169 } |
170 | 170 |
171 obj = fastliteralcase_smifast(1); | 171 obj = fastliteralcase_smifast(1); |
172 assertKind(elements_kind.fast_smi_only, obj); | 172 assertKind(elements_kind.fast_smi_only, obj); |
173 obj = fastliteralcase_smifast("carter"); | 173 obj = fastliteralcase_smifast("carter"); |
174 assertKind(elements_kind.fast, obj); | 174 assertKind(elements_kind.fast, obj); |
175 obj = fastliteralcase_smifast(2); | 175 obj = fastliteralcase_smifast(2); |
176 assertKind(elements_kind.fast, obj); | 176 assertKind(elements_kind.fast, obj); |
177 | 177 |
| 178 // Case: make sure transitions from packed to holey are tracked |
| 179 function fastliteralcase_smiholey(index, value) { |
| 180 var literal = [1, 2, 3, 4]; |
| 181 literal[index] = value; |
| 182 return literal; |
| 183 } |
| 184 |
| 185 obj = fastliteralcase_smiholey(5, 1); |
| 186 assertKind(elements_kind.fast_smi_only, obj); |
| 187 assertHoley(obj); |
| 188 obj = fastliteralcase_smiholey(0, 1); |
| 189 assertKind(elements_kind.fast_smi_only, obj); |
| 190 assertHoley(obj); |
| 191 |
178 function newarraycase_smidouble(value) { | 192 function newarraycase_smidouble(value) { |
179 var a = new Array(); | 193 var a = new Array(); |
180 a[0] = value; | 194 a[0] = value; |
181 return a; | 195 return a; |
182 } | 196 } |
183 | 197 |
184 // Case: new Array() as allocation site, smi->double | 198 // Case: new Array() as allocation site, smi->double |
185 obj = newarraycase_smidouble(1); | 199 obj = newarraycase_smidouble(1); |
186 assertKind(elements_kind.fast_smi_only, obj); | 200 assertKind(elements_kind.fast_smi_only, obj); |
187 obj = newarraycase_smidouble(1.5); | 201 obj = newarraycase_smidouble(1.5); |
(...skipping 145 matching lines...) Loading... |
333 %ClearFunctionTypeFeedback(instanceof_check); | 347 %ClearFunctionTypeFeedback(instanceof_check); |
334 instanceof_check(Array); | 348 instanceof_check(Array); |
335 instanceof_check(Array); | 349 instanceof_check(Array); |
336 %OptimizeFunctionOnNextCall(instanceof_check); | 350 %OptimizeFunctionOnNextCall(instanceof_check); |
337 instanceof_check(Array); | 351 instanceof_check(Array); |
338 assertTrue(2 != %GetOptimizationStatus(instanceof_check)); | 352 assertTrue(2 != %GetOptimizationStatus(instanceof_check)); |
339 | 353 |
340 instanceof_check(realmBArray); | 354 instanceof_check(realmBArray); |
341 assertTrue(1 != %GetOptimizationStatus(instanceof_check)); | 355 assertTrue(1 != %GetOptimizationStatus(instanceof_check)); |
342 } | 356 } |
OLD | NEW |