Commit 18a07e11 authored by Georg Neis's avatar Georg Neis Committed by Commit Bot

[compiler] Refactor checking for uninitialized IC.

Move the nexus.IsUninitialized() check into ExtractReceiverMaps so that
we don't need to duplicate the bailout.

Change-Id: I55bdb9baca22f25f681a7a32f4ec56d599c748c6
Reviewed-on: https://chromium-review.googlesource.com/903169Reviewed-by: 's avatarMichael Stanton <mvstanton@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51112}
parent a04d2a36
...@@ -945,16 +945,6 @@ Reduction JSNativeContextSpecialization::ReduceNamedAccessFromNexus( ...@@ -945,16 +945,6 @@ Reduction JSNativeContextSpecialization::ReduceNamedAccessFromNexus(
return ReduceGlobalAccess(node, nullptr, value, name, access_mode); return ReduceGlobalAccess(node, nullptr, value, name, access_mode);
} }
// Check if the {nexus} reports type feedback for the IC.
if (nexus.IsUninitialized()) {
if (flags() & kBailoutOnUninitialized) {
return ReduceSoftDeoptimize(
node,
DeoptimizeReason::kInsufficientTypeFeedbackForGenericNamedAccess);
}
return NoChange();
}
// Extract receiver maps from the IC using the {nexus}. // Extract receiver maps from the IC using the {nexus}.
MapHandles receiver_maps; MapHandles receiver_maps;
if (!ExtractReceiverMaps(receiver, effect, nexus, &receiver_maps)) { if (!ExtractReceiverMaps(receiver, effect, nexus, &receiver_maps)) {
...@@ -967,6 +957,7 @@ Reduction JSNativeContextSpecialization::ReduceNamedAccessFromNexus( ...@@ -967,6 +957,7 @@ Reduction JSNativeContextSpecialization::ReduceNamedAccessFromNexus(
} }
return NoChange(); return NoChange();
} }
DCHECK(!nexus.IsUninitialized());
// Try to lower the named access based on the {receiver_maps}. // Try to lower the named access based on the {receiver_maps}.
return ReduceNamedAccess(node, value, receiver_maps, name, access_mode); return ReduceNamedAccess(node, value, receiver_maps, name, access_mode);
...@@ -1353,16 +1344,6 @@ Reduction JSNativeContextSpecialization::ReduceKeyedAccess( ...@@ -1353,16 +1344,6 @@ Reduction JSNativeContextSpecialization::ReduceKeyedAccess(
} }
} }
// Check if the {nexus} reports type feedback for the IC.
if (nexus.IsUninitialized()) {
if (flags() & kBailoutOnUninitialized) {
return ReduceSoftDeoptimize(
node,
DeoptimizeReason::kInsufficientTypeFeedbackForGenericKeyedAccess);
}
return NoChange();
}
// Extract receiver maps from the {nexus}. // Extract receiver maps from the {nexus}.
MapHandles receiver_maps; MapHandles receiver_maps;
if (!ExtractReceiverMaps(receiver, effect, nexus, &receiver_maps)) { if (!ExtractReceiverMaps(receiver, effect, nexus, &receiver_maps)) {
...@@ -1375,6 +1356,7 @@ Reduction JSNativeContextSpecialization::ReduceKeyedAccess( ...@@ -1375,6 +1356,7 @@ Reduction JSNativeContextSpecialization::ReduceKeyedAccess(
} }
return NoChange(); return NoChange();
} }
DCHECK(!nexus.IsUninitialized());
// Optimize access for constant {index}. // Optimize access for constant {index}.
HeapObjectMatcher mindex(index); HeapObjectMatcher mindex(index);
...@@ -2665,6 +2647,7 @@ bool JSNativeContextSpecialization::ExtractReceiverMaps( ...@@ -2665,6 +2647,7 @@ bool JSNativeContextSpecialization::ExtractReceiverMaps(
Node* receiver, Node* effect, FeedbackNexus const& nexus, Node* receiver, Node* effect, FeedbackNexus const& nexus,
MapHandles* receiver_maps) { MapHandles* receiver_maps) {
DCHECK_EQ(0, receiver_maps->size()); DCHECK_EQ(0, receiver_maps->size());
if (nexus.IsUninitialized()) return true;
// See if we can infer a concrete type for the {receiver}. // See if we can infer a concrete type for the {receiver}.
if (InferReceiverMaps(receiver, effect, receiver_maps)) { if (InferReceiverMaps(receiver, effect, receiver_maps)) {
// We can assume that the {receiver} still has the inferred {receiver_maps}. // We can assume that the {receiver} still has the inferred {receiver_maps}.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment