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

Unified Diff: test/mjsunit/asm/infinite-loops-taken.js

Issue 661923002: Implement graph trimming in ControlReducer. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Use Deque. Created 6 years, 2 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/asm/infinite-loops.js ('k') | test/mjsunit/mjsunit.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/asm/infinite-loops-taken.js
diff --git a/test/mjsunit/asm/infinite-loops-taken.js b/test/mjsunit/asm/infinite-loops-taken.js
new file mode 100644
index 0000000000000000000000000000000000000000..d136c62469b7c910e563d7aa8a1603867afd22ce
--- /dev/null
+++ b/test/mjsunit/asm/infinite-loops-taken.js
@@ -0,0 +1,41 @@
+// 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.
+
+var error = "error";
+function counter(x) {
+ return (function() { if (x-- == 0) throw error;});
+}
+
+function Module() {
+ "use asm";
+
+ function w0(f) {
+ while (1) f();
+ return 108;
+ }
+
+ function w1(f) {
+ if (1) while (1) f();
+ return 109;
+ }
+
+ function w2(f) {
+ if (1) while (1) f();
+ else while (1) f();
+ return 110;
+ }
+
+ function w3(f) {
+ if (0) while (1) f();
+ return 111;
+ }
+
+ return { w0: w0, w1: w1, w2: w2, w3: w3 };
+}
+
+var m = Module();
+assertThrows(function() { m.w0(counter(5)) }, error);
+assertThrows(function() { m.w1(counter(5)) }, error);
+assertThrows(function() { m.w2(counter(5)) }, error);
+assertEquals(111, m.w3(counter(5)));
« no previous file with comments | « test/mjsunit/asm/infinite-loops.js ('k') | test/mjsunit/mjsunit.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698