Index: src/compiler/js-call-reducer.cc |
diff --git a/src/compiler/js-call-reducer.cc b/src/compiler/js-call-reducer.cc |
index dcce497447cc504c1dc7d7803dd3528da9fcf53e..dd8f0643dd2ee0d66d73bca297319de991242362 100644 |
--- a/src/compiler/js-call-reducer.cc |
+++ b/src/compiler/js-call-reducer.cc |
@@ -281,6 +281,20 @@ Reduction JSCallReducer::ReduceJSCallFunction(Node* node) { |
// Extract feedback from the {node} using the CallICNexus. |
if (!p.feedback().IsValid()) return NoChange(); |
CallICNexus nexus(p.feedback().vector(), p.feedback().slot()); |
+ if (nexus.IsUninitialized() && (flags() & kBailoutOnUninitialized)) { |
+ Node* frame_state = NodeProperties::FindFrameStateBefore(node); |
+ Node* deoptimize = graph()->NewNode( |
+ common()->Deoptimize( |
+ DeoptimizeKind::kSoft, |
+ DeoptimizeReason::kInsufficientTypeFeedbackForCall), |
+ frame_state, effect, control); |
+ // TODO(bmeurer): This should be on the AdvancedReducer somehow. |
+ NodeProperties::MergeControlToEnd(graph(), common(), deoptimize); |
+ Revisit(graph()->end()); |
+ node->TrimInputCount(0); |
+ NodeProperties::ChangeOp(node, common()->Dead()); |
+ return Changed(node); |
+ } |
Handle<Object> feedback(nexus.GetFeedback(), isolate()); |
if (feedback->IsAllocationSite()) { |
// Retrieve the Array function from the {node}. |