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/compiler/instruction-selector-impl.h" | 9 #include "src/compiler/instruction-selector-impl.h" |
10 #include "src/compiler/node-matchers.h" | 10 #include "src/compiler/node-matchers.h" |
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
589 } | 589 } |
590 } | 590 } |
591 switch (node->opcode()) { | 591 switch (node->opcode()) { |
592 case IrOpcode::kStart: | 592 case IrOpcode::kStart: |
593 case IrOpcode::kLoop: | 593 case IrOpcode::kLoop: |
594 case IrOpcode::kEnd: | 594 case IrOpcode::kEnd: |
595 case IrOpcode::kBranch: | 595 case IrOpcode::kBranch: |
596 case IrOpcode::kIfTrue: | 596 case IrOpcode::kIfTrue: |
597 case IrOpcode::kIfFalse: | 597 case IrOpcode::kIfFalse: |
598 case IrOpcode::kIfSuccess: | 598 case IrOpcode::kIfSuccess: |
599 case IrOpcode::kIfException: | |
600 case IrOpcode::kSwitch: | 599 case IrOpcode::kSwitch: |
601 case IrOpcode::kIfValue: | 600 case IrOpcode::kIfValue: |
602 case IrOpcode::kIfDefault: | 601 case IrOpcode::kIfDefault: |
603 case IrOpcode::kEffectPhi: | 602 case IrOpcode::kEffectPhi: |
604 case IrOpcode::kMerge: | 603 case IrOpcode::kMerge: |
605 // No code needed for these graph artifacts. | 604 // No code needed for these graph artifacts. |
606 return; | 605 return; |
| 606 case IrOpcode::kIfException: |
| 607 return MarkAsReference(node), VisitIfException(node); |
607 case IrOpcode::kFinish: | 608 case IrOpcode::kFinish: |
608 return MarkAsReference(node), VisitFinish(node); | 609 return MarkAsReference(node), VisitFinish(node); |
609 case IrOpcode::kParameter: { | 610 case IrOpcode::kParameter: { |
610 MachineType type = linkage()->GetParameterType(OpParameter<int>(node)); | 611 MachineType type = linkage()->GetParameterType(OpParameter<int>(node)); |
611 MarkAsRepresentation(type, node); | 612 MarkAsRepresentation(type, node); |
612 return VisitParameter(node); | 613 return VisitParameter(node); |
613 } | 614 } |
614 case IrOpcode::kOsrValue: | 615 case IrOpcode::kOsrValue: |
615 return MarkAsReference(node), VisitOsrValue(node); | 616 return MarkAsReference(node), VisitOsrValue(node); |
616 case IrOpcode::kPhi: { | 617 case IrOpcode::kPhi: { |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
962 | 963 |
963 void InstructionSelector::VisitParameter(Node* node) { | 964 void InstructionSelector::VisitParameter(Node* node) { |
964 OperandGenerator g(this); | 965 OperandGenerator g(this); |
965 int index = OpParameter<int>(node); | 966 int index = OpParameter<int>(node); |
966 Emit(kArchNop, | 967 Emit(kArchNop, |
967 g.DefineAsLocation(node, linkage()->GetParameterLocation(index), | 968 g.DefineAsLocation(node, linkage()->GetParameterLocation(index), |
968 linkage()->GetParameterType(index))); | 969 linkage()->GetParameterType(index))); |
969 } | 970 } |
970 | 971 |
971 | 972 |
| 973 void InstructionSelector::VisitIfException(Node* node) { |
| 974 OperandGenerator g(this); |
| 975 Node* call = node->InputAt(0); |
| 976 DCHECK_EQ(IrOpcode::kCall, call->opcode()); |
| 977 const CallDescriptor* descriptor = OpParameter<const CallDescriptor*>(call); |
| 978 Emit(kArchNop, g.DefineAsLocation(node, descriptor->GetReturnLocation(0), |
| 979 descriptor->GetReturnType(0))); |
| 980 } |
| 981 |
| 982 |
972 void InstructionSelector::VisitOsrValue(Node* node) { | 983 void InstructionSelector::VisitOsrValue(Node* node) { |
973 OperandGenerator g(this); | 984 OperandGenerator g(this); |
974 int index = OpParameter<int>(node); | 985 int index = OpParameter<int>(node); |
975 Emit(kArchNop, g.DefineAsLocation(node, linkage()->GetOsrValueLocation(index), | 986 Emit(kArchNop, g.DefineAsLocation(node, linkage()->GetOsrValueLocation(index), |
976 kMachAnyTagged)); | 987 kMachAnyTagged)); |
977 } | 988 } |
978 | 989 |
979 | 990 |
980 void InstructionSelector::VisitPhi(Node* node) { | 991 void InstructionSelector::VisitPhi(Node* node) { |
981 const int input_count = node->op()->ValueInputCount(); | 992 const int input_count = node->op()->ValueInputCount(); |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1183 MachineOperatorBuilder::Flags | 1194 MachineOperatorBuilder::Flags |
1184 InstructionSelector::SupportedMachineOperatorFlags() { | 1195 InstructionSelector::SupportedMachineOperatorFlags() { |
1185 return MachineOperatorBuilder::Flag::kNoFlags; | 1196 return MachineOperatorBuilder::Flag::kNoFlags; |
1186 } | 1197 } |
1187 | 1198 |
1188 #endif // !V8_TURBOFAN_BACKEND | 1199 #endif // !V8_TURBOFAN_BACKEND |
1189 | 1200 |
1190 } // namespace compiler | 1201 } // namespace compiler |
1191 } // namespace internal | 1202 } // namespace internal |
1192 } // namespace v8 | 1203 } // namespace v8 |
OLD | NEW |