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

Unified Diff: src/elements.cc

Issue 1228113003: Fix non-standard element handling (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix and expand tests Created 5 years, 5 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 | src/lookup.cc » ('j') | src/lookup.cc » ('J')
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 85eb3f266ecdb135e0ac8081d2b0d08bdd330477..1db8d06d580054fd18278685c758167faf00754c 100644
--- a/src/elements.cc
+++ b/src/elements.cc
@@ -949,8 +949,9 @@ class DictionaryElementsAccessor
Handle<FixedArrayBase> store, uint32_t entry,
Handle<Object> value,
PropertyAttributes attributes) {
- SeededNumberDictionary* dictionary = SeededNumberDictionary::cast(*store);
- if (attributes != NONE) dictionary->set_requires_slow_elements();
+ Handle<SeededNumberDictionary> dictionary(
+ SeededNumberDictionary::cast(*store));
+ if (attributes != NONE) JSObject::RequireSlowElements(object, dictionary);
dictionary->ValueAtPut(entry, *value);
PropertyDetails details = dictionary->DetailsAt(entry);
details = PropertyDetails(attributes, DATA, details.dictionary_index(),
@@ -969,7 +970,9 @@ class DictionaryElementsAccessor
Handle<SeededNumberDictionary> new_dictionary =
SeededNumberDictionary::AddNumberEntry(dictionary, index, value,
details);
- if (attributes != NONE) new_dictionary->set_requires_slow_elements();
+ if (attributes != NONE) {
+ JSObject::RequireSlowElements(object, new_dictionary);
+ }
if (dictionary.is_identical_to(new_dictionary)) return;
object->set_elements(*new_dictionary);
}
@@ -1614,7 +1617,9 @@ class SlowSloppyArgumentsElementsAccessor
Handle<SeededNumberDictionary> new_dictionary =
SeededNumberDictionary::AddNumberEntry(dictionary, index, value,
details);
- if (attributes != NONE) new_dictionary->set_requires_slow_elements();
+ if (attributes != NONE) {
+ JSObject::RequireSlowElements(object, new_dictionary);
+ }
if (*dictionary != *new_dictionary) {
FixedArray::cast(object->elements())->set(1, *new_dictionary);
}
@@ -1647,6 +1652,7 @@ class SlowSloppyArgumentsElementsAccessor
SeededNumberDictionary::cast(parameter_map->get(1)));
arguments = SeededNumberDictionary::AddNumberEntry(arguments, entry,
value, details);
+ JSObject::RequireSlowElements(object, arguments);
Igor Sheludko 2015/07/15 10:53:17 Why not "if (attributes != NONE)" here?
parameter_map->set(1, *arguments);
} else {
Handle<FixedArrayBase> arguments(
« no previous file with comments | « no previous file | src/lookup.cc » ('j') | src/lookup.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698