Index: src/hydrogen.cc |
diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
index 393e02c9f97ba6381ad0697aa220dfe2df319d63..1080f543e1e003ab38a8a04b1c302c944f7c6b61 100644 |
--- a/src/hydrogen.cc |
+++ b/src/hydrogen.cc |
@@ -8405,6 +8405,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; |