Index: src/compiler/js-call-reducer.cc |
diff --git a/src/compiler/js-call-reducer.cc b/src/compiler/js-call-reducer.cc |
index bfba7c9761bc0e4c9c6974903e9c7c9eaf0b9739..f0febc4d26ac61f2fecc05a409b3f7c7b158e855 100644 |
--- a/src/compiler/js-call-reducer.cc |
+++ b/src/compiler/js-call-reducer.cc |
@@ -337,7 +337,7 @@ Reduction JSCallReducer::ReduceObjectPrototypeGetProto(Node* node) { |
ZoneHandleSet<Map> receiver_maps; |
NodeProperties::InferReceiverMapsResult result = |
NodeProperties::InferReceiverMaps(receiver, effect, &receiver_maps); |
- if (result == NodeProperties::kReliableReceiverMaps) { |
+ if (result != NodeProperties::kNoReceiverMaps) { |
Handle<Map> candidate_map( |
receiver_maps[0]->GetPrototypeChainRootMap(isolate())); |
Handle<Object> candidate_prototype(candidate_map->prototype(), isolate()); |
@@ -352,6 +352,15 @@ Reduction JSCallReducer::ReduceObjectPrototypeGetProto(Node* node) { |
receiver_map->prototype() != *candidate_prototype) { |
return NoChange(); |
} |
+ if (result == NodeProperties::kUnreliableReceiverMaps && |
+ !receiver_map->is_stable()) { |
+ return NoChange(); |
+ } |
+ } |
+ if (result == NodeProperties::kUnreliableReceiverMaps) { |
+ for (size_t i = 0; i < receiver_maps.size(); ++i) { |
+ dependencies()->AssumeMapStable(receiver_maps[i]); |
+ } |
} |
Node* value = jsgraph()->Constant(candidate_prototype); |
ReplaceWithValue(node, value); |