| 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/compiler/instruction-selector-impl.h" | 6 #include "src/compiler/instruction-selector-impl.h" |
| 7 #include "src/compiler/node-matchers.h" | 7 #include "src/compiler/node-matchers.h" |
| 8 #include "src/compiler/node-properties.h" | 8 #include "src/compiler/node-properties.h" |
| 9 | 9 |
| 10 namespace v8 { | 10 namespace v8 { |
| (...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 883 | 883 |
| 884 | 884 |
| 885 void InstructionSelector::VisitTailCall(Node* node) { | 885 void InstructionSelector::VisitTailCall(Node* node) { |
| 886 X87OperandGenerator g(this); | 886 X87OperandGenerator g(this); |
| 887 CallDescriptor const* descriptor = OpParameter<CallDescriptor const*>(node); | 887 CallDescriptor const* descriptor = OpParameter<CallDescriptor const*>(node); |
| 888 DCHECK_NE(0, descriptor->flags() & CallDescriptor::kSupportsTailCalls); | 888 DCHECK_NE(0, descriptor->flags() & CallDescriptor::kSupportsTailCalls); |
| 889 DCHECK_EQ(0, descriptor->flags() & CallDescriptor::kPatchableCallSite); | 889 DCHECK_EQ(0, descriptor->flags() & CallDescriptor::kPatchableCallSite); |
| 890 DCHECK_EQ(0, descriptor->flags() & CallDescriptor::kNeedsNopAfterCall); | 890 DCHECK_EQ(0, descriptor->flags() & CallDescriptor::kNeedsNopAfterCall); |
| 891 | 891 |
| 892 // TODO(turbofan): Relax restriction for stack parameters. | 892 // TODO(turbofan): Relax restriction for stack parameters. |
| 893 if (descriptor->UsesOnlyRegisters() && | 893 |
| 894 descriptor->HasSameReturnLocationsAs( | 894 if (linkage()->GetIncomingDescriptor()->CanTailCall(node)) { |
| 895 linkage()->GetIncomingDescriptor())) { | |
| 896 CallBuffer buffer(zone(), descriptor, nullptr); | 895 CallBuffer buffer(zone(), descriptor, nullptr); |
| 897 | 896 |
| 898 // Compute InstructionOperands for inputs and outputs. | 897 // Compute InstructionOperands for inputs and outputs. |
| 899 InitializeCallBuffer(node, &buffer, true, true); | 898 InitializeCallBuffer(node, &buffer, true, true); |
| 900 | 899 |
| 901 DCHECK_EQ(0u, buffer.pushed_nodes.size()); | |
| 902 | |
| 903 // Select the appropriate opcode based on the call type. | 900 // Select the appropriate opcode based on the call type. |
| 904 InstructionCode opcode; | 901 InstructionCode opcode; |
| 905 switch (descriptor->kind()) { | 902 switch (descriptor->kind()) { |
| 906 case CallDescriptor::kCallCodeObject: | 903 case CallDescriptor::kCallCodeObject: |
| 907 opcode = kArchTailCallCodeObject; | 904 opcode = kArchTailCallCodeObject; |
| 908 break; | 905 break; |
| 909 case CallDescriptor::kCallJSFunction: | 906 case CallDescriptor::kCallJSFunction: |
| 910 opcode = kArchTailCallJSFunction; | 907 opcode = kArchTailCallJSFunction; |
| 911 break; | 908 break; |
| 912 default: | 909 default: |
| (...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1332 MachineOperatorBuilder::kFloat32Min | | 1329 MachineOperatorBuilder::kFloat32Min | |
| 1333 MachineOperatorBuilder::kFloat64Max | | 1330 MachineOperatorBuilder::kFloat64Max | |
| 1334 MachineOperatorBuilder::kFloat64Min | | 1331 MachineOperatorBuilder::kFloat64Min | |
| 1335 MachineOperatorBuilder::kWord32ShiftIsSafe; | 1332 MachineOperatorBuilder::kWord32ShiftIsSafe; |
| 1336 return flags; | 1333 return flags; |
| 1337 } | 1334 } |
| 1338 | 1335 |
| 1339 } // namespace compiler | 1336 } // namespace compiler |
| 1340 } // namespace internal | 1337 } // namespace internal |
| 1341 } // namespace v8 | 1338 } // namespace v8 |
| OLD | NEW |