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

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

Issue 898353002: [turbofan] Use heavy-handed graph duplication to do loop peeling 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-backedges1.js ('k') | test/mjsunit/compiler/osr-maze2.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/compiler/osr-maze1.js
diff --git a/test/mjsunit/compiler/osr-maze1.js b/test/mjsunit/compiler/osr-maze1.js
new file mode 100644
index 0000000000000000000000000000000000000000..87d85c8d8624bdd4c44d2a8c406b831a30439962
--- /dev/null
+++ b/test/mjsunit/compiler/osr-maze1.js
@@ -0,0 +1,52 @@
+// 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-deoptimization
+
+function bar(goal) {
+ var count = 0;
+ var sum = 11;
+ var i = 35;
+ while (i-- > 33) {
+ if (count++ == goal) %OptimizeOsr();
+ sum = sum + i;
+ }
+ while (i-- > 31) {
+ if (count++ == goal) %OptimizeOsr();
+ j = 9;
+ while (j-- > 7) {
+ if (count++ == goal) %OptimizeOsr();
+ sum = sum + j * 3;
+ }
+ while (j-- > 5) {
+ if (count++ == goal) %OptimizeOsr();
+ sum = sum + j * 5;
+ }
+ }
+ while (i-- > 29) {
+ if (count++ == goal) %OptimizeOsr();
+ while (j-- > 3) {
+ var k = 10;
+ if (count++ == goal) %OptimizeOsr();
+ while (k-- > 8) {
+ if (count++ == goal) %OptimizeOsr();
+ sum = sum + k * 11;
+ }
+ }
+ while (j-- > 1) {
+ if (count++ == goal) %OptimizeOsr();
+ while (k-- > 6) {
+ if (count++ == goal) %OptimizeOsr();
+ sum = sum + j * 13;
+ }
+ }
+ }
+ print(count);
+ return sum;
+}
+
+for (var i = 0; i < 13; i++) {
+ %DeoptimizeFunction(bar);
+ assertEquals(348, bar(i));
+}
« no previous file with comments | « test/mjsunit/compiler/osr-backedges1.js ('k') | test/mjsunit/compiler/osr-maze2.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698