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 1502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1513 | 1513 |
1514 | 1514 |
1515 void InstructionSelector::VisitTailCall(Node* node) { | 1515 void InstructionSelector::VisitTailCall(Node* node) { |
1516 PPCOperandGenerator g(this); | 1516 PPCOperandGenerator g(this); |
1517 CallDescriptor const* descriptor = OpParameter<CallDescriptor const*>(node); | 1517 CallDescriptor const* descriptor = OpParameter<CallDescriptor const*>(node); |
1518 DCHECK_NE(0, descriptor->flags() & CallDescriptor::kSupportsTailCalls); | 1518 DCHECK_NE(0, descriptor->flags() & CallDescriptor::kSupportsTailCalls); |
1519 DCHECK_EQ(0, descriptor->flags() & CallDescriptor::kPatchableCallSite); | 1519 DCHECK_EQ(0, descriptor->flags() & CallDescriptor::kPatchableCallSite); |
1520 DCHECK_EQ(0, descriptor->flags() & CallDescriptor::kNeedsNopAfterCall); | 1520 DCHECK_EQ(0, descriptor->flags() & CallDescriptor::kNeedsNopAfterCall); |
1521 | 1521 |
1522 // TODO(turbofan): Relax restriction for stack parameters. | 1522 // TODO(turbofan): Relax restriction for stack parameters. |
1523 if (descriptor->UsesOnlyRegisters() && | 1523 if (linkage()->GetIncomingDescriptor()->CanTailCall(node)) { |
1524 descriptor->HasSameReturnLocationsAs( | |
1525 linkage()->GetIncomingDescriptor())) { | |
1526 CallBuffer buffer(zone(), descriptor, nullptr); | 1524 CallBuffer buffer(zone(), descriptor, nullptr); |
1527 | 1525 |
1528 // Compute InstructionOperands for inputs and outputs. | 1526 // Compute InstructionOperands for inputs and outputs. |
1529 // TODO(turbofan): on PPC it's probably better to use the code object in a | 1527 // TODO(turbofan): on PPC it's probably better to use the code object in a |
1530 // register if there are multiple uses of it. Improve constant pool and the | 1528 // register if there are multiple uses of it. Improve constant pool and the |
1531 // heuristics in the register allocator for where to emit constants. | 1529 // heuristics in the register allocator for where to emit constants. |
1532 InitializeCallBuffer(node, &buffer, true, false); | 1530 InitializeCallBuffer(node, &buffer, true, false); |
1533 | 1531 |
1534 DCHECK_EQ(0u, buffer.pushed_nodes.size()); | |
1535 | |
1536 // Select the appropriate opcode based on the call type. | 1532 // Select the appropriate opcode based on the call type. |
1537 InstructionCode opcode; | 1533 InstructionCode opcode; |
1538 switch (descriptor->kind()) { | 1534 switch (descriptor->kind()) { |
1539 case CallDescriptor::kCallCodeObject: | 1535 case CallDescriptor::kCallCodeObject: |
1540 opcode = kArchTailCallCodeObject; | 1536 opcode = kArchTailCallCodeObject; |
1541 break; | 1537 break; |
1542 case CallDescriptor::kCallJSFunction: | 1538 case CallDescriptor::kCallJSFunction: |
1543 opcode = kArchTailCallJSFunction; | 1539 opcode = kArchTailCallJSFunction; |
1544 break; | 1540 break; |
1545 default: | 1541 default: |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1648 InstructionSelector::SupportedMachineOperatorFlags() { | 1644 InstructionSelector::SupportedMachineOperatorFlags() { |
1649 return MachineOperatorBuilder::kFloat64RoundDown | | 1645 return MachineOperatorBuilder::kFloat64RoundDown | |
1650 MachineOperatorBuilder::kFloat64RoundTruncate | | 1646 MachineOperatorBuilder::kFloat64RoundTruncate | |
1651 MachineOperatorBuilder::kFloat64RoundTiesAway; | 1647 MachineOperatorBuilder::kFloat64RoundTiesAway; |
1652 // We omit kWord32ShiftIsSafe as s[rl]w use 0x3f as a mask rather than 0x1f. | 1648 // We omit kWord32ShiftIsSafe as s[rl]w use 0x3f as a mask rather than 0x1f. |
1653 } | 1649 } |
1654 | 1650 |
1655 } // namespace compiler | 1651 } // namespace compiler |
1656 } // namespace internal | 1652 } // namespace internal |
1657 } // namespace v8 | 1653 } // namespace v8 |
OLD | NEW |