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

Side by Side Diff: test/mjsunit/number-isnan-opt.js

Issue 2722483003: [turbofan] Introduce dedicated ObjectIsNaN operator. (Closed)
Patch Set: Use GetUpperBound. Add test cases. Created 3 years, 9 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/compiler/verifier.cc ('k') | test/unittests/compiler/js-builtin-reducer-unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2017 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // Flags: --allow-natives-syntax
6
7 (function() {
8 function foo(x) { return Number.isNaN(x); }
9
10 assertTrue(foo(+undefined));
11 assertFalse(foo(undefined));
12 %OptimizeFunctionOnNextCall(foo);
13 assertTrue(foo(+undefined));
14 assertFalse(foo(undefined));
15 })();
16
17 (function() {
18 function foo(x) { return Number.isNaN(+x); }
19
20 assertTrue(foo(+undefined));
21 assertFalse(foo(0));
22 %OptimizeFunctionOnNextCall(foo);
23 assertTrue(foo(+undefined));
24 assertFalse(foo(0));
25 })();
26
27 (function() {
28 function foo(x) { return Number.isNaN(x|0); }
29
30 assertFalse(foo(+undefined));
31 assertFalse(foo(0));
32 %OptimizeFunctionOnNextCall(foo);
33 assertFalse(foo(+undefined));
34 assertFalse(foo(0));
35 })();
36
37 (function() {
38 function foo(x) { return Number.isNaN("" + x); }
39
40 assertFalse(foo(undefined));
41 assertFalse(foo(0));
42 %OptimizeFunctionOnNextCall(foo);
43 assertFalse(foo(undefined));
44 assertFalse(foo(0));
45 })();
46
47 (function() {
48 function foo(x) { return Number.isNaN(0/0); }
49
50 assertTrue(foo());
51 assertTrue(foo());
52 %OptimizeFunctionOnNextCall(foo);
53 assertTrue(foo());
54 assertTrue(foo());
55 })();
OLDNEW
« no previous file with comments | « src/compiler/verifier.cc ('k') | test/unittests/compiler/js-builtin-reducer-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698