Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index 24f32df6ac89b7ca34d5b6a06b034b4fb1caa2a3..7b942ffd26582945a78a589de3bbe6e7a3e528ef 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -4411,9 +4411,15 @@ void JSObject::MigrateSlowToFast(Handle<JSObject> object, |
void JSObject::ResetElements(Handle<JSObject> object) { |
- Heap* heap = object->GetIsolate()->heap(); |
- CHECK(object->map() != heap->sloppy_arguments_elements_map()); |
- object->set_elements(object->map()->GetInitialElements()); |
+ Isolate* isolate = object->GetIsolate(); |
+ CHECK(object->map() != isolate->heap()->sloppy_arguments_elements_map()); |
+ if (object->map()->has_dictionary_elements()) { |
+ Handle<SeededNumberDictionary> new_elements = |
+ SeededNumberDictionary::New(isolate, 0); |
+ object->set_elements(*new_elements); |
+ } else { |
+ object->set_elements(object->map()->GetInitialElements()); |
+ } |
} |