Index: src/compiler/common-operator-reducer.cc |
diff --git a/src/compiler/common-operator-reducer.cc b/src/compiler/common-operator-reducer.cc |
index 5c3d3d7135b7158e27f1960561f27a82332e942d..be4d802f818d06c140a4b2ac7b6b50679a3b7e99 100644 |
--- a/src/compiler/common-operator-reducer.cc |
+++ b/src/compiler/common-operator-reducer.cc |
@@ -122,6 +122,7 @@ Reduction CommonOperatorReducer::ReduceDeoptimizeConditional(Node* node) { |
DCHECK(node->opcode() == IrOpcode::kDeoptimizeIf || |
node->opcode() == IrOpcode::kDeoptimizeUnless); |
bool condition_is_true = node->opcode() == IrOpcode::kDeoptimizeUnless; |
+ DeoptimizeReason reason = DeoptimizeReasonOf(node->op()); |
Node* condition = NodeProperties::GetValueInput(node, 0); |
Node* frame_state = NodeProperties::GetValueInput(node, 1); |
Node* effect = NodeProperties::GetEffectInput(node); |
@@ -133,8 +134,8 @@ Reduction CommonOperatorReducer::ReduceDeoptimizeConditional(Node* node) { |
if (condition->opcode() == IrOpcode::kBooleanNot) { |
NodeProperties::ReplaceValueInput(node, condition->InputAt(0), 0); |
NodeProperties::ChangeOp(node, condition_is_true |
- ? common()->DeoptimizeIf() |
- : common()->DeoptimizeUnless()); |
+ ? common()->DeoptimizeIf(reason) |
+ : common()->DeoptimizeUnless(reason)); |
return Changed(node); |
} |
Decision const decision = DecideCondition(condition); |
@@ -142,8 +143,9 @@ Reduction CommonOperatorReducer::ReduceDeoptimizeConditional(Node* node) { |
if (condition_is_true == (decision == Decision::kTrue)) { |
ReplaceWithValue(node, dead(), effect, control); |
} else { |
- control = graph()->NewNode(common()->Deoptimize(DeoptimizeKind::kEager), |
- frame_state, effect, control); |
+ control = |
+ graph()->NewNode(common()->Deoptimize(DeoptimizeKind::kEager, reason), |
+ frame_state, effect, control); |
// TODO(bmeurer): This should be on the AdvancedReducer somehow. |
NodeProperties::MergeControlToEnd(graph(), common(), control); |
Revisit(graph()->end()); |