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/compiler/instruction-selector-impl.h" | 5 #include "src/compiler/instruction-selector-impl.h" |
6 #include "src/compiler/node-matchers.h" | 6 #include "src/compiler/node-matchers.h" |
7 #include "src/compiler/node-properties.h" | 7 #include "src/compiler/node-properties.h" |
8 | 8 |
9 namespace v8 { | 9 namespace v8 { |
10 namespace internal { | 10 namespace internal { |
(...skipping 1434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1445 | 1445 |
1446 | 1446 |
1447 void InstructionSelector::VisitTailCall(Node* node) { | 1447 void InstructionSelector::VisitTailCall(Node* node) { |
1448 Arm64OperandGenerator g(this); | 1448 Arm64OperandGenerator g(this); |
1449 const CallDescriptor* descriptor = OpParameter<const CallDescriptor*>(node); | 1449 const CallDescriptor* descriptor = OpParameter<const CallDescriptor*>(node); |
1450 DCHECK_NE(0, descriptor->flags() & CallDescriptor::kSupportsTailCalls); | 1450 DCHECK_NE(0, descriptor->flags() & CallDescriptor::kSupportsTailCalls); |
1451 DCHECK_EQ(0, descriptor->flags() & CallDescriptor::kPatchableCallSite); | 1451 DCHECK_EQ(0, descriptor->flags() & CallDescriptor::kPatchableCallSite); |
1452 DCHECK_EQ(0, descriptor->flags() & CallDescriptor::kNeedsNopAfterCall); | 1452 DCHECK_EQ(0, descriptor->flags() & CallDescriptor::kNeedsNopAfterCall); |
1453 | 1453 |
1454 // TODO(turbofan): Relax restriction for stack parameters. | 1454 // TODO(turbofan): Relax restriction for stack parameters. |
1455 if (descriptor->UsesOnlyRegisters() && | 1455 if (linkage()->GetIncomingDescriptor()->CanTailCall(node)) { |
1456 descriptor->HasSameReturnLocationsAs( | |
1457 linkage()->GetIncomingDescriptor())) { | |
1458 CallBuffer buffer(zone(), descriptor, nullptr); | 1456 CallBuffer buffer(zone(), descriptor, nullptr); |
1459 | 1457 |
1460 // Compute InstructionOperands for inputs and outputs. | 1458 // Compute InstructionOperands for inputs and outputs. |
1461 // TODO(turbofan): on ARM64 it's probably better to use the code object in a | 1459 // TODO(turbofan): on ARM64 it's probably better to use the code object in a |
1462 // register if there are multiple uses of it. Improve constant pool and the | 1460 // register if there are multiple uses of it. Improve constant pool and the |
1463 // heuristics in the register allocator for where to emit constants. | 1461 // heuristics in the register allocator for where to emit constants. |
1464 InitializeCallBuffer(node, &buffer, true, false); | 1462 InitializeCallBuffer(node, &buffer, true, false); |
1465 | 1463 |
1466 DCHECK_EQ(0u, buffer.pushed_nodes.size()); | |
1467 | |
1468 // Select the appropriate opcode based on the call type. | 1464 // Select the appropriate opcode based on the call type. |
1469 InstructionCode opcode; | 1465 InstructionCode opcode; |
1470 switch (descriptor->kind()) { | 1466 switch (descriptor->kind()) { |
1471 case CallDescriptor::kCallCodeObject: | 1467 case CallDescriptor::kCallCodeObject: |
1472 opcode = kArchTailCallCodeObject; | 1468 opcode = kArchTailCallCodeObject; |
1473 break; | 1469 break; |
1474 case CallDescriptor::kCallJSFunction: | 1470 case CallDescriptor::kCallJSFunction: |
1475 opcode = kArchTailCallJSFunction; | 1471 opcode = kArchTailCallJSFunction; |
1476 break; | 1472 break; |
1477 default: | 1473 default: |
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2036 MachineOperatorBuilder::kFloat64RoundTruncate | | 2032 MachineOperatorBuilder::kFloat64RoundTruncate | |
2037 MachineOperatorBuilder::kFloat64RoundTiesAway | | 2033 MachineOperatorBuilder::kFloat64RoundTiesAway | |
2038 MachineOperatorBuilder::kWord32ShiftIsSafe | | 2034 MachineOperatorBuilder::kWord32ShiftIsSafe | |
2039 MachineOperatorBuilder::kInt32DivIsSafe | | 2035 MachineOperatorBuilder::kInt32DivIsSafe | |
2040 MachineOperatorBuilder::kUint32DivIsSafe; | 2036 MachineOperatorBuilder::kUint32DivIsSafe; |
2041 } | 2037 } |
2042 | 2038 |
2043 } // namespace compiler | 2039 } // namespace compiler |
2044 } // namespace internal | 2040 } // namespace internal |
2045 } // namespace v8 | 2041 } // namespace v8 |
OLD | NEW |