OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/code-factory.h" | 5 #include "src/code-factory.h" |
6 #include "src/code-stubs.h" | 6 #include "src/code-stubs.h" |
7 #include "src/compiler/common-operator.h" | 7 #include "src/compiler/common-operator.h" |
8 #include "src/compiler/js-generic-lowering.h" | 8 #include "src/compiler/js-generic-lowering.h" |
9 #include "src/compiler/js-graph.h" | 9 #include "src/compiler/js-graph.h" |
10 #include "src/compiler/machine-operator.h" | 10 #include "src/compiler/machine-operator.h" |
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 node->set_op(common()->Call(desc)); | 522 node->set_op(common()->Call(desc)); |
523 } | 523 } |
524 | 524 |
525 | 525 |
526 void JSGenericLowering::LowerJSCallFunction(Node* node) { | 526 void JSGenericLowering::LowerJSCallFunction(Node* node) { |
527 const CallFunctionParameters& p = CallFunctionParametersOf(node->op()); | 527 const CallFunctionParameters& p = CallFunctionParametersOf(node->op()); |
528 int arg_count = static_cast<int>(p.arity() - 2); | 528 int arg_count = static_cast<int>(p.arity() - 2); |
529 CallFunctionStub stub(isolate(), arg_count, p.flags()); | 529 CallFunctionStub stub(isolate(), arg_count, p.flags()); |
530 CallInterfaceDescriptor d = stub.GetCallInterfaceDescriptor(); | 530 CallInterfaceDescriptor d = stub.GetCallInterfaceDescriptor(); |
531 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); | 531 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); |
| 532 if (p.AllowTailCalls()) { |
| 533 flags |= CallDescriptor::kSupportsTailCalls; |
| 534 } |
532 CallDescriptor* desc = Linkage::GetStubCallDescriptor( | 535 CallDescriptor* desc = Linkage::GetStubCallDescriptor( |
533 isolate(), zone(), d, static_cast<int>(p.arity() - 1), flags); | 536 isolate(), zone(), d, static_cast<int>(p.arity() - 1), flags); |
534 Node* stub_code = jsgraph()->HeapConstant(stub.GetCode()); | 537 Node* stub_code = jsgraph()->HeapConstant(stub.GetCode()); |
535 node->InsertInput(zone(), 0, stub_code); | 538 node->InsertInput(zone(), 0, stub_code); |
536 node->set_op(common()->Call(desc)); | 539 node->set_op(common()->Call(desc)); |
537 } | 540 } |
538 | 541 |
539 | 542 |
540 void JSGenericLowering::LowerJSCallRuntime(Node* node) { | 543 void JSGenericLowering::LowerJSCallRuntime(Node* node) { |
541 const CallRuntimeParameters& p = CallRuntimeParametersOf(node->op()); | 544 const CallRuntimeParameters& p = CallRuntimeParametersOf(node->op()); |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
806 } | 809 } |
807 | 810 |
808 | 811 |
809 MachineOperatorBuilder* JSGenericLowering::machine() const { | 812 MachineOperatorBuilder* JSGenericLowering::machine() const { |
810 return jsgraph()->machine(); | 813 return jsgraph()->machine(); |
811 } | 814 } |
812 | 815 |
813 } // namespace compiler | 816 } // namespace compiler |
814 } // namespace internal | 817 } // namespace internal |
815 } // namespace v8 | 818 } // namespace v8 |
OLD | NEW |