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 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.
| |
325 ext_array[7] = undefined; | |
326 } | |
327 } | |
328 | |
329 var float32_array = new Float32Array(8); | |
330 // Make sure runtime does it right | |
331 store_float32_undefined(float32_array); | |
332 assertTrue(isNaN(float32_array[7])); | |
333 // Make sure the ICs do it right | |
334 store_float32_undefined(float32_array); | |
335 assertTrue(isNaN(float32_array[7])); | |
336 // Make sure that Cranskshft does it right. | |
337 %OptimizeFunctionOnNextCall(store_float32_undefined); | |
338 store_float32_undefined(float32_array); | |
339 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.
| |
340 assertTrue(isNaN(float32_array[7])); | |
341 | |
342 function store_float64_undefined(ext_array) { | |
343 for (var i = 0; i < 8; i++) { | |
Michael Starzinger
2012/02/15 13:39:29
Likewise.
danno
2012/02/16 07:55:40
Done.
| |
344 ext_array[7] = undefined; | |
345 } | |
346 } | |
347 | |
348 var float64_array = new Float64Array(8); | |
349 // Make sure runtime does it right | |
350 store_float64_undefined(float64_array); | |
351 assertTrue(isNaN(float64_array[7])); | |
352 // Make sure the ICs do it right | |
353 store_float64_undefined(float64_array); | |
354 assertTrue(isNaN(float64_array[7])); | |
355 // Make sure that Cranskshft does it right. | |
356 %OptimizeFunctionOnNextCall(store_float64_undefined); | |
357 store_float64_undefined(float64_array); | |
358 store_float64_undefined(float64_array); | |
Michael Starzinger
2012/02/15 13:39:29
Likewise.
danno
2012/02/16 07:55:40
Done.
| |
359 assertTrue(isNaN(float64_array[7])); | |
OLD | NEW |