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 1001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1012 | 1012 |
1013 void InstructionSelector::VisitPhi(Node* node) { | 1013 void InstructionSelector::VisitPhi(Node* node) { |
1014 const int input_count = node->op()->ValueInputCount(); | 1014 const int input_count = node->op()->ValueInputCount(); |
1015 PhiInstruction* phi = new (instruction_zone()) | 1015 PhiInstruction* phi = new (instruction_zone()) |
1016 PhiInstruction(instruction_zone(), GetVirtualRegister(node), | 1016 PhiInstruction(instruction_zone(), GetVirtualRegister(node), |
1017 static_cast<size_t>(input_count)); | 1017 static_cast<size_t>(input_count)); |
1018 sequence()->InstructionBlockAt(current_block_->GetRpoNumber())->AddPhi(phi); | 1018 sequence()->InstructionBlockAt(current_block_->GetRpoNumber())->AddPhi(phi); |
1019 for (int i = 0; i < input_count; ++i) { | 1019 for (int i = 0; i < input_count; ++i) { |
1020 Node* const input = node->InputAt(i); | 1020 Node* const input = node->InputAt(i); |
1021 MarkAsUsed(input); | 1021 MarkAsUsed(input); |
1022 phi->Extend(instruction_zone(), GetVirtualRegister(input)); | 1022 phi->SetInput(static_cast<size_t>(i), GetVirtualRegister(input)); |
1023 } | 1023 } |
1024 } | 1024 } |
1025 | 1025 |
1026 | 1026 |
1027 void InstructionSelector::VisitProjection(Node* node) { | 1027 void InstructionSelector::VisitProjection(Node* node) { |
1028 OperandGenerator g(this); | 1028 OperandGenerator g(this); |
1029 Node* value = node->InputAt(0); | 1029 Node* value = node->InputAt(0); |
1030 switch (value->opcode()) { | 1030 switch (value->opcode()) { |
1031 case IrOpcode::kInt32AddWithOverflow: | 1031 case IrOpcode::kInt32AddWithOverflow: |
1032 case IrOpcode::kInt32SubWithOverflow: | 1032 case IrOpcode::kInt32SubWithOverflow: |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1212 MachineOperatorBuilder::Flags | 1212 MachineOperatorBuilder::Flags |
1213 InstructionSelector::SupportedMachineOperatorFlags() { | 1213 InstructionSelector::SupportedMachineOperatorFlags() { |
1214 return MachineOperatorBuilder::Flag::kNoFlags; | 1214 return MachineOperatorBuilder::Flag::kNoFlags; |
1215 } | 1215 } |
1216 | 1216 |
1217 #endif // !V8_TURBOFAN_BACKEND | 1217 #endif // !V8_TURBOFAN_BACKEND |
1218 | 1218 |
1219 } // namespace compiler | 1219 } // namespace compiler |
1220 } // namespace internal | 1220 } // namespace internal |
1221 } // namespace v8 | 1221 } // namespace v8 |
OLD | NEW |