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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/mjsunit/compiler/osr-maze1.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/compiler/osr-while-let.js
diff --git a/test/mjsunit/compiler/osr-while-let.js b/test/mjsunit/compiler/osr-while-let.js
new file mode 100644
index 0000000000000000000000000000000000000000..c19cf6cb2449102147a4c45eef9b8be14036d2e3
--- /dev/null
+++ b/test/mjsunit/compiler/osr-while-let.js
@@ -0,0 +1,58 @@
+// Copyright 2015 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flags: --allow-natives-syntax --use-osr --turbo-osr
+
+"use strict";
+
+function test(expected, func) {
+ assertEquals(expected, func());
+ assertEquals(expected, func());
+ assertEquals(expected, func());
+}
+
+function foo() {
+ var result = 0;
+ {
+ let x = 0;
+ var temp_x = x;
+ var first = 1;
+ outer: while (true) {
+ let x = temp_x;
+ if (first == 1) first = 0;
+ else x = x + 1 | 0;
+ var flag = 1;
+ for (; flag == 1; (flag = 0, temp_x = x)) {
+ if (x < 2) {
+ result = x; %OptimizeOsr();
+ } else {
+ break outer;
+ }
+ }
+ if (flag == 1) break;
+ }
+ }
+ return result;
+}
+
+test(1, foo);
+
+
+function smo() {
+ var result = 0;
+ {
+ let x = 11;
+ outer: while (true) {
+ let y = x;
+ for (var i = 0; i < 5; i++) {
+ %OptimizeOsr();
+ if (i) break outer;
+ else result = y;
+ }
+ }
+ }
+ return result;
+}
+
+test(11, smo);
« 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