Index: src/compiler/js-native-context-specialization.cc |
diff --git a/src/compiler/js-native-context-specialization.cc b/src/compiler/js-native-context-specialization.cc |
index 094e3a1166c79e3fee86883a97e42a53eef057e7..3ee28911a24499b17ffaf7bf61190fc47ddd799d 100644 |
--- a/src/compiler/js-native-context-specialization.cc |
+++ b/src/compiler/js-native-context-specialization.cc |
@@ -826,11 +826,11 @@ Reduction JSNativeContextSpecialization::ReduceJSLoadNamed(Node* node) { |
p.name().is_identical_to(factory()->prototype_string())) { |
// Optimize "prototype" property of functions. |
Handle<JSFunction> function = Handle<JSFunction>::cast(m.Value()); |
- if (function->has_initial_map()) { |
+ if (function->IsConstructor()) { |
// We need to add a code dependency on the initial map of the |
// {function} in order to be notified about changes to the |
- // "prototype" of {function}, so it doesn't make sense to |
- // continue unless deoptimization is enabled. |
+ // "prototype" of {function}. |
+ JSFunction::EnsureHasInitialMap(function); |
Handle<Map> initial_map(function->initial_map(), isolate()); |
dependencies()->AssumeInitialMapCantChange(initial_map); |
Handle<Object> prototype(function->prototype(), isolate()); |