Index: src/hydrogen.cc |
diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
index 03bd971a825ce7ceee500e4122265eb8fa70ed5b..918035532e5d540f9d3c2bf9b1f0ba84475475ac 100644 |
--- a/src/hydrogen.cc |
+++ b/src/hydrogen.cc |
@@ -8451,6 +8451,13 @@ bool HOptimizedGraphBuilder::TryInlineBuiltinMethodCall( |
Handle<JSObject> prototype(JSObject::cast(receiver_map->prototype())); |
BuildCheckPrototypeMaps(prototype, Handle<JSObject>()); |
+ // Protect against adding elements to the Array prototype, which needs to |
+ // route through appropriate bottlenecks. |
+ if (isolate()->IsFastArrayConstructorPrototypeChainIntact() && |
+ !prototype->IsJSArray()) { |
+ return false; |
+ } |
+ |
const int argc = args_count_no_receiver; |
if (argc != 1) return false; |