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

Side by Side Diff: test/mjsunit/compiler/osr-follow.js

Issue 892593002: [turbofan] Fix usage of ThisFunction parameter in OSR. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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/x64/linkage-x64.cc ('k') | test/mjsunit/compiler/osr-forin.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 2015 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: --use-osr --turbo-osr
6
7 function foo(a) {
8 var sum = 0;
9 var inc = a ? 100 : 200;
10 for (var i = 0; i < 100000; i++) {
11 sum += inc;
12 }
13 return sum + inc;
14 }
15
16 function bar(a) {
17 var sum = 0;
18 var inc = a ? 100 : 200;
19 var x = a ? 5 : 6;
20 var y = a ? 7 : 8;
21 for (var i = 0; i < 100000; i++) {
22 sum += inc;
23 }
24 return sum ? x : y;
25 }
26
27 function baz(a) {
28 var limit = a ? 100001 : 100002;
29 var r = 1;
30 var x = a ? 1 : 2;
31 var y = a ? 3 : 4;
32 for (var i = 0; i < limit; i++) {
33 r = r * -1;
34 }
35 return r > 0 ? x == y : x != y;
36 }
37
38 function qux(a) {
39 var limit = a ? 100001 : 100002;
40 var r = 1;
41 var x = a ? 1 : 2;
42 var y = a ? 3 : 4;
43 for (var i = 0; i < limit; i++) {
44 r = r * -1;
45 }
46 var w = r > 0 ? x : y;
47 var z = r > 0 ? y : x;
48 return w === z;
49 }
50
51 function test(func, tv, fv) {
52 assertEquals(tv, func(true));
53 assertEquals(fv, func(false));
54 assertEquals(tv, func(true));
55 assertEquals(fv, func(false));
56 }
57
58 test(foo, 10000100, 20000200);
59 test(bar, 5, 6);
60 test(baz, true, false);
61 test(qux, false, false);
OLDNEW
« no previous file with comments | « src/compiler/x64/linkage-x64.cc ('k') | test/mjsunit/compiler/osr-forin.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698