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 804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
815 } | 815 } |
816 } | 816 } |
817 | 817 |
818 | 818 |
819 void InstructionSelector::VisitProjection(Node* node) { | 819 void InstructionSelector::VisitProjection(Node* node) { |
820 OperandGenerator g(this); | 820 OperandGenerator g(this); |
821 Node* value = node->InputAt(0); | 821 Node* value = node->InputAt(0); |
822 switch (value->opcode()) { | 822 switch (value->opcode()) { |
823 case IrOpcode::kInt32AddWithOverflow: | 823 case IrOpcode::kInt32AddWithOverflow: |
824 case IrOpcode::kInt32SubWithOverflow: | 824 case IrOpcode::kInt32SubWithOverflow: |
825 if (OpParameter<int>(node) == 0) { | 825 if (OpParameter<size_t>(node) == 0) { |
826 Emit(kArchNop, g.DefineSameAsFirst(node), g.Use(value)); | 826 Emit(kArchNop, g.DefineSameAsFirst(node), g.Use(value)); |
827 } else { | 827 } else { |
828 DCHECK_EQ(1, OpParameter<int>(node)); | 828 DCHECK(OpParameter<size_t>(node) == 1u); |
829 MarkAsUsed(value); | 829 MarkAsUsed(value); |
830 } | 830 } |
831 break; | 831 break; |
832 default: | 832 default: |
833 break; | 833 break; |
834 } | 834 } |
835 } | 835 } |
836 | 836 |
837 | 837 |
838 void InstructionSelector::VisitConstant(Node* node) { | 838 void InstructionSelector::VisitConstant(Node* node) { |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
926 return VisitFloat64Compare(value, &cont); | 926 return VisitFloat64Compare(value, &cont); |
927 case IrOpcode::kFloat64LessThan: | 927 case IrOpcode::kFloat64LessThan: |
928 cont.OverwriteAndNegateIfEqual(kUnorderedLessThan); | 928 cont.OverwriteAndNegateIfEqual(kUnorderedLessThan); |
929 return VisitFloat64Compare(value, &cont); | 929 return VisitFloat64Compare(value, &cont); |
930 case IrOpcode::kFloat64LessThanOrEqual: | 930 case IrOpcode::kFloat64LessThanOrEqual: |
931 cont.OverwriteAndNegateIfEqual(kUnorderedLessThanOrEqual); | 931 cont.OverwriteAndNegateIfEqual(kUnorderedLessThanOrEqual); |
932 return VisitFloat64Compare(value, &cont); | 932 return VisitFloat64Compare(value, &cont); |
933 case IrOpcode::kProjection: | 933 case IrOpcode::kProjection: |
934 // Check if this is the overflow output projection of an | 934 // Check if this is the overflow output projection of an |
935 // <Operation>WithOverflow node. | 935 // <Operation>WithOverflow node. |
936 if (OpParameter<int>(value) == 1) { | 936 if (OpParameter<size_t>(value) == 1u) { |
937 // We cannot combine the <Operation>WithOverflow with this branch | 937 // We cannot combine the <Operation>WithOverflow with this branch |
938 // unless the 0th projection (the use of the actual value of the | 938 // unless the 0th projection (the use of the actual value of the |
939 // <Operation> is either NULL, which means there's no use of the | 939 // <Operation> is either NULL, which means there's no use of the |
940 // actual value, or was already defined, which means it is scheduled | 940 // actual value, or was already defined, which means it is scheduled |
941 // *AFTER* this branch). | 941 // *AFTER* this branch). |
942 Node* node = value->InputAt(0); | 942 Node* node = value->InputAt(0); |
943 Node* result = node->FindProjection(0); | 943 Node* result = node->FindProjection(0); |
944 if (result == NULL || IsDefined(result)) { | 944 if (result == NULL || IsDefined(result)) { |
945 switch (node->opcode()) { | 945 switch (node->opcode()) { |
946 case IrOpcode::kInt32AddWithOverflow: | 946 case IrOpcode::kInt32AddWithOverflow: |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1088 | 1088 |
1089 | 1089 |
1090 void InstructionSelector::VisitCall(Node* call, BasicBlock* continuation, | 1090 void InstructionSelector::VisitCall(Node* call, BasicBlock* continuation, |
1091 BasicBlock* deoptimization) {} | 1091 BasicBlock* deoptimization) {} |
1092 | 1092 |
1093 #endif // !V8_TURBOFAN_BACKEND | 1093 #endif // !V8_TURBOFAN_BACKEND |
1094 | 1094 |
1095 } // namespace compiler | 1095 } // namespace compiler |
1096 } // namespace internal | 1096 } // namespace internal |
1097 } // namespace v8 | 1097 } // namespace v8 |
OLD | NEW |