OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 // Flags: --allow-natives-syntax |
| 6 |
| 7 // Make sure printing different element kinds doesn't crash. |
| 8 |
| 9 var array; |
| 10 var obj = {}; |
| 11 |
| 12 array = []; |
| 13 %DebugPrint(array); |
| 14 |
| 15 // FAST_SMI_ELEMENTS |
| 16 array = [1, 2, 3]; |
| 17 %DebugPrint(array); |
| 18 |
| 19 // FAST_HOLEY_SMI_ELEMENTS |
| 20 array[10] = 100; |
| 21 array[11] = 100; |
| 22 %DebugPrint(array); |
| 23 |
| 24 // FAST_ELEMENTS |
| 25 array = [1, obj, obj]; |
| 26 %DebugPrint(array); |
| 27 |
| 28 // FAST_HOLEY_ELEMENTS |
| 29 array[100] = obj; |
| 30 array[101] = obj; |
| 31 %DebugPrint(array); |
| 32 |
| 33 // FAST_DOUBLE_ELEMENTS |
| 34 array = [1.1, 2.2, 3.3, 3.3, 3.3, NaN]; |
| 35 %DebugPrint(array); |
| 36 array.push(NaN); |
| 37 array.push(NaN); |
| 38 %DebugPrint(array); |
| 39 |
| 40 // FAST_HOLEY_DOUBLE_ELEMENTS |
| 41 array[100] = 1.2; |
| 42 array[101] = 1.2; |
| 43 %DebugPrint(array); |
| 44 |
| 45 // DICTIONARY_ELEMENTS |
| 46 %NormalizeElements(array); |
| 47 %DebugPrint(array); |
OLD | NEW |