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

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

Issue 934293002: [turbofan] Simply context specialization and fix 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') | 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 "use strict";
8
9 function test(expected, func) {
10 assertEquals(expected, func());
11 assertEquals(expected, func());
12 assertEquals(expected, func());
13 }
14
15 function foo() {
16 var result = 0;
17 {
18 let x = 0;
19 var temp_x = x;
20 var first = 1;
21 outer: while (true) {
22 let x = temp_x;
23 if (first == 1) first = 0;
24 else x = x + 1 | 0;
25 var flag = 1;
26 for (; flag == 1; (flag = 0, temp_x = x)) {
27 if (x < 2) {
28 result = x; %OptimizeOsr();
29 } else {
30 break outer;
31 }
32 }
33 if (flag == 1) break;
34 }
35 }
36 return result;
37 }
38
39 test(1, foo);
40
41
42 function smo() {
43 var result = 0;
44 {
45 let x = 11;
46 outer: while (true) {
47 let y = x;
48 for (var i = 0; i < 5; i++) {
49 %OptimizeOsr();
50 if (i) break outer;
51 else result = y;
52 }
53 }
54 }
55 return result;
56 }
57
58 test(11, smo);
OLDNEW
« no previous file with comments | « test/mjsunit/compiler/osr-maze1.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698