summaryrefslogtreecommitdiff
path: root/deps/v8/test/mjsunit/compiler/osr-infinite.js
diff options
context:
space:
mode:
authorChris Dickinson <christopher.s.dickinson@gmail.com>2015-05-05 13:48:55 -0700
committerRod Vagg <rod@vagg.org>2015-08-04 11:56:09 -0700
commitd58e780504bdba6c5897c48428fd984c5b5f96fe (patch)
tree033f1568ae3f9f077aceb843b42eb1ed1739ce0f /deps/v8/test/mjsunit/compiler/osr-infinite.js
parent21d31c08e7d0b6865e52452750b20b05e6dca443 (diff)
downloadnode-new-d58e780504bdba6c5897c48428fd984c5b5f96fe.tar.gz
deps: update v8 to 4.3.61.21
* @indutny's SealHandleScope patch (484bebc38319fc7c622478037922ad73b2edcbf9) has been cherry picked onto the top of V8 to make it compile. * There's some test breakage in contextify. * This was merged at the request of the TC. PR-URL: https://github.com/iojs/io.js/pull/1632
Diffstat (limited to 'deps/v8/test/mjsunit/compiler/osr-infinite.js')
-rw-r--r--deps/v8/test/mjsunit/compiler/osr-infinite.js78
1 files changed, 78 insertions, 0 deletions
diff --git a/deps/v8/test/mjsunit/compiler/osr-infinite.js b/deps/v8/test/mjsunit/compiler/osr-infinite.js
new file mode 100644
index 0000000000..aa74c877d5
--- /dev/null
+++ b/deps/v8/test/mjsunit/compiler/osr-infinite.js
@@ -0,0 +1,78 @@
+// 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: --use-osr --allow-natives-syntax --turbo-osr
+
+var global_counter = 0;
+
+function thrower() {
+ var x = global_counter++;
+ if (x == 5) %OptimizeOsr(thrower.caller);
+ if (x == 10) throw "terminate";
+}
+
+%NeverOptimizeFunction(thrower); // Don't want to inline the thrower.
+%NeverOptimizeFunction(test); // Don't want to inline the func into test.
+
+function test(func) {
+ for (var i = 0; i < 3; i++) {
+ global_counter = 0;
+ assertThrows(func);
+ }
+}
+
+function n1() {
+ while (true) thrower();
+}
+
+function n2() {
+ while (true) while (true) thrower();
+}
+
+function n3() {
+ while (true) while (true) while (true) thrower();
+}
+
+function n4() {
+ while (true) while (true) while (true) while (true) thrower();
+}
+
+function b1(a) {
+ while (true) {
+ thrower();
+ if (a) break
+ }
+}
+
+
+function b2(a) {
+ while (true) {
+ while (true) {
+ thrower();
+ if (a) break
+ }
+ }
+}
+
+
+function b3(a) {
+ while (true) {
+ while (true) {
+ while (true) {
+ thrower();
+ if (a) break
+ }
+ if (a) break
+ }
+ }
+}
+
+
+test(n1);
+test(n2);
+test(n3);
+test(n4);
+test(b1);
+test(b2);
+test(b3);