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 <algorithm> | 5 #include <algorithm> |
6 | 6 |
7 #include "src/base/adapters.h" | 7 #include "src/base/adapters.h" |
8 #include "src/compiler/instruction-selector-impl.h" | 8 #include "src/compiler/instruction-selector-impl.h" |
9 #include "src/compiler/node-matchers.h" | 9 #include "src/compiler/node-matchers.h" |
10 #include "src/compiler/node-properties.h" | 10 #include "src/compiler/node-properties.h" |
(...skipping 1094 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1105 | 1105 |
1106 | 1106 |
1107 void InstructionSelector::VisitTailCall(Node* node) { | 1107 void InstructionSelector::VisitTailCall(Node* node) { |
1108 X64OperandGenerator g(this); | 1108 X64OperandGenerator g(this); |
1109 CallDescriptor const* descriptor = OpParameter<CallDescriptor const*>(node); | 1109 CallDescriptor const* descriptor = OpParameter<CallDescriptor const*>(node); |
1110 DCHECK_NE(0, descriptor->flags() & CallDescriptor::kSupportsTailCalls); | 1110 DCHECK_NE(0, descriptor->flags() & CallDescriptor::kSupportsTailCalls); |
1111 DCHECK_EQ(0, descriptor->flags() & CallDescriptor::kPatchableCallSite); | 1111 DCHECK_EQ(0, descriptor->flags() & CallDescriptor::kPatchableCallSite); |
1112 DCHECK_EQ(0, descriptor->flags() & CallDescriptor::kNeedsNopAfterCall); | 1112 DCHECK_EQ(0, descriptor->flags() & CallDescriptor::kNeedsNopAfterCall); |
1113 | 1113 |
1114 // TODO(turbofan): Relax restriction for stack parameters. | 1114 // TODO(turbofan): Relax restriction for stack parameters. |
1115 if (descriptor->UsesOnlyRegisters() && | 1115 if (linkage()->GetIncomingDescriptor()->CanTailCall(node)) { |
1116 descriptor->HasSameReturnLocationsAs( | |
1117 linkage()->GetIncomingDescriptor())) { | |
1118 CallBuffer buffer(zone(), descriptor, nullptr); | 1116 CallBuffer buffer(zone(), descriptor, nullptr); |
1119 | 1117 |
1120 // Compute InstructionOperands for inputs and outputs. | 1118 // Compute InstructionOperands for inputs and outputs. |
1121 InitializeCallBuffer(node, &buffer, true, true); | 1119 InitializeCallBuffer(node, &buffer, true, true); |
1122 | 1120 |
1123 DCHECK_EQ(0u, buffer.pushed_nodes.size()); | |
1124 | |
1125 // Select the appropriate opcode based on the call type. | 1121 // Select the appropriate opcode based on the call type. |
1126 InstructionCode opcode; | 1122 InstructionCode opcode; |
1127 switch (descriptor->kind()) { | 1123 switch (descriptor->kind()) { |
1128 case CallDescriptor::kCallCodeObject: | 1124 case CallDescriptor::kCallCodeObject: |
1129 opcode = kArchTailCallCodeObject; | 1125 opcode = kArchTailCallCodeObject; |
1130 break; | 1126 break; |
1131 case CallDescriptor::kCallJSFunction: | 1127 case CallDescriptor::kCallJSFunction: |
1132 opcode = kArchTailCallJSFunction; | 1128 opcode = kArchTailCallJSFunction; |
1133 break; | 1129 break; |
1134 default: | 1130 default: |
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1661 if (CpuFeatures::IsSupported(SSE4_1)) { | 1657 if (CpuFeatures::IsSupported(SSE4_1)) { |
1662 flags |= MachineOperatorBuilder::kFloat64RoundDown | | 1658 flags |= MachineOperatorBuilder::kFloat64RoundDown | |
1663 MachineOperatorBuilder::kFloat64RoundTruncate; | 1659 MachineOperatorBuilder::kFloat64RoundTruncate; |
1664 } | 1660 } |
1665 return flags; | 1661 return flags; |
1666 } | 1662 } |
1667 | 1663 |
1668 } // namespace compiler | 1664 } // namespace compiler |
1669 } // namespace internal | 1665 } // namespace internal |
1670 } // namespace v8 | 1666 } // namespace v8 |
OLD | NEW |