Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Side by Side Diff: test/mjsunit/regress/regress-undefined-nan.js

Issue 863153002: Double field values need sNaN -> qNaN canonicalization. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/hydrogen-instructions.cc ('k') | test/mjsunit/regress/regress-undefined-nan3.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Flags: --allow-natives-syntax 5 // Flags: --allow-natives-syntax
6 6
7 function loader(dst, src, i) { 7 function loader(dst, src, i) {
8 dst[i] = src[i]; 8 dst[i] = src[i];
9 } 9 }
10 10
11 var ab = new ArrayBuffer(8); 11 var ab = new ArrayBuffer(8);
12 var i_view = new Int32Array(ab); 12 var i_view = new Int32Array(ab);
13 i_view[0] = 0xFFF7FFFF; 13 i_view[0] = 0xFFF7FFFF;
14 i_view[1] = 0xFFF7FFFF; 14 i_view[1] = 0xFFF7FFFF;
15 var f_view = new Float64Array(ab); 15 var f_view = new Float64Array(ab);
16 16
17 var fixed_double_elements = new Float64Array(1); 17 var fixed_double_elements = new Float64Array(1);
18 fixed_double_elements[0] = f_view[0]; 18
19 function opt_store() { fixed_double_elements[0] = f_view[0]; }
20
21 opt_store();
22 opt_store();
23 %OptimizeFunctionOnNextCall(opt_store);
24 opt_store();
25
26 var i32 = new Int32Array(fixed_double_elements.buffer);
27 assertEquals(i_view[0], i32[0]);
28 assertEquals(i_view[1], i32[1]);
19 29
20 var doubles = [0.5]; 30 var doubles = [0.5];
21 loader(doubles, fixed_double_elements, 0); 31 loader(doubles, fixed_double_elements, 0);
22 loader(doubles, fixed_double_elements, 0); 32 loader(doubles, fixed_double_elements, 0);
23 %OptimizeFunctionOnNextCall(loader); 33 %OptimizeFunctionOnNextCall(loader);
24 loader(doubles, fixed_double_elements, 0); 34 loader(doubles, fixed_double_elements, 0);
25 assertTrue(doubles[0] !== undefined); 35 assertTrue(doubles[0] !== undefined);
OLDNEW
« no previous file with comments | « src/hydrogen-instructions.cc ('k') | test/mjsunit/regress/regress-undefined-nan3.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698