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/base/adapters.h" | 5 #include "src/base/adapters.h" |
6 #include "src/base/bits.h" | 6 #include "src/base/bits.h" |
7 #include "src/compiler/instruction-selector-impl.h" | 7 #include "src/compiler/instruction-selector-impl.h" |
8 #include "src/compiler/node-matchers.h" | 8 #include "src/compiler/node-matchers.h" |
9 #include "src/compiler/node-properties.h" | 9 #include "src/compiler/node-properties.h" |
10 | 10 |
(...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
731 | 731 |
732 | 732 |
733 void InstructionSelector::VisitTailCall(Node* node) { | 733 void InstructionSelector::VisitTailCall(Node* node) { |
734 Mips64OperandGenerator g(this); | 734 Mips64OperandGenerator g(this); |
735 const CallDescriptor* descriptor = OpParameter<const CallDescriptor*>(node); | 735 const CallDescriptor* descriptor = OpParameter<const CallDescriptor*>(node); |
736 DCHECK_NE(0, descriptor->flags() & CallDescriptor::kSupportsTailCalls); | 736 DCHECK_NE(0, descriptor->flags() & CallDescriptor::kSupportsTailCalls); |
737 DCHECK_EQ(0, descriptor->flags() & CallDescriptor::kPatchableCallSite); | 737 DCHECK_EQ(0, descriptor->flags() & CallDescriptor::kPatchableCallSite); |
738 DCHECK_EQ(0, descriptor->flags() & CallDescriptor::kNeedsNopAfterCall); | 738 DCHECK_EQ(0, descriptor->flags() & CallDescriptor::kNeedsNopAfterCall); |
739 | 739 |
740 // TODO(turbofan): Relax restriction for stack parameters. | 740 // TODO(turbofan): Relax restriction for stack parameters. |
741 if (descriptor->UsesOnlyRegisters() && | 741 if (linkage()->GetIncomingDescriptor()->CanTailCall(node)) { |
742 descriptor->HasSameReturnLocationsAs( | |
743 linkage()->GetIncomingDescriptor())) { | |
744 CallBuffer buffer(zone(), descriptor, nullptr); | 742 CallBuffer buffer(zone(), descriptor, nullptr); |
745 | 743 |
746 // Compute InstructionOperands for inputs and outputs. | 744 // Compute InstructionOperands for inputs and outputs. |
747 InitializeCallBuffer(node, &buffer, true, false); | 745 InitializeCallBuffer(node, &buffer, true, false); |
748 | 746 |
749 DCHECK_EQ(0u, buffer.pushed_nodes.size()); | |
750 | |
751 // Select the appropriate opcode based on the call type. | 747 // Select the appropriate opcode based on the call type. |
752 InstructionCode opcode; | 748 InstructionCode opcode; |
753 switch (descriptor->kind()) { | 749 switch (descriptor->kind()) { |
754 case CallDescriptor::kCallCodeObject: | 750 case CallDescriptor::kCallCodeObject: |
755 opcode = kArchTailCallCodeObject; | 751 opcode = kArchTailCallCodeObject; |
756 break; | 752 break; |
757 case CallDescriptor::kCallJSFunction: | 753 case CallDescriptor::kCallJSFunction: |
758 opcode = kArchTailCallJSFunction; | 754 opcode = kArchTailCallJSFunction; |
759 break; | 755 break; |
760 default: | 756 default: |
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1295 // static | 1291 // static |
1296 MachineOperatorBuilder::Flags | 1292 MachineOperatorBuilder::Flags |
1297 InstructionSelector::SupportedMachineOperatorFlags() { | 1293 InstructionSelector::SupportedMachineOperatorFlags() { |
1298 return MachineOperatorBuilder::kFloat64RoundDown | | 1294 return MachineOperatorBuilder::kFloat64RoundDown | |
1299 MachineOperatorBuilder::kFloat64RoundTruncate; | 1295 MachineOperatorBuilder::kFloat64RoundTruncate; |
1300 } | 1296 } |
1301 | 1297 |
1302 } // namespace compiler | 1298 } // namespace compiler |
1303 } // namespace internal | 1299 } // namespace internal |
1304 } // namespace v8 | 1300 } // namespace v8 |
OLD | NEW |