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

Side by Side Diff: test/mjsunit/compiler/osr-for-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-block-scope-func.js ('k') | test/mjsunit/compiler/osr-maze1.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-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 bar() {
16 var result;
17 {
18 let sum = 0;
19 for (let i = 0; i < 90; i++) {
20 sum += i;
21 if (i == 45) %OptimizeOsr();
22 }
23 result = sum;
24 }
25 return result;
26 }
27
28 test(4005, bar);
29
30 function baz() {
31 let sum = 0;
32 for (let i = 0; i < 2; i++) {
33 sum = 2;
34 %OptimizeOsr();
35 }
36 return sum;
37 }
38
39 test(2, baz);
40
41 function qux() {
42 var result = 0;
43 for (let i = 0; i < 2; i++) {
44 result = i;
45 %OptimizeOsr();
46 }
47 return result;
48 }
49
50 test(1, qux);
51
52 function nux() {
53 var result = 0;
54 for (let i = 0; i < 2; i++) {
55 {
56 let sum = i;
57 %OptimizeOsr();
58 result = sum;
59 }
60 }
61 return result;
62 }
63
64 test(1, nux);
65
66 function blo() {
67 var result;
68 {
69 let sum = 0;
70 for (let i = 0; i < 90; i++) {
71 sum += i;
72 if (i == 45) %OptimizeOsr();
73 }
74 result = ret;
75 function ret() {
76 return sum;
77 }
78 }
79 return result;
80 }
81
82 test(4005, blo());
OLDNEW
« no previous file with comments | « test/mjsunit/compiler/osr-block-scope-func.js ('k') | test/mjsunit/compiler/osr-maze1.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698