Chromium Code Reviews| Index: test/mjsunit/external-array.js |
| diff --git a/test/mjsunit/external-array.js b/test/mjsunit/external-array.js |
| index 72cfd8595638dce1e9e8f090e322d82b4984934b..15ff8e7caa7669a3ea168681e8d027543c0cc080 100644 |
| --- a/test/mjsunit/external-array.js |
| +++ b/test/mjsunit/external-array.js |
| @@ -317,3 +317,43 @@ for (var t = 0; t < types.length; t++) { |
| %DeoptimizeFunction(array_load_set_smi_check2); |
| gc(); // Makes V8 forget about type information for array_load_set_smi_check. |
| } |
| + |
| +// Check handling of undefined in 32- and 64-bit external float arrays. |
| + |
| +function store_float32_undefined(ext_array) { |
| + for (var i = 0; i < 8; i++) { |
|
Michael Starzinger
2012/02/15 13:39:29
Is there a particular reason the assignment has to
danno
2012/02/16 07:55:40
Done.
|
| + ext_array[7] = undefined; |
| + } |
| +} |
| + |
| +var float32_array = new Float32Array(8); |
| +// Make sure runtime does it right |
| +store_float32_undefined(float32_array); |
| +assertTrue(isNaN(float32_array[7])); |
| +// Make sure the ICs do it right |
| +store_float32_undefined(float32_array); |
| +assertTrue(isNaN(float32_array[7])); |
| +// Make sure that Cranskshft does it right. |
| +%OptimizeFunctionOnNextCall(store_float32_undefined); |
| +store_float32_undefined(float32_array); |
| +store_float32_undefined(float32_array); |
|
Michael Starzinger
2012/02/15 13:39:29
Is there a particular reason the store function is
danno
2012/02/16 07:55:40
Done.
|
| +assertTrue(isNaN(float32_array[7])); |
| + |
| +function store_float64_undefined(ext_array) { |
| + for (var i = 0; i < 8; i++) { |
|
Michael Starzinger
2012/02/15 13:39:29
Likewise.
danno
2012/02/16 07:55:40
Done.
|
| + ext_array[7] = undefined; |
| + } |
| +} |
| + |
| +var float64_array = new Float64Array(8); |
| +// Make sure runtime does it right |
| +store_float64_undefined(float64_array); |
| +assertTrue(isNaN(float64_array[7])); |
| +// Make sure the ICs do it right |
| +store_float64_undefined(float64_array); |
| +assertTrue(isNaN(float64_array[7])); |
| +// Make sure that Cranskshft does it right. |
| +%OptimizeFunctionOnNextCall(store_float64_undefined); |
| +store_float64_undefined(float64_array); |
| +store_float64_undefined(float64_array); |
|
Michael Starzinger
2012/02/15 13:39:29
Likewise.
danno
2012/02/16 07:55:40
Done.
|
| +assertTrue(isNaN(float64_array[7])); |