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 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 return a[0] = a[0] = 1; | 310 return a[0] = a[0] = 1; |
311 } | 311 } |
312 | 312 |
313 array_load_set_smi_check2(a); | 313 array_load_set_smi_check2(a); |
314 %OptimizeFunctionOnNextCall(array_load_set_smi_check2); | 314 %OptimizeFunctionOnNextCall(array_load_set_smi_check2); |
315 array_load_set_smi_check2(a); | 315 array_load_set_smi_check2(a); |
316 array_load_set_smi_check2(0); | 316 array_load_set_smi_check2(0); |
317 %DeoptimizeFunction(array_load_set_smi_check2); | 317 %DeoptimizeFunction(array_load_set_smi_check2); |
318 gc(); // Makes V8 forget about type information for array_load_set_smi_check. | 318 gc(); // Makes V8 forget about type information for array_load_set_smi_check. |
319 } | 319 } |
| 320 |
| 321 // Check handling of undefined in 32- and 64-bit external float arrays. |
| 322 |
| 323 function store_float32_undefined(ext_array) { |
| 324 ext_array[0] = undefined; |
| 325 } |
| 326 |
| 327 var float32_array = new Float32Array(1); |
| 328 // Make sure runtime does it right |
| 329 store_float32_undefined(float32_array); |
| 330 assertTrue(isNaN(float32_array[0])); |
| 331 // Make sure the ICs do it right |
| 332 store_float32_undefined(float32_array); |
| 333 assertTrue(isNaN(float32_array[0])); |
| 334 // Make sure that Cranskshft does it right. |
| 335 %OptimizeFunctionOnNextCall(store_float32_undefined); |
| 336 store_float32_undefined(float32_array); |
| 337 assertTrue(isNaN(float32_array[0])); |
| 338 |
| 339 function store_float64_undefined(ext_array) { |
| 340 ext_array[0] = undefined; |
| 341 } |
| 342 |
| 343 var float64_array = new Float64Array(1); |
| 344 // Make sure runtime does it right |
| 345 store_float64_undefined(float64_array); |
| 346 assertTrue(isNaN(float64_array[0])); |
| 347 // Make sure the ICs do it right |
| 348 store_float64_undefined(float64_array); |
| 349 assertTrue(isNaN(float64_array[0])); |
| 350 // Make sure that Cranskshft does it right. |
| 351 %OptimizeFunctionOnNextCall(store_float64_undefined); |
| 352 store_float64_undefined(float64_array); |
| 353 assertTrue(isNaN(float64_array[0])); |
OLD | NEW |