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 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
582 | 582 |
583 | 583 |
584 void InstructionSelector::VisitTailCall(Node* node) { | 584 void InstructionSelector::VisitTailCall(Node* node) { |
585 MipsOperandGenerator g(this); | 585 MipsOperandGenerator g(this); |
586 const CallDescriptor* descriptor = OpParameter<const CallDescriptor*>(node); | 586 const CallDescriptor* descriptor = OpParameter<const CallDescriptor*>(node); |
587 DCHECK_NE(0, descriptor->flags() & CallDescriptor::kSupportsTailCalls); | 587 DCHECK_NE(0, descriptor->flags() & CallDescriptor::kSupportsTailCalls); |
588 DCHECK_EQ(0, descriptor->flags() & CallDescriptor::kPatchableCallSite); | 588 DCHECK_EQ(0, descriptor->flags() & CallDescriptor::kPatchableCallSite); |
589 DCHECK_EQ(0, descriptor->flags() & CallDescriptor::kNeedsNopAfterCall); | 589 DCHECK_EQ(0, descriptor->flags() & CallDescriptor::kNeedsNopAfterCall); |
590 | 590 |
591 // TODO(turbofan): Relax restriction for stack parameters. | 591 // TODO(turbofan): Relax restriction for stack parameters. |
592 if (descriptor->UsesOnlyRegisters() && | 592 if (linkage()->GetIncomingDescriptor()->CanTailCall(node)) { |
593 descriptor->HasSameReturnLocationsAs( | |
594 linkage()->GetIncomingDescriptor())) { | |
595 CallBuffer buffer(zone(), descriptor, nullptr); | 593 CallBuffer buffer(zone(), descriptor, nullptr); |
596 | 594 |
597 // Compute InstructionOperands for inputs and outputs. | 595 // Compute InstructionOperands for inputs and outputs. |
598 InitializeCallBuffer(node, &buffer, true, false); | 596 InitializeCallBuffer(node, &buffer, true, false); |
599 | 597 |
600 DCHECK_EQ(0u, buffer.pushed_nodes.size()); | |
601 | |
602 // Select the appropriate opcode based on the call type. | 598 // Select the appropriate opcode based on the call type. |
603 InstructionCode opcode; | 599 InstructionCode opcode; |
604 switch (descriptor->kind()) { | 600 switch (descriptor->kind()) { |
605 case CallDescriptor::kCallCodeObject: | 601 case CallDescriptor::kCallCodeObject: |
606 opcode = kArchTailCallCodeObject; | 602 opcode = kArchTailCallCodeObject; |
607 break; | 603 break; |
608 case CallDescriptor::kCallJSFunction: | 604 case CallDescriptor::kCallJSFunction: |
609 opcode = kArchTailCallJSFunction; | 605 opcode = kArchTailCallJSFunction; |
610 break; | 606 break; |
611 default: | 607 default: |
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1087 IsFp64Mode()) { | 1083 IsFp64Mode()) { |
1088 flags |= MachineOperatorBuilder::kFloat64RoundDown | | 1084 flags |= MachineOperatorBuilder::kFloat64RoundDown | |
1089 MachineOperatorBuilder::kFloat64RoundTruncate; | 1085 MachineOperatorBuilder::kFloat64RoundTruncate; |
1090 } | 1086 } |
1091 return flags; | 1087 return flags; |
1092 } | 1088 } |
1093 | 1089 |
1094 } // namespace compiler | 1090 } // namespace compiler |
1095 } // namespace internal | 1091 } // namespace internal |
1096 } // namespace v8 | 1092 } // namespace v8 |
OLD | NEW |