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

Unified Diff: src/compiler/js-intrinsic-lowering.cc

Issue 1216933011: [turbofan] Enable tail calls for %_CallFunction. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix platform ports Created 5 years, 6 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/compiler/js-intrinsic-lowering.h ('k') | src/compiler/js-operator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-intrinsic-lowering.cc
diff --git a/src/compiler/js-intrinsic-lowering.cc b/src/compiler/js-intrinsic-lowering.cc
index 0039d1d4c3ee9f89ca80dc6d6be8abdc1b8eb9de..01552559ea39b83a7c4f62f41ecb743eb2fccb90 100644
--- a/src/compiler/js-intrinsic-lowering.cc
+++ b/src/compiler/js-intrinsic-lowering.cc
@@ -94,6 +94,8 @@ Reduction JSIntrinsicLowering::Reduce(Node* node) {
return ReduceGetCallerJSFunction(node);
case Runtime::kInlineThrowNotDateError:
return ReduceThrowNotDateError(node);
+ case Runtime::kInlineCallFunction:
+ return ReduceCallFunction(node);
default:
break;
}
@@ -513,6 +515,21 @@ Reduction JSIntrinsicLowering::ReduceThrowNotDateError(Node* node) {
}
+Reduction JSIntrinsicLowering::ReduceCallFunction(Node* node) {
+ CallRuntimeParameters params = OpParameter<CallRuntimeParameters>(node->op());
+ size_t arity = params.arity();
+ node->set_op(javascript()->CallFunction(arity, NO_CALL_FUNCTION_FLAGS, STRICT,
+ VectorSlotPair(), ALLOW_TAIL_CALLS));
+ Node* function = node->InputAt(static_cast<int>(arity - 1));
+ while (--arity != 0) {
+ node->ReplaceInput(static_cast<int>(arity),
+ node->InputAt(static_cast<int>(arity - 1)));
+ }
+ node->ReplaceInput(0, function);
+ return Changed(node);
+}
+
+
Reduction JSIntrinsicLowering::Change(Node* node, const Operator* op, Node* a,
Node* b) {
node->set_op(op);
@@ -549,6 +566,10 @@ CommonOperatorBuilder* JSIntrinsicLowering::common() const {
return jsgraph()->common();
}
+JSOperatorBuilder* JSIntrinsicLowering::javascript() const {
+ return jsgraph_->javascript();
+}
+
MachineOperatorBuilder* JSIntrinsicLowering::machine() const {
return jsgraph()->machine();
« no previous file with comments | « src/compiler/js-intrinsic-lowering.h ('k') | src/compiler/js-operator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698