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

Unified Diff: src/objects.cc

Issue 583533003: Version 3.27.34.20 (merged r23727) (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.27
Patch Set: Add test Created 6 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 | src/objects-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 1d3b022c71caed782881e05f9c8c7886b3e8e769..70d731ca290ef6f69c065aa9c6c150e5b893deeb 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -4793,9 +4793,15 @@ void JSObject::TransformToFastProperties(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());
+ }
}
« no previous file with comments | « no previous file | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698