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

Unified Diff: src/runtime/runtime-function.cc

Issue 1439613003: [turbofan] Better and more sane support for tail calls (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Skip test in ignition configuration Created 5 years, 1 month 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.h ('k') | test/mjsunit/call-runtime-tail.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-function.cc
diff --git a/src/runtime/runtime-function.cc b/src/runtime/runtime-function.cc
index b1dfd4af782c4290fd6c6728f1a7d3ad2328773e..41ddff20b7a64a761f906e4f9ae63ae36b5d2e1a 100644
--- a/src/runtime/runtime-function.cc
+++ b/src/runtime/runtime-function.cc
@@ -528,6 +528,24 @@ RUNTIME_FUNCTION(Runtime_Call) {
}
+RUNTIME_FUNCTION(Runtime_TailCall) {
+ HandleScope scope(isolate);
+ DCHECK_LE(2, args.length());
+ int const argc = args.length() - 2;
+ CONVERT_ARG_HANDLE_CHECKED(JSReceiver, target, 0);
+ CONVERT_ARG_HANDLE_CHECKED(Object, receiver, 1);
+ ScopedVector<Handle<Object>> argv(argc);
+ for (int i = 0; i < argc; ++i) {
+ argv[i] = args.at<Object>(2 + i);
+ }
+ Handle<Object> result;
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
+ isolate, result,
+ Execution::Call(isolate, target, receiver, argc, argv.start()));
+ return *result;
+}
+
+
RUNTIME_FUNCTION(Runtime_Apply) {
HandleScope scope(isolate);
DCHECK(args.length() == 5);
« no previous file with comments | « src/runtime/runtime.h ('k') | test/mjsunit/call-runtime-tail.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698