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.h" | 5 #include "src/compiler/instruction-selector.h" |
6 | 6 |
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-inl.h" | 9 #include "src/compiler/node-properties-inl.h" |
10 #include "src/compiler/pipeline.h" | 10 #include "src/compiler/pipeline.h" |
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
597 return VisitFloat64LessThan(node); | 597 return VisitFloat64LessThan(node); |
598 case IrOpcode::kFloat64LessThanOrEqual: | 598 case IrOpcode::kFloat64LessThanOrEqual: |
599 return VisitFloat64LessThanOrEqual(node); | 599 return VisitFloat64LessThanOrEqual(node); |
600 default: | 600 default: |
601 V8_Fatal(__FILE__, __LINE__, "Unexpected operator #%d:%s @ node #%d", | 601 V8_Fatal(__FILE__, __LINE__, "Unexpected operator #%d:%s @ node #%d", |
602 node->opcode(), node->op()->mnemonic(), node->id()); | 602 node->opcode(), node->op()->mnemonic(), node->id()); |
603 } | 603 } |
604 } | 604 } |
605 | 605 |
606 | 606 |
607 #if V8_TURBOFAN_TARGET | 607 #if V8_TURBOFAN_BACKEND |
608 | 608 |
609 void InstructionSelector::VisitWord32Equal(Node* node) { | 609 void InstructionSelector::VisitWord32Equal(Node* node) { |
610 FlagsContinuation cont(kEqual, node); | 610 FlagsContinuation cont(kEqual, node); |
611 Int32BinopMatcher m(node); | 611 Int32BinopMatcher m(node); |
612 if (m.right().Is(0)) { | 612 if (m.right().Is(0)) { |
613 return VisitWord32Test(m.left().node(), &cont); | 613 return VisitWord32Test(m.left().node(), &cont); |
614 } | 614 } |
615 VisitWord32Compare(node, &cont); | 615 VisitWord32Compare(node, &cont); |
616 } | 616 } |
617 | 617 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
692 FlagsContinuation cont(kUnorderedLessThan, node); | 692 FlagsContinuation cont(kUnorderedLessThan, node); |
693 VisitFloat64Compare(node, &cont); | 693 VisitFloat64Compare(node, &cont); |
694 } | 694 } |
695 | 695 |
696 | 696 |
697 void InstructionSelector::VisitFloat64LessThanOrEqual(Node* node) { | 697 void InstructionSelector::VisitFloat64LessThanOrEqual(Node* node) { |
698 FlagsContinuation cont(kUnorderedLessThanOrEqual, node); | 698 FlagsContinuation cont(kUnorderedLessThanOrEqual, node); |
699 VisitFloat64Compare(node, &cont); | 699 VisitFloat64Compare(node, &cont); |
700 } | 700 } |
701 | 701 |
702 #endif // V8_TURBOFAN_TARGET | 702 #endif // V8_TURBOFAN_BACKEND |
703 | 703 |
704 // 32 bit targets do not implement the following instructions. | 704 // 32 bit targets do not implement the following instructions. |
705 #if V8_TARGET_ARCH_32_BIT && V8_TURBOFAN_TARGET | 705 #if V8_TARGET_ARCH_32_BIT && V8_TURBOFAN_BACKEND |
706 | 706 |
707 void InstructionSelector::VisitWord64And(Node* node) { UNIMPLEMENTED(); } | 707 void InstructionSelector::VisitWord64And(Node* node) { UNIMPLEMENTED(); } |
708 | 708 |
709 | 709 |
710 void InstructionSelector::VisitWord64Or(Node* node) { UNIMPLEMENTED(); } | 710 void InstructionSelector::VisitWord64Or(Node* node) { UNIMPLEMENTED(); } |
711 | 711 |
712 | 712 |
713 void InstructionSelector::VisitWord64Xor(Node* node) { UNIMPLEMENTED(); } | 713 void InstructionSelector::VisitWord64Xor(Node* node) { UNIMPLEMENTED(); } |
714 | 714 |
715 | 715 |
(...skipping 29 matching lines...) Expand all Loading... |
745 | 745 |
746 void InstructionSelector::VisitConvertInt64ToInt32(Node* node) { | 746 void InstructionSelector::VisitConvertInt64ToInt32(Node* node) { |
747 UNIMPLEMENTED(); | 747 UNIMPLEMENTED(); |
748 } | 748 } |
749 | 749 |
750 | 750 |
751 void InstructionSelector::VisitConvertInt32ToInt64(Node* node) { | 751 void InstructionSelector::VisitConvertInt32ToInt64(Node* node) { |
752 UNIMPLEMENTED(); | 752 UNIMPLEMENTED(); |
753 } | 753 } |
754 | 754 |
755 #endif // V8_TARGET_ARCH_32_BIT && V8_TURBOFAN_TARGET | 755 #endif // V8_TARGET_ARCH_32_BIT && V8_TURBOFAN_BACKEND |
756 | 756 |
757 | 757 |
758 // 32-bit targets and unsupported architectures need dummy implementations of | 758 // 32-bit targets and unsupported architectures need dummy implementations of |
759 // selected 64-bit ops. | 759 // selected 64-bit ops. |
760 #if V8_TARGET_ARCH_32_BIT || !V8_TURBOFAN_TARGET | 760 #if V8_TARGET_ARCH_32_BIT || !V8_TURBOFAN_BACKEND |
761 | 761 |
762 void InstructionSelector::VisitWord64Test(Node* node, FlagsContinuation* cont) { | 762 void InstructionSelector::VisitWord64Test(Node* node, FlagsContinuation* cont) { |
763 UNIMPLEMENTED(); | 763 UNIMPLEMENTED(); |
764 } | 764 } |
765 | 765 |
766 | 766 |
767 void InstructionSelector::VisitWord64Compare(Node* node, | 767 void InstructionSelector::VisitWord64Compare(Node* node, |
768 FlagsContinuation* cont) { | 768 FlagsContinuation* cont) { |
769 UNIMPLEMENTED(); | 769 UNIMPLEMENTED(); |
770 } | 770 } |
771 | 771 |
772 #endif // V8_TARGET_ARCH_32_BIT || !V8_TURBOFAN_TARGET | 772 #endif // V8_TARGET_ARCH_32_BIT || !V8_TURBOFAN_BACKEND |
773 | 773 |
774 | 774 |
775 void InstructionSelector::VisitParameter(Node* node) { | 775 void InstructionSelector::VisitParameter(Node* node) { |
776 OperandGenerator g(this); | 776 OperandGenerator g(this); |
777 Emit(kArchNop, g.DefineAsLocation(node, linkage()->GetParameterLocation( | 777 Emit(kArchNop, g.DefineAsLocation(node, linkage()->GetParameterLocation( |
778 OpParameter<int>(node)))); | 778 OpParameter<int>(node)))); |
779 } | 779 } |
780 | 780 |
781 | 781 |
782 void InstructionSelector::VisitPhi(Node* node) { | 782 void InstructionSelector::VisitPhi(Node* node) { |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
956 Node* state = deopt->InputAt(0); | 956 Node* state = deopt->InputAt(0); |
957 DCHECK(state->op()->opcode() == IrOpcode::kFrameState); | 957 DCHECK(state->op()->opcode() == IrOpcode::kFrameState); |
958 FrameStateDescriptor descriptor = OpParameter<FrameStateDescriptor>(state); | 958 FrameStateDescriptor descriptor = OpParameter<FrameStateDescriptor>(state); |
959 // TODO(jarin) We should also add an instruction input for every input to | 959 // TODO(jarin) We should also add an instruction input for every input to |
960 // the framestate node (and recurse for the inlined framestates). | 960 // the framestate node (and recurse for the inlined framestates). |
961 int deoptimization_id = sequence()->AddDeoptimizationEntry(descriptor); | 961 int deoptimization_id = sequence()->AddDeoptimizationEntry(descriptor); |
962 Emit(kArchDeoptimize | MiscField::encode(deoptimization_id), NULL); | 962 Emit(kArchDeoptimize | MiscField::encode(deoptimization_id), NULL); |
963 } | 963 } |
964 | 964 |
965 | 965 |
966 #if !V8_TURBOFAN_TARGET | 966 #if !V8_TURBOFAN_BACKEND |
967 | 967 |
968 #define DECLARE_UNIMPLEMENTED_SELECTOR(x) \ | 968 #define DECLARE_UNIMPLEMENTED_SELECTOR(x) \ |
969 void InstructionSelector::Visit##x(Node* node) { UNIMPLEMENTED(); } | 969 void InstructionSelector::Visit##x(Node* node) { UNIMPLEMENTED(); } |
970 MACHINE_OP_LIST(DECLARE_UNIMPLEMENTED_SELECTOR) | 970 MACHINE_OP_LIST(DECLARE_UNIMPLEMENTED_SELECTOR) |
971 #undef DECLARE_UNIMPLEMENTED_SELECTOR | 971 #undef DECLARE_UNIMPLEMENTED_SELECTOR |
972 | 972 |
973 | 973 |
974 void InstructionSelector::VisitInt32AddWithOverflow(Node* node, | 974 void InstructionSelector::VisitInt32AddWithOverflow(Node* node, |
975 FlagsContinuation* cont) { | 975 FlagsContinuation* cont) { |
976 UNIMPLEMENTED(); | 976 UNIMPLEMENTED(); |
(...skipping 19 matching lines...) Expand all Loading... |
996 | 996 |
997 void InstructionSelector::VisitFloat64Compare(Node* node, | 997 void InstructionSelector::VisitFloat64Compare(Node* node, |
998 FlagsContinuation* cont) { | 998 FlagsContinuation* cont) { |
999 UNIMPLEMENTED(); | 999 UNIMPLEMENTED(); |
1000 } | 1000 } |
1001 | 1001 |
1002 | 1002 |
1003 void InstructionSelector::VisitCall(Node* call, BasicBlock* continuation, | 1003 void InstructionSelector::VisitCall(Node* call, BasicBlock* continuation, |
1004 BasicBlock* deoptimization) {} | 1004 BasicBlock* deoptimization) {} |
1005 | 1005 |
1006 #endif // !V8_TURBOFAN_TARGET | 1006 #endif // !V8_TURBOFAN_BACKEND |
1007 | 1007 |
1008 } // namespace compiler | 1008 } // namespace compiler |
1009 } // namespace internal | 1009 } // namespace internal |
1010 } // namespace v8 | 1010 } // namespace v8 |
OLD | NEW |