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

Unified Diff: test/mjsunit/es6/tail-call-simple.js

Issue 1670133002: [es6] Further fixing of tail Calls. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Tail call tracing added Created 4 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 | « src/runtime/runtime-test.cc ('k') | test/mjsunit/function-caller.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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));
})();
« no previous file with comments | « src/runtime/runtime-test.cc ('k') | test/mjsunit/function-caller.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698