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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 for (var i = 0; i < 1337; i++) { | 138 for (var i = 0; i < 1337; i++) { |
139 var val = i; | 139 var val = i; |
140 if (i == 1336) { | 140 if (i == 1336) { |
141 assertKind(elements_kind.fast_smi_only, you); | 141 assertKind(elements_kind.fast_smi_only, you); |
142 val = new Object(); | 142 val = new Object(); |
143 } | 143 } |
144 you[i] = val; | 144 you[i] = val; |
145 } | 145 } |
146 assertKind(elements_kind.fast, you); | 146 assertKind(elements_kind.fast, you); |
147 | 147 |
148 assertKind(elements_kind.dictionary, new Array(0xDECAF)); | 148 var temp = []; |
| 149 temp[0xDECAF] = 0; |
| 150 assertKind(elements_kind.dictionary, temp); |
149 | 151 |
150 var fast_double_array = new Array(0xDECAF); | 152 var fast_double_array = new Array(0xDECAF); |
151 for (var i = 0; i < 0xDECAF; i++) fast_double_array[i] = i / 2; | 153 for (var i = 0; i < 0xDECAF; i++) fast_double_array[i] = i / 2; |
152 assertKind(elements_kind.fast_double, fast_double_array); | 154 assertKind(elements_kind.fast_double, fast_double_array); |
153 | 155 |
154 assertKind(elements_kind.fixed_int8, new Int8Array(007)); | 156 assertKind(elements_kind.fixed_int8, new Int8Array(007)); |
155 assertKind(elements_kind.fixed_uint8, new Uint8Array(007)); | 157 assertKind(elements_kind.fixed_uint8, new Uint8Array(007)); |
156 assertKind(elements_kind.fixed_int16, new Int16Array(666)); | 158 assertKind(elements_kind.fixed_int16, new Int16Array(666)); |
157 assertKind(elements_kind.fixed_uint16, new Uint16Array(42)); | 159 assertKind(elements_kind.fixed_uint16, new Uint16Array(42)); |
158 assertKind(elements_kind.fixed_int32, new Int32Array(0xF)); | 160 assertKind(elements_kind.fixed_int32, new Int32Array(0xF)); |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 // Test that Array.splice() and Array.slice() return correct ElementsKinds. | 377 // Test that Array.splice() and Array.slice() return correct ElementsKinds. |
376 var a = ["foo", "bar"]; | 378 var a = ["foo", "bar"]; |
377 assertKind(elements_kind.fast, a); | 379 assertKind(elements_kind.fast, a); |
378 var b = a.splice(0, 1); | 380 var b = a.splice(0, 1); |
379 assertKind(elements_kind.fast, b); | 381 assertKind(elements_kind.fast, b); |
380 var c = a.slice(0, 1); | 382 var c = a.slice(0, 1); |
381 assertKind(elements_kind.fast, c); | 383 assertKind(elements_kind.fast, c); |
382 | 384 |
383 // Throw away type information in the ICs for next stress run. | 385 // Throw away type information in the ICs for next stress run. |
384 gc(); | 386 gc(); |
OLD | NEW |