| Index: src/crankshaft/hydrogen.cc
|
| diff --git a/src/crankshaft/hydrogen.cc b/src/crankshaft/hydrogen.cc
|
| index e8e41d49fdd44d9e9a20906c73a6f84477277f64..70af6092af2e5c20d040d1b2e00bf616005cb638 100644
|
| --- a/src/crankshaft/hydrogen.cc
|
| +++ b/src/crankshaft/hydrogen.cc
|
| @@ -7995,8 +7995,8 @@ HInstruction* HOptimizedGraphBuilder::NewCallFunction(
|
|
|
| HValue* op_vals[] = {context(), function, arity};
|
|
|
| - // TODO(ishell): use tail_call_mode here.
|
| - Callable callable = CodeFactory::Call(isolate(), convert_mode);
|
| + Callable callable =
|
| + CodeFactory::Call(isolate(), convert_mode, tail_call_mode);
|
| HConstant* stub = Add<HConstant>(callable.code());
|
|
|
| return New<HCallWithDescriptor>(stub, argument_count, callable.descriptor(),
|
| @@ -8013,9 +8013,8 @@ HInstruction* HOptimizedGraphBuilder::NewCallFunctionViaIC(
|
|
|
| HValue* op_vals[] = {context(), function, index_val, vector_val};
|
|
|
| - // TODO(ishell): use tail_call_mode here.
|
| Callable callable = CodeFactory::CallICInOptimizedCode(
|
| - isolate(), arity, ConvertReceiverMode::kNullOrUndefined);
|
| + isolate(), arity, ConvertReceiverMode::kNullOrUndefined, tail_call_mode);
|
| HConstant* stub = Add<HConstant>(callable.code());
|
|
|
| return New<HCallWithDescriptor>(stub, argument_count, callable.descriptor(),
|
| @@ -8025,9 +8024,8 @@ HInstruction* HOptimizedGraphBuilder::NewCallFunctionViaIC(
|
| HInstruction* HOptimizedGraphBuilder::NewCallConstantFunction(
|
| Handle<JSFunction> function, int argument_count,
|
| TailCallMode tail_call_mode) {
|
| - // TODO(ishell): use tail_call_mode here.
|
| HValue* target = Add<HConstant>(function);
|
| - return New<HInvokeFunction>(target, function, argument_count);
|
| + return New<HInvokeFunction>(target, function, argument_count, tail_call_mode);
|
| }
|
|
|
|
|
| @@ -9377,12 +9375,10 @@ void HOptimizedGraphBuilder::HandleIndirectCall(Call* expr, HValue* function,
|
| TailCallMode syntactic_tail_call_mode = expr->tail_call_mode();
|
| TailCallMode tail_call_mode =
|
| function_state()->ComputeTailCallMode(syntactic_tail_call_mode);
|
| - USE(tail_call_mode);
|
|
|
| - // TODO(ishell): use tail_call_mode here.
|
| PushArgumentsFromEnvironment(arguments_count);
|
| - HInvokeFunction* call =
|
| - New<HInvokeFunction>(function, known_function, arguments_count);
|
| + HInvokeFunction* call = New<HInvokeFunction>(function, known_function,
|
| + arguments_count, tail_call_mode);
|
| Drop(1); // Function
|
| ast_context()->ReturnInstruction(call, expr->id());
|
| }
|
| @@ -9437,16 +9433,12 @@ void HOptimizedGraphBuilder::BuildFunctionApply(Call* expr) {
|
| TailCallMode syntactic_tail_call_mode = expr->tail_call_mode();
|
| TailCallMode tail_call_mode =
|
| function_state()->ComputeTailCallMode(syntactic_tail_call_mode);
|
| - USE(tail_call_mode);
|
|
|
| - // TODO(ishell): use tail_call_mode here.
|
| HInstruction* elements = Add<HArgumentsElements>(false);
|
| HInstruction* length = Add<HArgumentsLength>(elements);
|
| HValue* wrapped_receiver = BuildWrapReceiver(receiver, checked_function);
|
| - HInstruction* result = New<HApplyArguments>(function,
|
| - wrapped_receiver,
|
| - length,
|
| - elements);
|
| + HInstruction* result = New<HApplyArguments>(
|
| + function, wrapped_receiver, length, elements, tail_call_mode);
|
| ast_context()->ReturnInstruction(result, expr->id());
|
| } else {
|
| // We are inside inlined function and we know exactly what is inside
|
| @@ -9714,9 +9706,6 @@ bool HOptimizedGraphBuilder::CanBeFunctionApplyArguments(Call* expr) {
|
|
|
|
|
| void HOptimizedGraphBuilder::VisitCall(Call* expr) {
|
| - if (expr->tail_call_mode() == TailCallMode::kAllow) {
|
| - return Bailout(kTailCall);
|
| - }
|
| DCHECK(!HasStackOverflow());
|
| DCHECK(current_block() != NULL);
|
| DCHECK(current_block()->HasPredecessor());
|
|
|