Index: test/mjsunit/es6/tail-call-simple.js |
diff --git a/test/mjsunit/es6/tail-call-simple.js b/test/mjsunit/es6/tail-call-simple.js |
index d2890b0212d92044dd0099cdd4f24859d505dc98..5e4025bc5a20206bd651e3253ecda3f571af4154 100644 |
--- a/test/mjsunit/es6/tail-call-simple.js |
+++ b/test/mjsunit/es6/tail-call-simple.js |
@@ -3,6 +3,8 @@ |
// found in the LICENSE file. |
// Flags: --allow-natives-syntax --harmony-tailcalls --stack-size=100 |
+// TODO(v8:4698), TODO(ishell): support these cases. |
+// Flags: --no-turbo --nostress-opt |
// |
// Tail calls work only in strict mode. |
@@ -10,7 +12,7 @@ |
(function() { |
function f(n) { |
if (n <= 0) { |
- return "foo"; |
+ return "foo"; |
} |
return f(n - 1); |
} |
@@ -27,7 +29,7 @@ |
"use strict"; |
function f(n) { |
if (n <= 0) { |
- return "foo"; |
+ return "foo"; |
} |
return f(n - 1); |
} |
@@ -39,6 +41,20 @@ |
(function() { |
"use strict"; |
+ function f(n) { |
+ if (n <= 0) { |
+ return "foo"; |
+ } |
+ return f(n - 1, 42); // Call with arguments adaptor. |
+ } |
+ assertEquals("foo", f(1e5)); |
+ %OptimizeFunctionOnNextCall(f); |
+ assertEquals("foo", f(1e5)); |
+})(); |
+ |
+ |
+(function() { |
+ "use strict"; |
function f(n){ |
if (n <= 0) { |
return "foo"; |
@@ -59,6 +75,28 @@ |
})(); |
+(function() { |
+ "use strict"; |
+ function f(n){ |
+ if (n <= 0) { |
+ return "foo"; |
+ } |
+ return g(n - 1, 42); // Call with arguments adaptor. |
+ } |
+ function g(n){ |
+ if (n <= 0) { |
+ return "bar"; |
+ } |
+ return f(n - 1, 42); // Call with arguments adaptor. |
+ } |
+ assertEquals("foo", f(1e5)); |
+ assertEquals("bar", f(1e5 + 1)); |
+ %OptimizeFunctionOnNextCall(f); |
+ assertEquals("foo", f(1e5)); |
+ assertEquals("bar", f(1e5 + 1)); |
+})(); |
+ |
+ |
// |
// Tail call bound functions. |
// |