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

Unified Diff: test/mjsunit/compiler/osr-multiple2.js

Issue 809333002: [turbofan] Implement OSR for outer loops. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 11 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-multiple.js ('k') | test/mjsunit/compiler/osr-multiple3.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/compiler/osr-multiple2.js
diff --git a/test/mjsunit/compiler/osr-multiple2.js b/test/mjsunit/compiler/osr-multiple2.js
new file mode 100644
index 0000000000000000000000000000000000000000..9a81bfb658472350e9668f2b3f137891315ea9b6
--- /dev/null
+++ b/test/mjsunit/compiler/osr-multiple2.js
@@ -0,0 +1,51 @@
+// Copyright 2014 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: --use-osr
+// TODO(titzer): enable --turbo-osr when nested OSR works.
+
+function f1(a,b,c) {
+ var x = 0;
+ var y = 0;
+ var z = 0;
+ for (var i = 0; i < 2; i++) {
+ while (a > 0) { x += 19; a--; }
+ while (b > 0) { y += 23; b--; }
+ while (c > 0) { z += 29; c--; }
+ }
+ return x + y + z;
+}
+
+function f2(a,b,c) {
+ var x = 0;
+ var y = 0;
+ var z = 0;
+ for (var i = 0; i < 2; i++) {
+ while (a > 0) { x += 19; a--; }
+ while (b > 0) { y += 23; b--; }
+ while (c > 0) { z += 29; c--; }
+ }
+ return x + y + z;
+}
+
+
+function f3(a,b,c) {
+ var x = 0;
+ var y = 0;
+ var z = 0;
+ for (var i = 0; i < 2; i++) {
+ while (a > 0) { x += 19; a--; }
+ while (b > 0) { y += 23; b--; }
+ while (c > 0) { z += 29; c--; }
+ }
+ return x + y + z;
+}
+
+function check(f,a,b,c) {
+ assertEquals(a * 19 + b * 23 + c * 29, f(a,b,c));
+}
+
+check(f1, 50000, 5, 6);
+check(f2, 4, 50000, 6);
+check(f3, 11, 12, 50000);
« no previous file with comments | « test/mjsunit/compiler/osr-multiple.js ('k') | test/mjsunit/compiler/osr-multiple3.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698