Revision: 14089
Author:   [email protected]
Date:     Thu Mar 28 05:01:46 2013
Log: ES6 symbols: symbol properties should not cause going into slow mode.

[email protected]
BUG=

Review URL: https://codereview.chromium.org/13042013
http://code.google.com/p/v8/source/detail?r=14089

Modified:
 /branches/bleeding_edge/src/objects.cc
 /branches/bleeding_edge/test/mjsunit/harmony/symbols.js

=======================================
--- /branches/bleeding_edge/src/objects.cc      Thu Mar 28 04:19:38 2013
+++ /branches/bleeding_edge/src/objects.cc      Thu Mar 28 05:01:46 2013
@@ -1733,7 +1733,7 @@
   // hidden strings) and is not a real identifier.
   // Normalize the object if it will have too many fast properties.
   Isolate* isolate = GetHeap()->isolate();
-  if ((!IsIdentifier(isolate->unicode_cache(), name)
+  if ((!name->IsSymbol() && !IsIdentifier(isolate->unicode_cache(), name)
        && name != isolate->heap()->hidden_string()) ||
       (map()->unused_property_fields() == 0 &&
        TooManyFastProperties(properties()->length(), store_mode))) {
=======================================
--- /branches/bleeding_edge/test/mjsunit/harmony/symbols.js Fri Mar 22 10:27:44 2013 +++ /branches/bleeding_edge/test/mjsunit/harmony/symbols.js Thu Mar 28 05:01:46 2013
@@ -213,9 +213,12 @@


 function TestKeySet(obj) {
+  assertTrue(%HasFastProperties(obj))
   // Set the even symbols via assignment.
   for (var i = 0; i < symbols.length; i += 2) {
     obj[symbols[i]] = i
+ // Object should remain in fast mode until too many properties were added.
+    assertTrue(%HasFastProperties(obj) || i >= 30)
   }
 }

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to