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 745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
756 void InstructionSelector::VisitFloat32RoundTiesEven(Node* node) { | 756 void InstructionSelector::VisitFloat32RoundTiesEven(Node* node) { |
757 VisitRR(this, kMipsFloat32RoundTiesEven, node); | 757 VisitRR(this, kMipsFloat32RoundTiesEven, node); |
758 } | 758 } |
759 | 759 |
760 | 760 |
761 void InstructionSelector::VisitFloat64RoundTiesEven(Node* node) { | 761 void InstructionSelector::VisitFloat64RoundTiesEven(Node* node) { |
762 VisitRR(this, kMipsFloat64RoundTiesEven, node); | 762 VisitRR(this, kMipsFloat64RoundTiesEven, node); |
763 } | 763 } |
764 | 764 |
765 | 765 |
766 void InstructionSelector::EmitPrepareArguments(NodeVector* arguments, | 766 void InstructionSelector::EmitPrepareArguments( |
767 const CallDescriptor* descriptor, | 767 ZoneVector<PushParameter>* arguments, const CallDescriptor* descriptor, |
768 Node* node) { | 768 Node* node) { |
769 MipsOperandGenerator g(this); | 769 MipsOperandGenerator g(this); |
770 | 770 |
771 // Prepare for C function call. | 771 // Prepare for C function call. |
772 if (descriptor->IsCFunctionCall()) { | 772 if (descriptor->IsCFunctionCall()) { |
773 Emit(kArchPrepareCallCFunction | | 773 Emit(kArchPrepareCallCFunction | |
774 MiscField::encode(static_cast<int>(descriptor->CParameterCount())), | 774 MiscField::encode(static_cast<int>(descriptor->CParameterCount())), |
775 0, nullptr, 0, nullptr); | 775 0, nullptr, 0, nullptr); |
776 | 776 |
777 // Poke any stack arguments. | 777 // Poke any stack arguments. |
778 int slot = kCArgSlotCount; | 778 int slot = kCArgSlotCount; |
779 for (Node* input : (*arguments)) { | 779 for (PushParameter input : (*arguments)) { |
780 Emit(kMipsStoreToStackSlot, g.NoOutput(), g.UseRegister(input), | 780 Emit(kMipsStoreToStackSlot, g.NoOutput(), g.UseRegister(input.node()), |
781 g.TempImmediate(slot << kPointerSizeLog2)); | 781 g.TempImmediate(slot << kPointerSizeLog2)); |
782 ++slot; | 782 ++slot; |
783 } | 783 } |
784 } else { | 784 } else { |
785 // Possibly align stack here for functions. | 785 // Possibly align stack here for functions. |
786 int push_count = static_cast<int>(descriptor->StackParameterCount()); | 786 int push_count = static_cast<int>(descriptor->StackParameterCount()); |
787 if (push_count > 0) { | 787 if (push_count > 0) { |
788 Emit(kMipsStackClaim, g.NoOutput(), | 788 Emit(kMipsStackClaim, g.NoOutput(), |
789 g.TempImmediate(push_count << kPointerSizeLog2)); | 789 g.TempImmediate(push_count << kPointerSizeLog2)); |
790 } | 790 } |
791 for (size_t n = 0; n < arguments->size(); ++n) { | 791 for (size_t n = 0; n < arguments->size(); ++n) { |
792 if (Node* input = (*arguments)[n]) { | 792 PushParameter input = (*arguments)[n]; |
793 Emit(kMipsStoreToStackSlot, g.NoOutput(), g.UseRegister(input), | 793 if (input.node()) { |
| 794 Emit(kMipsStoreToStackSlot, g.NoOutput(), g.UseRegister(input.node()), |
794 g.TempImmediate(n << kPointerSizeLog2)); | 795 g.TempImmediate(n << kPointerSizeLog2)); |
795 } | 796 } |
796 } | 797 } |
797 } | 798 } |
798 } | 799 } |
799 | 800 |
800 | 801 |
801 bool InstructionSelector::IsTailCallAddressImmediate() { return false; } | 802 bool InstructionSelector::IsTailCallAddressImmediate() { return false; } |
802 | 803 |
803 | 804 |
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1279 MachineOperatorBuilder::kFloat32Max | | 1280 MachineOperatorBuilder::kFloat32Max | |
1280 MachineOperatorBuilder::kFloat32RoundDown | | 1281 MachineOperatorBuilder::kFloat32RoundDown | |
1281 MachineOperatorBuilder::kFloat32RoundUp | | 1282 MachineOperatorBuilder::kFloat32RoundUp | |
1282 MachineOperatorBuilder::kFloat32RoundTruncate | | 1283 MachineOperatorBuilder::kFloat32RoundTruncate | |
1283 MachineOperatorBuilder::kFloat32RoundTiesEven; | 1284 MachineOperatorBuilder::kFloat32RoundTiesEven; |
1284 } | 1285 } |
1285 | 1286 |
1286 } // namespace compiler | 1287 } // namespace compiler |
1287 } // namespace internal | 1288 } // namespace internal |
1288 } // namespace v8 | 1289 } // namespace v8 |
OLD | NEW |