Index: src/elements.cc |
diff --git a/src/elements.cc b/src/elements.cc |
index ffea033c93967fad28e66005bc3d62d7ceddad6f..748b420cda863facede6c0e056da75ad721bd7e8 100644 |
--- a/src/elements.cc |
+++ b/src/elements.cc |
@@ -1431,8 +1431,9 @@ |
? JSObject::NormalizeElements(object) |
: handle(SeededNumberDictionary::cast(object->elements())); |
Handle<SeededNumberDictionary> new_dictionary = |
- SeededNumberDictionary::AddNumberEntry(dictionary, index, value, |
- details, object); |
+ SeededNumberDictionary::AddNumberEntry( |
+ dictionary, index, value, details, |
+ object->map()->is_prototype_map()); |
if (attributes != NONE) object->RequireSlowElements(*new_dictionary); |
if (dictionary.is_identical_to(new_dictionary)) return; |
object->set_elements(*new_dictionary); |
@@ -1772,14 +1773,15 @@ |
SeededNumberDictionary::New(isolate, capacity); |
PropertyDetails details = PropertyDetails::Empty(); |
+ bool used_as_prototype = object->map()->is_prototype_map(); |
int j = 0; |
for (int i = 0; j < capacity; i++) { |
if (IsHoleyElementsKind(kind)) { |
if (BackingStore::cast(*store)->is_the_hole(isolate, i)) continue; |
} |
Handle<Object> value = Subclass::GetImpl(isolate, *store, i); |
- dictionary = SeededNumberDictionary::AddNumberEntry(dictionary, i, value, |
- details, object); |
+ dictionary = SeededNumberDictionary::AddNumberEntry( |
+ dictionary, i, value, details, used_as_prototype); |
j++; |
} |
return dictionary; |
@@ -3274,8 +3276,9 @@ |
: JSObject::NormalizeElements(object); |
PropertyDetails details(attributes, DATA, 0, PropertyCellType::kNoCell); |
Handle<SeededNumberDictionary> new_dictionary = |
- SeededNumberDictionary::AddNumberEntry(dictionary, index, value, |
- details, object); |
+ SeededNumberDictionary::AddNumberEntry( |
+ dictionary, index, value, details, |
+ object->map()->is_prototype_map()); |
if (attributes != NONE) object->RequireSlowElements(*new_dictionary); |
if (*dictionary != *new_dictionary) { |
FixedArray::cast(object->elements())->set(1, *new_dictionary); |
@@ -3308,7 +3311,7 @@ |
Handle<SeededNumberDictionary> arguments( |
SeededNumberDictionary::cast(parameter_map->get(1)), isolate); |
arguments = SeededNumberDictionary::AddNumberEntry( |
- arguments, entry, value, details, object); |
+ arguments, entry, value, details, object->map()->is_prototype_map()); |
// If the attributes were NONE, we would have called set rather than |
// reconfigure. |
DCHECK_NE(NONE, attributes); |