Commit 35793949 authored by mhahnenberg@apple.com's avatar mhahnenberg@apple.com

JSObject::getOwnNonIndexPropertyNames calculates numCacheableSlots incorrectly

https://bugs.webkit.org/show_bug.cgi?id=114235

Reviewed by Geoffrey Garen.

Due to the way that numCacheableSlots is currently calculated, checking an object's prototype for enumerable 
properties causes us not to cache any properties at all. We should only cache properties on the object itself
since we currently don't take advantage of any sort of name caching for properties in the prototype chain.
This fix undoes a ~2% SunSpider regression caused by http://trac.webkit.org/changeset/147570.

* runtime/JSObject.cpp:
(JSC::JSObject::getOwnNonIndexPropertyNames):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 1cc9fb43
2013-04-08 Mark Hahnenberg <mhahnenberg@apple.com>
JSObject::getOwnNonIndexPropertyNames calculates numCacheableSlots incorrectly
https://bugs.webkit.org/show_bug.cgi?id=114235
Reviewed by Geoffrey Garen.
Due to the way that numCacheableSlots is currently calculated, checking an object's prototype for enumerable
properties causes us not to cache any properties at all. We should only cache properties on the object itself
since we currently don't take advantage of any sort of name caching for properties in the prototype chain.
This fix undoes a ~2% SunSpider regression caused by http://trac.webkit.org/changeset/147570.
* runtime/JSObject.cpp:
(JSC::JSObject::getOwnNonIndexPropertyNames):
2013-04-09 Ryosuke Niwa <rniwa@webkit.org>
Remove yarr.gyp
......@@ -1532,10 +1532,12 @@ void JSObject::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNa
void JSObject::getOwnNonIndexPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
{
getClassPropertyNames(exec, object->classInfo(), propertyNames, mode, object->staticFunctionsReified());
size_t preStructurePropertyNamesCount = propertyNames.size();
bool canCachePropertiesFromStructure = !propertyNames.size();
object->structure()->getPropertyNamesFromStructure(exec->globalData(), propertyNames, mode);
size_t numCacheableSlots = preStructurePropertyNamesCount ? 0 : propertyNames.size();
propertyNames.setNumCacheableSlots(numCacheableSlots);
if (canCachePropertiesFromStructure)
propertyNames.setNumCacheableSlots(propertyNames.size());
}
double JSObject::toNumber(ExecState* exec) const
......
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