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

Side by Side Diff: test/mjsunit/compiler/regress-5538.js

Issue 2432143002: [turbofan] Fix invalid Number.parseInt inlining. (Closed)
Patch Set: Fix unittests. Created 4 years, 2 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() {
8 function foo(x) {
9 x = x | 0;
10 return Number.parseInt(x + 1);
11 }
12
13 assertEquals(1, foo(0));
14 assertEquals(2, foo(1));
15 %OptimizeFunctionOnNextCall(foo);
16 assertEquals(Math.pow(2, 31), foo(Math.pow(2, 31) - 1));
17 })();
18
19 (function() {
20 function foo(x) {
21 x = x | 0;
22 return Number.parseInt(x + 1, 0);
23 }
24
25 assertEquals(1, foo(0));
26 assertEquals(2, foo(1));
27 %OptimizeFunctionOnNextCall(foo);
28 assertEquals(Math.pow(2, 31), foo(Math.pow(2, 31) - 1));
29 })();
30
31 (function() {
32 function foo(x) {
33 x = x | 0;
34 return Number.parseInt(x + 1, 10);
35 }
36
37 assertEquals(1, foo(0));
38 assertEquals(2, foo(1));
39 %OptimizeFunctionOnNextCall(foo);
40 assertEquals(Math.pow(2, 31), foo(Math.pow(2, 31) - 1));
41 })();
42
43 (function() {
44 function foo(x) {
45 x = x | 0;
46 return Number.parseInt(x + 1, undefined);
47 }
48
49 assertEquals(1, foo(0));
50 assertEquals(2, foo(1));
51 %OptimizeFunctionOnNextCall(foo);
52 assertEquals(Math.pow(2, 31), foo(Math.pow(2, 31) - 1));
53 })();
OLDNEW
« no previous file with comments | « src/compiler/js-builtin-reducer.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