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 9443208c57ceb69c11ef82c6e840853619f725a3..ad6f7cd78ceb8924b539a572689a125ef8aa1bf7 100644 |
--- a/test/mjsunit/es6/tail-call-simple.js |
+++ b/test/mjsunit/es6/tail-call-simple.js |
@@ -15,6 +15,8 @@ |
return f(n - 1); |
} |
assertThrows(()=>{ f(1e6) }); |
+ %OptimizeFunctionOnNextCall(f); |
+ assertThrows(()=>{ f(1e6) }); |
})(); |
@@ -30,6 +32,8 @@ |
return f(n - 1); |
} |
assertEquals("foo", f(1e6)); |
+ %OptimizeFunctionOnNextCall(f); |
+ assertEquals("foo", f(1e6)); |
})(); |
@@ -49,6 +53,9 @@ |
} |
assertEquals("foo", f(1e6)); |
assertEquals("bar", f(1e6 + 1)); |
+ %OptimizeFunctionOnNextCall(f); |
+ assertEquals("foo", f(1e6)); |
+ assertEquals("bar", f(1e6 + 1)); |
})(); |
@@ -61,9 +68,14 @@ |
if (n <= 0) { |
return "foo"; |
} |
- return f(n - 1); |
+ return f_bound(n - 1); |
+ } |
+ var f_bound = f0.bind({}); |
+ function f(n) { |
+ return f_bound(n); |
} |
- var f = f0.bind({}); |
+ assertEquals("foo", f(1e6)); |
+ %OptimizeFunctionOnNextCall(f); |
assertEquals("foo", f(1e6)); |
})(); |
@@ -74,17 +86,22 @@ |
if (n <= 0) { |
return "foo"; |
} |
- return g(n - 1); |
+ return g_bound(n - 1); |
} |
function g0(n){ |
if (n <= 0) { |
return "bar"; |
} |
- return f(n - 1); |
+ return f_bound(n - 1); |
} |
- var f = f0.bind({}); |
- var g = g0.bind({}); |
- |
+ var f_bound = f0.bind({}); |
+ var g_bound = g0.bind({}); |
+ function f(n) { |
+ return f_bound(n); |
+ } |
+ assertEquals("foo", f(1e6)); |
+ assertEquals("bar", f(1e6 + 1)); |
+ %OptimizeFunctionOnNextCall(f); |
assertEquals("foo", f(1e6)); |
assertEquals("bar", f(1e6 + 1)); |
})(); |