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

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

Issue 2313073002: [builtins] Migrate Number predicates and make them optimizable. (Closed)
Patch Set: Created 4 years, 3 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
OLDNEW
(Empty)
1 // Copyright 2016 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 test(f) {
8 assertFalse(f(0));
9 assertFalse(f(Number.MIN_VALUE));
10 assertFalse(f(Number.MAX_VALUE));
11 assertFalse(f(Number.MIN_SAFE_INTEGER - 13));
12 assertFalse(f(Number.MAX_SAFE_INTEGER + 23));
13 assertTrue(f(Number.NaN));
14 assertFalse(f(Number.POSITIVE_INFINITY));
15 assertFalse(f(Number.NEGATIVE_INFINITY));
16 assertFalse(f(Number.EPSILON));
17 assertFalse(f(1 / 0));
18 assertFalse(f(-1 / 0));
19 }
20
21 function f(x) {
22 return Number.isNaN(+x);
23 }
24
25 test(f);
26 test(f);
27 %OptimizeFunctionOnNextCall(f);
28 test(f);
OLDNEW
« no previous file with comments | « test/mjsunit/compiler/number-isinteger.js ('k') | test/mjsunit/compiler/number-issafeinteger.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698