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

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

Issue 898353002: [turbofan] Use heavy-handed graph duplication to do loop peeling for 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 | « test/mjsunit/compiler/osr-maze1.js ('k') | test/mjsunit/compiler/osr-nested2.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: --allow-natives-syntax --use-osr --turbo-deoptimization
6
7 function bar() {
8 var sum = 11;
9 var i = 35;
10 while (i-- > 31) {
11 LOOP1();
12 j = 9;
13 while (j-- > 7) {
14 LOOP2();
15 sum = sum + j * 5;
16 var k = 7;
17 while (k-- > 5) {
18 LOOP3();
19 sum = sum + j * 5;
20 }
21 }
22 }
23 while (i-- > 29) {
24 LOOP4();
25 while (j-- > 3) {
26 LOOP5();
27 var k = 10;
28 while (k-- > 8) {
29 LOOP6();
30 sum = sum + k * 11;
31 }
32 }
33 while (j-- > 1) {
34 LOOP7();
35 var k = 8;
36 while (k-- > 6) {
37 LOOP8();
38 var m = 9;
39 while (m-- > 6) {
40 LOOP9();
41 sum = sum + k * 13;
42 }
43 }
44 }
45 }
46 return sum;
47 }
48
49 function gen(i) {
50 var body = bar.toString();
51 body = body.replace(new RegExp("bar"), "bar" + i);
52 for (var j = 1; j < 10; j++) {
53 var r = new RegExp("LOOP" + j + "\\(\\);");
54 if (i == j) body = body.replace(r, "%OptimizeOsr();");
55 else body = body.replace(r, "");
56 }
57 return eval("(" + body + ")");
58 }
59
60 for (var i = 1; i < 10; i++) {
61 var f = gen(i);
62 assertEquals(1979, f());
63 }
OLDNEW
« no previous file with comments | « test/mjsunit/compiler/osr-maze1.js ('k') | test/mjsunit/compiler/osr-nested2.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698