Chromium Code Reviews| Index: src/compiler/effect-control-linearizer.cc |
| diff --git a/src/compiler/effect-control-linearizer.cc b/src/compiler/effect-control-linearizer.cc |
| index 292d4d58e2731584b72a1550f794e27953200d7b..8701c1923b80c8121efcb371af360bf8eb4fd21d 100644 |
| --- a/src/compiler/effect-control-linearizer.cc |
| +++ b/src/compiler/effect-control-linearizer.cc |
| @@ -378,13 +378,17 @@ void EffectControlLinearizer::Run() { |
| // The input blocks do not have the same effect. We have |
| // to create an effect phi node. |
| inputs_buffer.clear(); |
| - inputs_buffer.resize(block->PredecessorCount(), graph()->start()); |
| + inputs_buffer.resize(block->PredecessorCount(), jsgraph()->Dead()); |
|
Benedikt Meurer
2016/07/16 12:35:29
Nice!
|
| inputs_buffer.push_back(control); |
| effect = graph()->NewNode( |
| common()->EffectPhi(static_cast<int>(block->PredecessorCount())), |
| static_cast<int>(inputs_buffer.size()), &(inputs_buffer.front())); |
| - // Let us update the effect phi node later. |
| - pending_effect_phis.push_back(PendingEffectPhi(effect, block)); |
| + // For loops, we update the effect phi node later to break cycles. |
| + if (control->opcode() == IrOpcode::kLoop) { |
| + pending_effect_phis.push_back(PendingEffectPhi(effect, block)); |
| + } else { |
| + UpdateEffectPhi(effect, block, &block_effects); |
| + } |
| } else if (control->opcode() == IrOpcode::kIfException) { |
| // The IfException is connected into the effect chain, so we need |
| // to update the effect here. |