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

Side by Side Diff: test/mjsunit/compiler/number-isinteger.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
« no previous file with comments | « test/mjsunit/compiler/number-isfinite.js ('k') | test/mjsunit/compiler/number-isnan.js » ('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 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 assertTrue(f(0));
9 assertFalse(f(Number.MIN_VALUE));
10 assertTrue(f(Number.MAX_VALUE));
11 assertTrue(f(Number.MIN_SAFE_INTEGER));
12 assertTrue(f(Number.MIN_SAFE_INTEGER - 13));
13 assertTrue(f(Number.MAX_SAFE_INTEGER));
14 assertTrue(f(Number.MAX_SAFE_INTEGER + 23));
15 assertFalse(f(Number.NaN));
16 assertFalse(f(Number.POSITIVE_INFINITY));
17 assertFalse(f(Number.NEGATIVE_INFINITY));
18 assertFalse(f(1 / 0));
19 assertFalse(f(-1 / 0));
20 assertFalse(f(Number.EPSILON));
21 }
22
23 function f(x) {
24 return Number.isInteger(+x);
25 }
26
27 test(f);
28 test(f);
29 %OptimizeFunctionOnNextCall(f);
30 test(f);
OLDNEW
« no previous file with comments | « test/mjsunit/compiler/number-isfinite.js ('k') | test/mjsunit/compiler/number-isnan.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698