Index: src/compiler/instruction-selector.cc |
diff --git a/src/compiler/instruction-selector.cc b/src/compiler/instruction-selector.cc |
index 567b1c920f00ff86273dec94e4e4fb6ea5356330..da8dafddf9e0506268c53b19fb360ad7b977f84b 100644 |
--- a/src/compiler/instruction-selector.cc |
+++ b/src/compiler/instruction-selector.cc |
@@ -925,16 +925,15 @@ void InstructionSelector::VisitParameter(Node* node) { |
void InstructionSelector::VisitPhi(Node* node) { |
- // TODO(bmeurer): Emit a PhiInstruction here. |
+ const int input_count = node->op()->ValueInputCount(); |
PhiInstruction* phi = new (instruction_zone()) |
- PhiInstruction(instruction_zone(), GetVirtualRegister(node)); |
+ PhiInstruction(instruction_zone(), GetVirtualRegister(node), |
+ static_cast<size_t>(input_count)); |
sequence()->InstructionBlockAt(current_block_->GetRpoNumber())->AddPhi(phi); |
- const int input_count = node->op()->ValueInputCount(); |
- phi->operands().reserve(static_cast<size_t>(input_count)); |
for (int i = 0; i < input_count; ++i) { |
Node* const input = node->InputAt(i); |
MarkAsUsed(input); |
- phi->operands().push_back(GetVirtualRegister(input)); |
+ phi->Extend(instruction_zone(), GetVirtualRegister(input)); |
} |
} |