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

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

Issue 1004993004: [turbofan] Fix bug in OSR deconstruction. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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-infinite.js ('k') | no next file » | 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-osr
6
7 function foo() {
8 var sum = 0;
9 A: for (var i = 0; i < 5; i++) {
10 B: for (var j = 0; j < 5; j++) {
11 C: for (var k = 0; k < 10; k++) {
12 if (k === 5) %OptimizeOsr();
13 if (k === 6) break B;
14 sum++;
15 }
16 }
17 }
18 return sum;
19 }
20
21 assertEquals(30, foo());
22 assertEquals(30, foo());
23
24 function bar(a) {
25 var sum = 0;
26 A: for (var i = 0; i < 5; i++) {
27 B: for (var j = 0; j < 5; j++) {
28 C: for (var k = 0; k < 10; k++) {
29 sum++;
30 %OptimizeOsr();
31 if (a === 1) break A;
32 if (a === 2) break B;
33 if (a === 3) break C;
34 }
35 }
36 }
37 return sum;
38 }
39
40 assertEquals(1, bar(1));
41 assertEquals(1, bar(1));
42
43 assertEquals(5, bar(2));
44 assertEquals(5, bar(2));
45
46 assertEquals(25, bar(3));
47 assertEquals(25, bar(3));
OLDNEW
« no previous file with comments | « test/mjsunit/compiler/osr-infinite.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698