Reviewers: ulan,

Message:
PTAL

Description:
Do not generate new enumeration indices for global objects.


Please review this at https://chromiumcodereview.appspot.com/10911058/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
  M src/handles.cc


Index: src/handles.cc
diff --git a/src/handles.cc b/src/handles.cc
index 872b1d459df016e88dc529df1d8f04727ef99ae2..19db5eb021e109f06187bfc2d9c1d8c56d1fa978 100644
--- a/src/handles.cc
+++ b/src/handles.cc
@@ -791,7 +791,7 @@ Handle<FixedArray> GetEnumPropertyKeys(Handle<JSObject> object, // number of holes to a minimum. This avoids allocating a large array if
     // many properties were added but subsequently deleted.
     int next_enumeration = dictionary->NextEnumerationIndex();
-    if (next_enumeration > (length * 3) / 2) {
+    if (!object->IsGlobalObject() && next_enumeration > (length * 3) / 2) {
       StringDictionary::DoGenerateNewEnumerationIndices(dictionary);
       next_enumeration = dictionary->NextEnumerationIndex();
     }


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to