Reviewers: Yang,
Description:
ES6 symbols: symbol properties should not cause going into slow mode.
[email protected]
BUG=
Please review this at https://codereview.chromium.org/13042013/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files:
M src/objects.cc
M test/mjsunit/harmony/symbols.js
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index
9d6c055c1b33c908c582e1ce193d1e52e2c63803..03cb5ce91c7dbbfb1331a26e28b95a5cba946d26
100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -1733,7 +1733,7 @@ MaybeObject* JSObject::AddFastProperty(Name* name,
// 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))) {
Index: test/mjsunit/harmony/symbols.js
diff --git a/test/mjsunit/harmony/symbols.js
b/test/mjsunit/harmony/symbols.js
index
5e1515ee43cdf2cd2eb239c63648421454c34dea..ac509892a42931553632f506ec5d8b1168e56fdb
100644
--- a/test/mjsunit/harmony/symbols.js
+++ b/test/mjsunit/harmony/symbols.js
@@ -217,6 +217,7 @@ function TestKeySet(obj) {
for (var i = 0; i < symbols.length; i += 2) {
obj[symbols[i]] = i
}
+ %HasFastProperties(obj)
}
--
--
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.