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

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

Issue 809333002: [turbofan] Implement OSR for outer loops. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 11 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/osr-multiple.js ('k') | test/mjsunit/compiler/osr-multiple3.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 2014 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
6 // TODO(titzer): enable --turbo-osr when nested OSR works.
7
8 function f1(a,b,c) {
9 var x = 0;
10 var y = 0;
11 var z = 0;
12 for (var i = 0; i < 2; i++) {
13 while (a > 0) { x += 19; a--; }
14 while (b > 0) { y += 23; b--; }
15 while (c > 0) { z += 29; c--; }
16 }
17 return x + y + z;
18 }
19
20 function f2(a,b,c) {
21 var x = 0;
22 var y = 0;
23 var z = 0;
24 for (var i = 0; i < 2; i++) {
25 while (a > 0) { x += 19; a--; }
26 while (b > 0) { y += 23; b--; }
27 while (c > 0) { z += 29; c--; }
28 }
29 return x + y + z;
30 }
31
32
33 function f3(a,b,c) {
34 var x = 0;
35 var y = 0;
36 var z = 0;
37 for (var i = 0; i < 2; i++) {
38 while (a > 0) { x += 19; a--; }
39 while (b > 0) { y += 23; b--; }
40 while (c > 0) { z += 29; c--; }
41 }
42 return x + y + z;
43 }
44
45 function check(f,a,b,c) {
46 assertEquals(a * 19 + b * 23 + c * 29, f(a,b,c));
47 }
48
49 check(f1, 50000, 5, 6);
50 check(f2, 4, 50000, 6);
51 check(f3, 11, 12, 50000);
OLDNEW
« no previous file with comments | « test/mjsunit/compiler/osr-multiple.js ('k') | test/mjsunit/compiler/osr-multiple3.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698