Commit 15ab3a06 authored by rossberg@chromium.org's avatar rossberg@chromium.org

ES6 symbols: symbol properties should not cause going into slow mode.

R=yangguo@chromium.org
BUG=

Review URL: https://codereview.chromium.org/13042013

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14089 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent bdc903b0
......@@ -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))) {
......
......@@ -213,9 +213,12 @@ TestCollections()
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)
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment