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

Unified Diff: src/compiler/js-builtin-reducer.cc

Issue 2319533005: [turbofan] Ensure that all prototypes are stable for push/pop. (Closed)
Patch Set: Created 4 years, 3 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 | « no previous file | test/mjsunit/regress/regress-crbug-644689-1.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-builtin-reducer.cc
diff --git a/src/compiler/js-builtin-reducer.cc b/src/compiler/js-builtin-reducer.cc
index f028cb70c44fc77dc8339c32968b3d8f51cf509c..b47d8162c9b742e2fd694901103ac9fa6f4c0660 100644
--- a/src/compiler/js-builtin-reducer.cc
+++ b/src/compiler/js-builtin-reducer.cc
@@ -145,11 +145,16 @@ bool CanInlineArrayResizeOperation(Handle<Map> receiver_map) {
if (!receiver_map->prototype()->IsJSArray()) return false;
Handle<JSArray> receiver_prototype(JSArray::cast(receiver_map->prototype()),
isolate);
+ // Ensure that all prototypes of the {receiver} are stable.
+ for (PrototypeIterator it(isolate, receiver_prototype, kStartAtReceiver);
+ !it.IsAtEnd(); it.Advance()) {
+ Handle<JSReceiver> current = PrototypeIterator::GetCurrent<JSReceiver>(it);
+ if (!current->map()->is_stable()) return false;
+ }
return receiver_map->instance_type() == JS_ARRAY_TYPE &&
IsFastElementsKind(receiver_map->elements_kind()) &&
!receiver_map->is_dictionary_map() && receiver_map->is_extensible() &&
(!receiver_map->is_prototype_map() || receiver_map->is_stable()) &&
- receiver_prototype->map()->is_stable() &&
isolate->IsFastArrayConstructorPrototypeChainIntact() &&
isolate->IsAnyInitialArrayPrototype(receiver_prototype) &&
!IsReadOnlyLengthDescriptor(receiver_map);
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-644689-1.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698