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/graph.h" | 7 #include "src/compiler/graph.h" |
8 #include "src/compiler/instruction-selector-impl.h" | 8 #include "src/compiler/instruction-selector-impl.h" |
9 #include "src/compiler/node-matchers.h" | 9 #include "src/compiler/node-matchers.h" |
10 #include "src/compiler/node-properties-inl.h" | 10 #include "src/compiler/node-properties-inl.h" |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 instruction_args.reserve(input_count() + frame_state_value_count()); | 288 instruction_args.reserve(input_count() + frame_state_value_count()); |
289 } | 289 } |
290 | 290 |
291 | 291 |
292 // TODO(bmeurer): Get rid of the CallBuffer business and make | 292 // TODO(bmeurer): Get rid of the CallBuffer business and make |
293 // InstructionSelector::VisitCall platform independent instead. | 293 // InstructionSelector::VisitCall platform independent instead. |
294 void InstructionSelector::InitializeCallBuffer(Node* call, CallBuffer* buffer, | 294 void InstructionSelector::InitializeCallBuffer(Node* call, CallBuffer* buffer, |
295 bool call_code_immediate, | 295 bool call_code_immediate, |
296 bool call_address_immediate) { | 296 bool call_address_immediate) { |
297 OperandGenerator g(this); | 297 OperandGenerator g(this); |
298 DCHECK_EQ(call->op()->OutputCount(), | 298 DCHECK_EQ(call->op()->ValueOutputCount(), |
299 static_cast<int>(buffer->descriptor->ReturnCount())); | 299 static_cast<int>(buffer->descriptor->ReturnCount())); |
300 DCHECK_EQ( | 300 DCHECK_EQ( |
301 call->op()->ValueInputCount(), | 301 call->op()->ValueInputCount(), |
302 static_cast<int>(buffer->input_count() + buffer->frame_state_count())); | 302 static_cast<int>(buffer->input_count() + buffer->frame_state_count())); |
303 | 303 |
304 if (buffer->descriptor->ReturnCount() > 0) { | 304 if (buffer->descriptor->ReturnCount() > 0) { |
305 // Collect the projections that represent multiple outputs from this call. | 305 // Collect the projections that represent multiple outputs from this call. |
306 if (buffer->descriptor->ReturnCount() == 1) { | 306 if (buffer->descriptor->ReturnCount() == 1) { |
307 buffer->output_nodes.push_back(call); | 307 buffer->output_nodes.push_back(call); |
308 } else { | 308 } else { |
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
922 g.DefineAsLocation(node, linkage()->GetParameterLocation(index), | 922 g.DefineAsLocation(node, linkage()->GetParameterLocation(index), |
923 linkage()->GetParameterType(index))); | 923 linkage()->GetParameterType(index))); |
924 } | 924 } |
925 | 925 |
926 | 926 |
927 void InstructionSelector::VisitPhi(Node* node) { | 927 void InstructionSelector::VisitPhi(Node* node) { |
928 // TODO(bmeurer): Emit a PhiInstruction here. | 928 // TODO(bmeurer): Emit a PhiInstruction here. |
929 PhiInstruction* phi = new (instruction_zone()) | 929 PhiInstruction* phi = new (instruction_zone()) |
930 PhiInstruction(instruction_zone(), GetVirtualRegister(node)); | 930 PhiInstruction(instruction_zone(), GetVirtualRegister(node)); |
931 sequence()->InstructionBlockAt(current_block_->GetRpoNumber())->AddPhi(phi); | 931 sequence()->InstructionBlockAt(current_block_->GetRpoNumber())->AddPhi(phi); |
932 const int input_count = node->op()->InputCount(); | 932 const int input_count = node->op()->ValueInputCount(); |
933 phi->operands().reserve(static_cast<size_t>(input_count)); | 933 phi->operands().reserve(static_cast<size_t>(input_count)); |
934 for (int i = 0; i < input_count; ++i) { | 934 for (int i = 0; i < input_count; ++i) { |
935 Node* const input = node->InputAt(i); | 935 Node* const input = node->InputAt(i); |
936 MarkAsUsed(input); | 936 MarkAsUsed(input); |
937 phi->operands().push_back(GetVirtualRegister(input)); | 937 phi->operands().push_back(GetVirtualRegister(input)); |
938 } | 938 } |
939 } | 939 } |
940 | 940 |
941 | 941 |
942 void InstructionSelector::VisitProjection(Node* node) { | 942 void InstructionSelector::VisitProjection(Node* node) { |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1114 MachineOperatorBuilder::Flags | 1114 MachineOperatorBuilder::Flags |
1115 InstructionSelector::SupportedMachineOperatorFlags() { | 1115 InstructionSelector::SupportedMachineOperatorFlags() { |
1116 return MachineOperatorBuilder::Flag::kNoFlags; | 1116 return MachineOperatorBuilder::Flag::kNoFlags; |
1117 } | 1117 } |
1118 | 1118 |
1119 #endif // !V8_TURBOFAN_BACKEND | 1119 #endif // !V8_TURBOFAN_BACKEND |
1120 | 1120 |
1121 } // namespace compiler | 1121 } // namespace compiler |
1122 } // namespace internal | 1122 } // namespace internal |
1123 } // namespace v8 | 1123 } // namespace v8 |
OLD | NEW |