| 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.h" | 9 #include "src/compiler/node-properties.h" |
| 10 #include "src/compiler/pipeline.h" | 10 #include "src/compiler/pipeline.h" |
| (...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 514 return VisitBranch(input, tbranch, fbranch); | 514 return VisitBranch(input, tbranch, fbranch); |
| 515 } | 515 } |
| 516 case BasicBlock::kReturn: { | 516 case BasicBlock::kReturn: { |
| 517 // If the result itself is a return, return its input. | 517 // If the result itself is a return, return its input. |
| 518 Node* value = (input != NULL && input->opcode() == IrOpcode::kReturn) | 518 Node* value = (input != NULL && input->opcode() == IrOpcode::kReturn) |
| 519 ? input->InputAt(0) | 519 ? input->InputAt(0) |
| 520 : input; | 520 : input; |
| 521 return VisitReturn(value); | 521 return VisitReturn(value); |
| 522 } | 522 } |
| 523 case BasicBlock::kThrow: | 523 case BasicBlock::kThrow: |
| 524 return VisitThrow(input); | 524 DCHECK_EQ(IrOpcode::kThrow, input->opcode()); |
| 525 return VisitThrow(input->InputAt(0)); |
| 525 case BasicBlock::kNone: { | 526 case BasicBlock::kNone: { |
| 526 // TODO(titzer): exit block doesn't have control. | 527 // TODO(titzer): exit block doesn't have control. |
| 527 DCHECK(input == NULL); | 528 DCHECK(input == NULL); |
| 528 break; | 529 break; |
| 529 } | 530 } |
| 530 default: | 531 default: |
| 531 UNREACHABLE(); | 532 UNREACHABLE(); |
| 532 break; | 533 break; |
| 533 } | 534 } |
| 534 } | 535 } |
| (...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1042 if (value != NULL) { | 1043 if (value != NULL) { |
| 1043 Emit(kArchRet, NULL, g.UseLocation(value, linkage()->GetReturnLocation(), | 1044 Emit(kArchRet, NULL, g.UseLocation(value, linkage()->GetReturnLocation(), |
| 1044 linkage()->GetReturnType())); | 1045 linkage()->GetReturnType())); |
| 1045 } else { | 1046 } else { |
| 1046 Emit(kArchRet, NULL); | 1047 Emit(kArchRet, NULL); |
| 1047 } | 1048 } |
| 1048 } | 1049 } |
| 1049 | 1050 |
| 1050 | 1051 |
| 1051 void InstructionSelector::VisitThrow(Node* value) { | 1052 void InstructionSelector::VisitThrow(Node* value) { |
| 1052 UNIMPLEMENTED(); // TODO(titzer) | 1053 Emit(kArchNop, NULL); // TODO(titzer) |
| 1053 } | 1054 } |
| 1054 | 1055 |
| 1055 | 1056 |
| 1056 void InstructionSelector::FillTypeVectorFromStateValues( | 1057 void InstructionSelector::FillTypeVectorFromStateValues( |
| 1057 ZoneVector<MachineType>* types, Node* state_values) { | 1058 ZoneVector<MachineType>* types, Node* state_values) { |
| 1058 DCHECK(state_values->opcode() == IrOpcode::kStateValues); | 1059 DCHECK(state_values->opcode() == IrOpcode::kStateValues); |
| 1059 int count = state_values->InputCount(); | 1060 int count = state_values->InputCount(); |
| 1060 types->reserve(static_cast<size_t>(count)); | 1061 types->reserve(static_cast<size_t>(count)); |
| 1061 for (int i = 0; i < count; i++) { | 1062 for (int i = 0; i < count; i++) { |
| 1062 types->push_back(GetMachineType(state_values->InputAt(i))); | 1063 types->push_back(GetMachineType(state_values->InputAt(i))); |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1173 MachineOperatorBuilder::Flags | 1174 MachineOperatorBuilder::Flags |
| 1174 InstructionSelector::SupportedMachineOperatorFlags() { | 1175 InstructionSelector::SupportedMachineOperatorFlags() { |
| 1175 return MachineOperatorBuilder::Flag::kNoFlags; | 1176 return MachineOperatorBuilder::Flag::kNoFlags; |
| 1176 } | 1177 } |
| 1177 | 1178 |
| 1178 #endif // !V8_TURBOFAN_BACKEND | 1179 #endif // !V8_TURBOFAN_BACKEND |
| 1179 | 1180 |
| 1180 } // namespace compiler | 1181 } // namespace compiler |
| 1181 } // namespace internal | 1182 } // namespace internal |
| 1182 } // namespace v8 | 1183 } // namespace v8 |
| OLD | NEW |