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 <limits> | 7 #include <limits> |
8 | 8 |
9 #include "src/base/adapters.h" | 9 #include "src/base/adapters.h" |
10 #include "src/compiler/instruction-selector-impl.h" | 10 #include "src/compiler/instruction-selector-impl.h" |
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
602 case IrOpcode::kIfDefault: | 602 case IrOpcode::kIfDefault: |
603 case IrOpcode::kEffectPhi: | 603 case IrOpcode::kEffectPhi: |
604 case IrOpcode::kMerge: | 604 case IrOpcode::kMerge: |
605 // No code needed for these graph artifacts. | 605 // No code needed for these graph artifacts. |
606 return; | 606 return; |
607 case IrOpcode::kIfException: | 607 case IrOpcode::kIfException: |
608 return MarkAsReference(node), VisitIfException(node); | 608 return MarkAsReference(node), VisitIfException(node); |
609 case IrOpcode::kFinish: | 609 case IrOpcode::kFinish: |
610 return MarkAsReference(node), VisitFinish(node); | 610 return MarkAsReference(node), VisitFinish(node); |
611 case IrOpcode::kParameter: { | 611 case IrOpcode::kParameter: { |
612 MachineType type = linkage()->GetParameterType(OpParameter<int>(node)); | 612 MachineType type = |
| 613 linkage()->GetParameterType(ParameterIndexOf(node->op())); |
613 MarkAsRepresentation(type, node); | 614 MarkAsRepresentation(type, node); |
614 return VisitParameter(node); | 615 return VisitParameter(node); |
615 } | 616 } |
616 case IrOpcode::kOsrValue: | 617 case IrOpcode::kOsrValue: |
617 return MarkAsReference(node), VisitOsrValue(node); | 618 return MarkAsReference(node), VisitOsrValue(node); |
618 case IrOpcode::kPhi: { | 619 case IrOpcode::kPhi: { |
619 MachineType type = OpParameter<MachineType>(node); | 620 MachineType type = OpParameter<MachineType>(node); |
620 MarkAsRepresentation(type, node); | 621 MarkAsRepresentation(type, node); |
621 return VisitPhi(node); | 622 return VisitPhi(node); |
622 } | 623 } |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
961 | 962 |
962 void InstructionSelector::VisitFinish(Node* node) { | 963 void InstructionSelector::VisitFinish(Node* node) { |
963 OperandGenerator g(this); | 964 OperandGenerator g(this); |
964 Node* value = node->InputAt(0); | 965 Node* value = node->InputAt(0); |
965 Emit(kArchNop, g.DefineSameAsFirst(node), g.Use(value)); | 966 Emit(kArchNop, g.DefineSameAsFirst(node), g.Use(value)); |
966 } | 967 } |
967 | 968 |
968 | 969 |
969 void InstructionSelector::VisitParameter(Node* node) { | 970 void InstructionSelector::VisitParameter(Node* node) { |
970 OperandGenerator g(this); | 971 OperandGenerator g(this); |
971 int index = OpParameter<int>(node); | 972 int index = ParameterIndexOf(node->op()); |
972 Emit(kArchNop, | 973 Emit(kArchNop, |
973 g.DefineAsLocation(node, linkage()->GetParameterLocation(index), | 974 g.DefineAsLocation(node, linkage()->GetParameterLocation(index), |
974 linkage()->GetParameterType(index))); | 975 linkage()->GetParameterType(index))); |
975 } | 976 } |
976 | 977 |
977 | 978 |
978 void InstructionSelector::VisitIfException(Node* node) { | 979 void InstructionSelector::VisitIfException(Node* node) { |
979 OperandGenerator g(this); | 980 OperandGenerator g(this); |
980 Node* call = node->InputAt(0); | 981 Node* call = node->InputAt(0); |
981 DCHECK_EQ(IrOpcode::kCall, call->opcode()); | 982 DCHECK_EQ(IrOpcode::kCall, call->opcode()); |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1199 MachineOperatorBuilder::Flags | 1200 MachineOperatorBuilder::Flags |
1200 InstructionSelector::SupportedMachineOperatorFlags() { | 1201 InstructionSelector::SupportedMachineOperatorFlags() { |
1201 return MachineOperatorBuilder::Flag::kNoFlags; | 1202 return MachineOperatorBuilder::Flag::kNoFlags; |
1202 } | 1203 } |
1203 | 1204 |
1204 #endif // !V8_TURBOFAN_BACKEND | 1205 #endif // !V8_TURBOFAN_BACKEND |
1205 | 1206 |
1206 } // namespace compiler | 1207 } // namespace compiler |
1207 } // namespace internal | 1208 } // namespace internal |
1208 } // namespace v8 | 1209 } // namespace v8 |
OLD | NEW |