Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(401)

Unified Diff: src/hydrogen.cc

Issue 1066003003: Make sure builtins preserve guarantees about empty element array prototypes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE, fix nits. Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/builtins.cc ('k') | test/mjsunit/elide-double-hole-check-10.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « src/builtins.cc ('k') | test/mjsunit/elide-double-hole-check-10.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698