Chromium Code Reviews| Index: src/compiler/common-operator-reducer.cc |
| diff --git a/src/compiler/common-operator-reducer.cc b/src/compiler/common-operator-reducer.cc |
| index be4d802f818d06c140a4b2ac7b6b50679a3b7e99..1e91a0286b7561fd85b8ee648ba07949ee962e10 100644 |
| --- a/src/compiler/common-operator-reducer.cc |
| +++ b/src/compiler/common-operator-reducer.cc |
| @@ -303,8 +303,14 @@ Reduction CommonOperatorReducer::ReducePhi(Node* node) { |
| Reduction CommonOperatorReducer::ReduceReturn(Node* node) { |
| DCHECK_EQ(IrOpcode::kReturn, node->opcode()); |
| Node* const value = node->InputAt(0); |
| - Node* const effect = node->InputAt(1); |
| - Node* const control = node->InputAt(2); |
| + Node* effect = NodeProperties::GetEffectInput(node); |
| + Node* const control = NodeProperties::GetControlInput(node); |
| + if (effect->opcode() == IrOpcode::kCheckpoint) { |
| + // Any {Return} node can never be used to insert a deoptimization point, |
| + // hence checkpoints can be cut out of the effect chain flowing into it. |
| + effect = NodeProperties::GetEffectInput(effect); |
| + NodeProperties::ReplaceEffectInput(node, effect); |
|
Benedikt Meurer
2016/07/18 11:29:54
You need to say Changed(node) as you changed some
Jarin
2016/07/18 11:48:53
Good catch! Done.
|
| + } |
| if (value->opcode() == IrOpcode::kPhi && |
| NodeProperties::GetControlInput(value) == control && |
| effect->opcode() == IrOpcode::kEffectPhi && |