Index: src/compiler/js-call-reducer.cc |
diff --git a/src/compiler/js-call-reducer.cc b/src/compiler/js-call-reducer.cc |
index 0c890b1c4908ecd8dc0f61e4b95cee0e16df7b1b..8dd1ce79aa298bbe6e0761edfa9bb097fbe41ed1 100644 |
--- a/src/compiler/js-call-reducer.cc |
+++ b/src/compiler/js-call-reducer.cc |
@@ -79,6 +79,10 @@ Reduction JSCallReducer::ReduceFunctionPrototypeApply(Node* node) { |
DCHECK_EQ(IrOpcode::kJSCallFunction, node->opcode()); |
Node* target = NodeProperties::GetValueInput(node, 0); |
CallFunctionParameters const& p = CallFunctionParametersOf(node->op()); |
+ // Tail calls to Function.prototype.apply are not properly supported |
+ // down the pipeline, so we disable this optimization completely for |
+ // tail calls (for now). |
+ if (p.tail_call_mode() == TailCallMode::kAllow) return NoChange(); |
Handle<JSFunction> apply = |
Handle<JSFunction>::cast(HeapObjectMatcher(target).Value()); |
size_t arity = p.arity(); |