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

Unified Diff: src/elements.cc

Issue 2212963002: [elements] update Dictionary in IncludesValue if own elements change (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add test for other related failure Created 4 years, 4 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/es7/regress/regress-634273.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/elements.cc
diff --git a/src/elements.cc b/src/elements.cc
index 7a0f558cd91b26acc84b6c7fafeac379b9d29cae..b10e1f7f1b8309213ead099b5c856afcb39d1e5f 100644
--- a/src/elements.cc
+++ b/src/elements.cc
@@ -1519,7 +1519,7 @@ class DictionaryElementsAccessor
continue;
}
- PropertyDetails details = GetDetailsImpl(receiver->elements(), entry);
+ PropertyDetails details = GetDetailsImpl(*dictionary, entry);
switch (details.kind()) {
case kData: {
Object* element_k = dictionary->ValueAt(entry);
@@ -1539,12 +1539,28 @@ class DictionaryElementsAccessor
if (value->SameValueZero(*element_k)) return Just(true);
- // Some mutation to the prototype elements may have occurred in
- // accessor.
+ // Bailout to slow path if elements on prototype changed
if (!JSObject::PrototypeHasNoElements(isolate, *receiver)) {
return IncludesValueSlowPath(isolate, receiver, value, k + 1,
length);
}
+
+ // Continue if elements unchanged
+ if (*dictionary == receiver->elements()) continue;
+
+ // Otherwise, bailout or update elements
+ if (receiver->GetElementsKind() != DICTIONARY_ELEMENTS) {
+ if (receiver->map()->GetInitialElements() == receiver->elements()) {
+ // If switched to initial elements, return true if searching for
+ // undefined, and false otherwise.
+ return Just(search_for_hole);
+ }
+ // Otherwise, switch to slow path.
+ return IncludesValueSlowPath(isolate, receiver, value, k + 1,
+ length);
+ }
+ dictionary = handle(
+ SeededNumberDictionary::cast(receiver->elements()), isolate);
break;
}
}
« no previous file with comments | « no previous file | test/mjsunit/es7/regress/regress-634273.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698