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 1148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1159 | 1159 |
1160 | 1160 |
1161 void InstructionSelector::VisitTailCall(Node* node) { | 1161 void InstructionSelector::VisitTailCall(Node* node) { |
1162 ArmOperandGenerator g(this); | 1162 ArmOperandGenerator g(this); |
1163 CallDescriptor const* descriptor = OpParameter<CallDescriptor const*>(node); | 1163 CallDescriptor const* descriptor = OpParameter<CallDescriptor const*>(node); |
1164 DCHECK_NE(0, descriptor->flags() & CallDescriptor::kSupportsTailCalls); | 1164 DCHECK_NE(0, descriptor->flags() & CallDescriptor::kSupportsTailCalls); |
1165 DCHECK_EQ(0, descriptor->flags() & CallDescriptor::kPatchableCallSite); | 1165 DCHECK_EQ(0, descriptor->flags() & CallDescriptor::kPatchableCallSite); |
1166 DCHECK_EQ(0, descriptor->flags() & CallDescriptor::kNeedsNopAfterCall); | 1166 DCHECK_EQ(0, descriptor->flags() & CallDescriptor::kNeedsNopAfterCall); |
1167 | 1167 |
1168 // TODO(turbofan): Relax restriction for stack parameters. | 1168 // TODO(turbofan): Relax restriction for stack parameters. |
1169 if (descriptor->UsesOnlyRegisters() && | 1169 if (linkage()->GetIncomingDescriptor()->CanTailCall(node)) { |
1170 descriptor->HasSameReturnLocationsAs( | |
1171 linkage()->GetIncomingDescriptor())) { | |
1172 CallBuffer buffer(zone(), descriptor, nullptr); | 1170 CallBuffer buffer(zone(), descriptor, nullptr); |
1173 | 1171 |
1174 // Compute InstructionOperands for inputs and outputs. | 1172 // Compute InstructionOperands for inputs and outputs. |
1175 // TODO(turbofan): on ARM it's probably better to use the code object in a | 1173 // TODO(turbofan): on ARM it's probably better to use the code object in a |
1176 // register if there are multiple uses of it. Improve constant pool and the | 1174 // register if there are multiple uses of it. Improve constant pool and the |
1177 // heuristics in the register allocator for where to emit constants. | 1175 // heuristics in the register allocator for where to emit constants. |
1178 InitializeCallBuffer(node, &buffer, true, false); | 1176 InitializeCallBuffer(node, &buffer, true, false); |
1179 | 1177 |
1180 DCHECK_EQ(0u, buffer.pushed_nodes.size()); | |
1181 | |
1182 // Select the appropriate opcode based on the call type. | 1178 // Select the appropriate opcode based on the call type. |
1183 InstructionCode opcode; | 1179 InstructionCode opcode; |
1184 switch (descriptor->kind()) { | 1180 switch (descriptor->kind()) { |
1185 case CallDescriptor::kCallCodeObject: | 1181 case CallDescriptor::kCallCodeObject: |
1186 opcode = kArchTailCallCodeObject; | 1182 opcode = kArchTailCallCodeObject; |
1187 break; | 1183 break; |
1188 case CallDescriptor::kCallJSFunction: | 1184 case CallDescriptor::kCallJSFunction: |
1189 opcode = kArchTailCallJSFunction; | 1185 opcode = kArchTailCallJSFunction; |
1190 break; | 1186 break; |
1191 default: | 1187 default: |
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1624 flags |= MachineOperatorBuilder::kFloat64RoundDown | | 1620 flags |= MachineOperatorBuilder::kFloat64RoundDown | |
1625 MachineOperatorBuilder::kFloat64RoundTruncate | | 1621 MachineOperatorBuilder::kFloat64RoundTruncate | |
1626 MachineOperatorBuilder::kFloat64RoundTiesAway; | 1622 MachineOperatorBuilder::kFloat64RoundTiesAway; |
1627 } | 1623 } |
1628 return flags; | 1624 return flags; |
1629 } | 1625 } |
1630 | 1626 |
1631 } // namespace compiler | 1627 } // namespace compiler |
1632 } // namespace internal | 1628 } // namespace internal |
1633 } // namespace v8 | 1629 } // namespace v8 |
OLD | NEW |