Index: src/compiler/branch-elimination.cc |
diff --git a/src/compiler/branch-elimination.cc b/src/compiler/branch-elimination.cc |
index b1967b896a8b893ce3434fae876a22b67dc283ee..9b36eb106865c52aa1a38dca49b28b497f451a6f 100644 |
--- a/src/compiler/branch-elimination.cc |
+++ b/src/compiler/branch-elimination.cc |
@@ -83,6 +83,7 @@ Reduction BranchElimination::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); |
@@ -102,8 +103,9 @@ Reduction BranchElimination::ReduceDeoptimizeConditional(Node* node) { |
// with the {control} node that already contains the right information. |
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()); |