OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 |
11 // with the distribution. | 11 // with the distribution. |
12 // * Neither the name of Google Inc. nor the names of its | 12 // * Neither the name of Google Inc. nor the names of its |
13 // contributors may be used to endorse or promote products derived | 13 // contributors may be used to endorse or promote products derived |
14 // from this software without specific prior written permission. | 14 // from this software without specific prior written permission. |
15 // | 15 // |
16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | 16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
17 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | 17 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
18 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | 18 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
19 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | 19 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
20 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 20 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | 27 |
28 // Test dictionary -> double elements -> dictionary elements round trip | 28 // Test dictionary -> double elements -> dictionary elements round trip |
29 | 29 |
30 // Flags: --allow-natives-syntax --unbox-double-arrays | 30 // Flags: --allow-natives-syntax --unbox-double-arrays --expose-gc |
31 var large_array_size = 500000; | 31 var large_array_size = 500000; |
32 var approx_dict_to_elements_threshold = 69000; | 32 var approx_dict_to_elements_threshold = 69000; |
33 | 33 |
| 34 var name = 0; |
| 35 |
34 function expected_array_value(i) { | 36 function expected_array_value(i) { |
35 if ((i % 2) == 0) { | 37 if ((i % 2) == 0) { |
36 return i; | 38 return i; |
37 } else { | 39 } else { |
38 return i + 0.5; | 40 return i + 0.5; |
39 } | 41 } |
40 } | 42 } |
41 | 43 |
42 function force_to_fast_double_array(a) { | 44 function force_to_fast_double_array(a) { |
43 for (var i= 0; i < approx_dict_to_elements_threshold; ++i ) { | 45 for (var i= 0; i < approx_dict_to_elements_threshold; ++i ) { |
44 a[i] = expected_array_value(i); | 46 a[i] = expected_array_value(i); |
45 } | 47 } |
46 assertTrue(%HasFastDoubleElements(a)); | 48 assertTrue(%HasFastDoubleElements(a)); |
47 } | 49 } |
48 | 50 |
49 function testOneArrayType(allocator) { | 51 function testOneArrayType(allocator) { |
50 var large_array = new allocator(500000); | 52 var large_array = new allocator(500000); |
51 force_to_fast_double_array(large_array); | 53 force_to_fast_double_array(large_array); |
| 54 var six = 6; |
52 | 55 |
53 for (var i= 0; i < approx_dict_to_elements_threshold; i += 501 ) { | 56 for (var i= 0; i < approx_dict_to_elements_threshold; i += 501 ) { |
54 assertEquals(expected_array_value(i), large_array[i]); | 57 assertEquals(expected_array_value(i), large_array[i]); |
55 } | 58 } |
56 | 59 |
57 function get_test_various_loads() { | 60 // This function has a constant and won't get inlined. |
58 return function test_various_loads(a, value_5, value_6, value_7) { | 61 function computed_6() { |
59 assertTrue(%HasFastDoubleElements(a)); | 62 return six; |
60 assertEquals(value_5, a[5]); | |
61 assertEquals(value_6, a[6]); | |
62 assertEquals(value_7, a[7]); | |
63 assertEquals(undefined, a[large_array_size-1]); | |
64 assertEquals(undefined, a[-1]); | |
65 assertEquals(large_array_size, a.length); | |
66 assertTrue(%HasFastDoubleElements(a)); | |
67 } | |
68 } | 63 } |
69 | 64 |
70 function get_test_various_stores() { | 65 // Multiple versions of the test function makes sure that IC/Crankshaft state |
71 return function test_various_stores(a, value_5, value_6, value_7) { | 66 // doesn't get reused. |
72 assertTrue(%HasFastDoubleElements(a)); | 67 function test_various_loads(a, value_5, value_6, value_7) { |
73 a[5] = value_5; | 68 assertTrue(%HasFastDoubleElements(a)); |
74 a[6] = value_6; | 69 assertEquals(value_5, a[5]); |
75 a[7] = value_7; | 70 assertEquals(value_6, a[6]); |
76 assertTrue(%HasFastDoubleElements(a)); | 71 assertEquals(value_6, a[computed_6()]); // Test non-constant key |
77 } | 72 assertEquals(value_7, a[7]); |
| 73 assertEquals(undefined, a[large_array_size-1]); |
| 74 assertEquals(undefined, a[-1]); |
| 75 assertEquals(large_array_size, a.length); |
| 76 assertTrue(%HasFastDoubleElements(a)); |
78 } | 77 } |
79 | 78 |
80 // Run tests up to three times to make sure both runtime and IC implementation | 79 function test_various_loads2(a, value_5, value_6, value_7) { |
81 // (premonomorphic and monomorphic) of KeyedLoad access works in various | 80 assertTrue(%HasFastDoubleElements(a)); |
82 // cases. | 81 assertEquals(value_5, a[5]); |
| 82 assertEquals(value_6, a[6]); |
| 83 assertEquals(value_6, a[computed_6()]); // Test non-constant key |
| 84 assertEquals(value_7, a[7]); |
| 85 assertEquals(undefined, a[large_array_size-1]); |
| 86 assertEquals(undefined, a[-1]); |
| 87 assertEquals(large_array_size, a.length); |
| 88 assertTrue(%HasFastDoubleElements(a)); |
| 89 } |
| 90 |
| 91 function test_various_loads3(a, value_5, value_6, value_7) { |
| 92 assertTrue(%HasFastDoubleElements(a)); |
| 93 assertEquals(value_5, a[5]); |
| 94 assertEquals(value_6, a[6]); |
| 95 assertEquals(value_6, a[computed_6()]); // Test non-constant key |
| 96 assertEquals(value_7, a[7]); |
| 97 assertEquals(undefined, a[large_array_size-1]); |
| 98 assertEquals(undefined, a[-1]); |
| 99 assertEquals(large_array_size, a.length); |
| 100 assertTrue(%HasFastDoubleElements(a)); |
| 101 } |
| 102 |
| 103 function test_various_loads4(a, value_5, value_6, value_7) { |
| 104 assertTrue(%HasFastDoubleElements(a)); |
| 105 assertEquals(value_5, a[5]); |
| 106 assertEquals(value_6, a[6]); |
| 107 assertEquals(value_6, a[computed_6()]); // Test non-constant key |
| 108 assertEquals(value_7, a[7]); |
| 109 assertEquals(undefined, a[large_array_size-1]); |
| 110 assertEquals(undefined, a[-1]); |
| 111 assertEquals(large_array_size, a.length); |
| 112 assertTrue(%HasFastDoubleElements(a)); |
| 113 } |
| 114 |
| 115 function test_various_loads5(a, value_5, value_6, value_7) { |
| 116 assertTrue(%HasFastDoubleElements(a)); |
| 117 assertEquals(value_5, a[5]); |
| 118 assertEquals(value_6, a[6]); |
| 119 assertEquals(value_6, a[computed_6()]); // Test non-constant key |
| 120 assertEquals(value_7, a[7]); |
| 121 assertEquals(undefined, a[large_array_size-1]); |
| 122 assertEquals(undefined, a[-1]); |
| 123 assertEquals(large_array_size, a.length); |
| 124 assertTrue(%HasFastDoubleElements(a)); |
| 125 } |
| 126 |
| 127 function test_various_loads6(a, value_5, value_6, value_7) { |
| 128 assertTrue(%HasFastDoubleElements(a)); |
| 129 assertEquals(value_5, a[5]); |
| 130 assertEquals(value_6, a[6]); |
| 131 assertEquals(value_6, a[computed_6()]); // Test non-constant key |
| 132 assertEquals(value_7, a[7]); |
| 133 assertEquals(undefined, a[large_array_size-1]); |
| 134 assertEquals(undefined, a[-1]); |
| 135 assertEquals(large_array_size, a.length); |
| 136 assertTrue(%HasFastDoubleElements(a)); |
| 137 } |
| 138 |
| 139 function test_various_stores(a, value_5, value_6, value_7) { |
| 140 assertTrue(%HasFastDoubleElements(a)); |
| 141 a[5] = value_5; |
| 142 a[computed_6()] = value_6; |
| 143 a[7] = value_7; |
| 144 assertTrue(%HasFastDoubleElements(a)); |
| 145 } |
83 | 146 |
84 // Test double and integer values | 147 // Test double and integer values |
85 test_various_loads = get_test_various_loads(); | |
86 test_various_loads(large_array, | 148 test_various_loads(large_array, |
87 expected_array_value(5), | 149 expected_array_value(5), |
88 expected_array_value(6), | 150 expected_array_value(6), |
89 expected_array_value(7)); | 151 expected_array_value(7)); |
90 test_various_loads(large_array, | 152 test_various_loads(large_array, |
91 expected_array_value(5), | 153 expected_array_value(5), |
92 expected_array_value(6), | 154 expected_array_value(6), |
93 expected_array_value(7)); | 155 expected_array_value(7)); |
94 test_various_loads(large_array, | 156 test_various_loads(large_array, |
95 expected_array_value(5), | 157 expected_array_value(5), |
96 expected_array_value(6), | 158 expected_array_value(6), |
97 expected_array_value(7)); | 159 expected_array_value(7)); |
| 160 %OptimizeFunctionOnNextCall(test_various_loads); |
| 161 test_various_loads(large_array, |
| 162 expected_array_value(5), |
| 163 expected_array_value(6), |
| 164 expected_array_value(7)); |
98 | 165 |
99 // Test NaN values | 166 // Test NaN values |
100 test_various_stores = get_test_various_stores(); | |
101 test_various_stores(large_array, NaN, -NaN, expected_array_value(7)); | 167 test_various_stores(large_array, NaN, -NaN, expected_array_value(7)); |
102 | 168 |
103 test_various_loads(large_array, | 169 test_various_loads2(large_array, |
104 NaN, | 170 NaN, |
105 -NaN, | 171 -NaN, |
106 expected_array_value(7)); | 172 expected_array_value(7)); |
107 test_various_loads(large_array, | 173 test_various_loads2(large_array, |
108 NaN, | 174 NaN, |
109 -NaN, | 175 -NaN, |
110 expected_array_value(7)); | 176 expected_array_value(7)); |
111 test_various_loads(large_array, | 177 test_various_loads2(large_array, |
112 NaN, | 178 NaN, |
113 -NaN, | 179 -NaN, |
114 expected_array_value(7)); | 180 expected_array_value(7)); |
| 181 %OptimizeFunctionOnNextCall(test_various_loads2); |
| 182 test_various_loads2(large_array, |
| 183 NaN, |
| 184 -NaN, |
| 185 expected_array_value(7)); |
115 | 186 |
116 // Test Infinity values | 187 // Test Infinity values |
117 test_various_stores = get_test_various_stores(); | |
118 test_various_stores(large_array, | 188 test_various_stores(large_array, |
119 Infinity, | 189 Infinity, |
120 -Infinity, | 190 -Infinity, |
121 expected_array_value(7)); | 191 expected_array_value(7)); |
122 | 192 |
123 test_various_loads(large_array, | 193 test_various_loads3(large_array, |
124 Infinity, | 194 Infinity, |
125 -Infinity, | 195 -Infinity, |
126 expected_array_value(7)); | 196 expected_array_value(7)); |
127 test_various_loads(large_array, | 197 test_various_loads3(large_array, |
128 Infinity, | 198 Infinity, |
129 -Infinity, | 199 -Infinity, |
130 expected_array_value(7)); | 200 expected_array_value(7)); |
131 test_various_loads(large_array, | 201 test_various_loads3(large_array, |
132 Infinity, | 202 Infinity, |
133 -Infinity, | 203 -Infinity, |
134 expected_array_value(7)); | 204 expected_array_value(7)); |
| 205 %OptimizeFunctionOnNextCall(test_various_loads3); |
| 206 test_various_loads3(large_array, |
| 207 Infinity, |
| 208 -Infinity, |
| 209 expected_array_value(7)); |
135 | 210 |
136 // Test the hole for the default runtime implementation. | 211 // Test the hole for the default runtime implementation. |
137 delete large_array[5]; | 212 delete large_array[5]; |
138 delete large_array[6]; | 213 delete large_array[6]; |
139 test_various_loads = get_test_various_loads(); | 214 test_various_loads4(large_array, |
140 test_various_loads(large_array, | 215 undefined, |
141 undefined, | 216 undefined, |
142 undefined, | 217 expected_array_value(7)); |
143 expected_array_value(7)); | |
144 | 218 |
145 // Test the keyed load IC implementation when the value is the hole. | 219 // Test the keyed load IC implementation when the value is the hole. |
146 test_various_loads = get_test_various_loads(); | |
147 test_various_stores(large_array, | 220 test_various_stores(large_array, |
148 expected_array_value(5), | 221 expected_array_value(5), |
149 expected_array_value(6), | 222 expected_array_value(6), |
150 expected_array_value(7)); | 223 expected_array_value(7)); |
151 test_various_loads(large_array, | 224 test_various_loads5(large_array, |
152 expected_array_value(5), | 225 expected_array_value(5), |
153 expected_array_value(6), | 226 expected_array_value(6), |
154 expected_array_value(7)); | 227 expected_array_value(7)); |
155 test_various_loads(large_array, | 228 test_various_loads5(large_array, |
156 expected_array_value(5), | 229 expected_array_value(5), |
157 expected_array_value(6), | 230 expected_array_value(6), |
158 expected_array_value(7)); | 231 expected_array_value(7)); |
159 delete large_array[5]; | 232 delete large_array[5]; |
160 delete large_array[6]; | 233 delete large_array[6]; |
161 test_various_loads(large_array, | 234 test_various_loads5(large_array, |
162 undefined, | 235 undefined, |
163 undefined, | 236 undefined, |
164 expected_array_value(7)); | 237 expected_array_value(7)); |
165 test_various_loads(large_array, | 238 test_various_loads5(large_array, |
166 undefined, | 239 undefined, |
167 undefined, | 240 undefined, |
168 expected_array_value(7)); | 241 expected_array_value(7)); |
169 | 242 |
170 // Test both runtime and IC variants of double array stores for normal | 243 // Make sure Crankshaft code handles the hole correctly (bailout) |
171 // values (double and integer). | |
172 test_various_stores = get_test_various_stores(); | |
173 test_various_stores(large_array, | |
174 expected_array_value(4), | |
175 expected_array_value(5), | |
176 expected_array_value(6)); | |
177 test_various_loads(large_array, | |
178 expected_array_value(4), | |
179 expected_array_value(5), | |
180 expected_array_value(6)); | |
181 test_various_stores(large_array, | 244 test_various_stores(large_array, |
182 expected_array_value(5), | 245 expected_array_value(5), |
183 expected_array_value(6), | 246 expected_array_value(6), |
184 expected_array_value(7)); | 247 expected_array_value(7)); |
185 test_various_loads(large_array, | 248 test_various_loads6(large_array, |
186 expected_array_value(5), | 249 expected_array_value(5), |
187 expected_array_value(6), | 250 expected_array_value(6), |
188 expected_array_value(7)); | 251 expected_array_value(7)); |
| 252 test_various_loads6(large_array, |
| 253 expected_array_value(5), |
| 254 expected_array_value(6), |
| 255 expected_array_value(7)); |
| 256 %OptimizeFunctionOnNextCall(test_various_loads6); |
| 257 test_various_loads6(large_array, |
| 258 expected_array_value(5), |
| 259 expected_array_value(6), |
| 260 expected_array_value(7)); |
189 | 261 |
190 // Test stores of NaN to make sure they don't get mistaken for the | 262 delete large_array[5]; |
191 // hole. Test both runtime and IC implementation. | 263 delete large_array[6]; |
192 test_various_stores = get_test_various_stores(); | 264 test_various_loads6(large_array, |
193 test_various_stores(large_array, | 265 undefined, |
194 NaN, | 266 undefined, |
195 -NaN, | 267 expected_array_value(7)); |
196 expected_array_value(6)); | 268 |
197 test_various_loads(large_array, | 269 // Test stores for non-NaN. |
198 NaN, | 270 %OptimizeFunctionOnNextCall(test_various_stores); |
199 -NaN, | |
200 expected_array_value(6)); | |
201 test_various_stores(large_array, | 271 test_various_stores(large_array, |
202 expected_array_value(5), | 272 expected_array_value(5), |
203 expected_array_value(6), | 273 expected_array_value(6), |
204 expected_array_value(7)); | 274 expected_array_value(7)); |
205 test_various_loads(large_array, | 275 |
206 expected_array_value(5), | 276 test_various_stores(large_array, |
207 expected_array_value(6), | 277 expected_array_value(5), |
208 expected_array_value(7)); | 278 expected_array_value(6), |
| 279 expected_array_value(7)); |
| 280 |
| 281 test_various_loads6(large_array, |
| 282 expected_array_value(5), |
| 283 expected_array_value(6), |
| 284 expected_array_value(7)); |
| 285 |
| 286 // Test NaN behavior for stores. |
209 test_various_stores(large_array, | 287 test_various_stores(large_array, |
210 NaN, | 288 NaN, |
211 -NaN, | 289 -NaN, |
212 expected_array_value(7)); | 290 expected_array_value(7)); |
213 test_various_loads(large_array, | 291 |
| 292 test_various_stores(large_array, |
214 NaN, | 293 NaN, |
215 -NaN, | 294 -NaN, |
216 expected_array_value(7)); | 295 expected_array_value(7)); |
217 | 296 |
218 // Test stores of Infinity to make sure they don't get mistaken for the | 297 test_various_loads6(large_array, |
219 // hole. Test both runtime and IC implementation. | 298 NaN, |
220 test_various_stores = get_test_various_stores(); | 299 -NaN, |
221 test_various_stores(large_array, | |
222 Infinity, | |
223 -Infinity, | |
224 expected_array_value(6)); | |
225 test_various_loads(large_array, | |
226 Infinity, | |
227 -Infinity, | |
228 expected_array_value(6)); | |
229 test_various_stores(large_array, | |
230 expected_array_value(5), | |
231 expected_array_value(6), | |
232 expected_array_value(7)); | 300 expected_array_value(7)); |
233 test_various_loads(large_array, | 301 |
234 expected_array_value(5), | 302 // Test Infinity behavior for stores. |
235 expected_array_value(6), | |
236 expected_array_value(7)); | |
237 test_various_stores(large_array, | 303 test_various_stores(large_array, |
238 Infinity, | 304 Infinity, |
239 -Infinity, | 305 -Infinity, |
240 expected_array_value(7)); | 306 expected_array_value(7)); |
241 test_various_loads(large_array, | 307 |
| 308 test_various_stores(large_array, |
242 Infinity, | 309 Infinity, |
243 -Infinity, | 310 -Infinity, |
244 expected_array_value(7)); | 311 expected_array_value(7)); |
245 | 312 |
246 delete large_array[5]; | 313 test_various_loads6(large_array, |
| 314 Infinity, |
| 315 -Infinity, |
| 316 expected_array_value(7)); |
| 317 |
| 318 assertTrue(%GetOptimizationStatus(test_various_stores) != 2); |
247 | 319 |
248 // Make sure that we haven't converted from fast double. | 320 // Make sure that we haven't converted from fast double. |
249 assertTrue(%HasFastDoubleElements(large_array)); | 321 assertTrue(%HasFastDoubleElements(large_array)); |
250 // Cause the array to grow beyond it's JSArray length. This will double the | 322 // Cause the array to grow beyond it's JSArray length. This will double the |
251 // size of the capacity and force the array into "slow" dictionary case. | 323 // size of the capacity and force the array into "slow" dictionary case. |
252 large_array[large_array_size+1] = 50; | 324 large_array[large_array_size+1] = 50; |
253 assertTrue(%HasDictionaryElements(large_array)); | 325 assertTrue(%HasDictionaryElements(large_array)); |
254 assertEquals(50, large_array[large_array_size+1]); | 326 assertEquals(50, large_array[large_array_size+1]); |
255 assertEquals(large_array_size+2, large_array.length); | 327 assertEquals(large_array_size+2, large_array.length); |
256 assertEquals(undefined, large_array[5]); | 328 assertEquals(Infinity, large_array[5]); |
257 assertEquals(undefined, large_array[large_array_size-1]); | 329 assertEquals(undefined, large_array[large_array_size-1]); |
258 assertEquals(undefined, large_array[-1]); | 330 assertEquals(undefined, large_array[-1]); |
259 assertEquals(large_array_size+2, large_array.length); | 331 assertEquals(large_array_size+2, large_array.length); |
260 | 332 |
261 // Test dictionary -> double elements -> fast elements. | 333 // Test dictionary -> double elements -> fast elements. |
262 var large_array2 = new allocator(large_array_size); | 334 var large_array2 = new allocator(large_array_size); |
263 force_to_fast_double_array(large_array2); | 335 force_to_fast_double_array(large_array2); |
264 delete large_array2[5]; | 336 delete large_array2[5]; |
265 | 337 |
266 // Convert back to fast elements and make sure the contents of the array are | 338 // Convert back to fast elements and make sure the contents of the array are |
267 // unchanged. | 339 // unchanged. |
268 large_array2[25] = new Object(); | 340 large_array2[25] = new Object(); |
269 assertTrue(%HasFastElements(large_array2)); | 341 assertTrue(%HasFastElements(large_array2)); |
270 for (var i= 0; i < approx_dict_to_elements_threshold; i += 500 ) { | 342 for (var i= 0; i < approx_dict_to_elements_threshold; i += 500 ) { |
271 if (i != 25 && i != 5) { | 343 if (i != 25 && i != 5) { |
272 assertEquals(expected_array_value(i), large_array2[i]); | 344 assertEquals(expected_array_value(i), large_array2[i]); |
273 } | 345 } |
274 } | 346 } |
275 assertEquals(undefined, large_array2[5]) | 347 assertEquals(undefined, large_array2[5]) |
276 assertEquals(undefined, large_array2[large_array_size-1]) | 348 assertEquals(undefined, large_array2[large_array_size-1]) |
277 assertEquals(undefined, large_array2[-1]) | 349 assertEquals(undefined, large_array2[-1]) |
278 assertEquals(large_array_size, large_array2.length); | 350 assertEquals(large_array_size, large_array2.length); |
279 } | 351 } |
280 | 352 |
281 testOneArrayType(Array); | 353 testOneArrayType(Array); |
OLD | NEW |