JavaScriptCore:
authorweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Sep 2008 06:55:39 +0000 (06:55 +0000)
committerweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Sep 2008 06:55:39 +0000 (06:55 +0000)
commit2229430366864e0c02e97331aa50d4f53690a468
tree7ecece6ce87018abe603b58a08e6c25e092046ea
parent11180f670c8dfbebda1dff9f69372d0df0e71ae1
JavaScriptCore:

2008-09-08  Sam Weinig  <sam@webkit.org>

        Reviewed by Maciej Stachowiak and Oliver Hunt.

        Split storage of properties out of the PropertyMap and into the JSObject
        to allow sharing PropertyMap on the StructureID.  In order to get this
        function correctly, the StructureID's transition mappings were changed to
        transition based on property name and attribute pairs, instead of just
        property name.

        - Removes the single property optimization now that the PropertyMap is shared.
          This will be replaced by in-lining some values on the JSObject.

        This is a wash on Sunspider and a 6.7% win on the v8 test suite.

        * JavaScriptCore.base.exp:
        * VM/CTI.cpp:
        (JSC::CTI::privateCompileGetByIdSelf): Get the storage directly off the JSObject.
        (JSC::CTI::privateCompileGetByIdProto): Ditto.
        (JSC::CTI::privateCompileGetByIdChain): Ditto.
        (JSC::CTI::privateCompilePutByIdReplace): Ditto.
        * kjs/JSObject.cpp:
        (JSC::JSObject::mark): Mark the PropertyStorage.
        (JSC::JSObject::put): Update to get the propertyMap of the StructureID.
        (JSC::JSObject::deleteProperty): Ditto.
        (JSC::JSObject::defineGetter): Return early if the property is already a getter/setter.
        (JSC::JSObject::defineSetter): Ditto.
        (JSC::JSObject::getPropertyAttributes): Update to get the propertyMap of the StructureID
        (JSC::JSObject::getPropertyNames): Ditto.
        (JSC::JSObject::removeDirect): Ditto.
        * kjs/JSObject.h: Remove PropertyMap and add PropertyStorage.
        (JSC::JSObject::propertyStorage): return the PropertyStorage.
        (JSC::JSObject::getDirect): Update to get the propertyMap of the StructureID.
        (JSC::JSObject::getDirectLocation): Ditto.
        (JSC::JSObject::offsetForLocation): Compute location directly.
        (JSC::JSObject::hasCustomProperties): Update to get the propertyMap of the StructureID.
        (JSC::JSObject::hasGetterSetterProperties): Ditto.
        (JSC::JSObject::getDirectOffset): Get by indexing into PropertyStorage.
        (JSC::JSObject::putDirectOffset): Put by indexing into PropertyStorage.
        (JSC::JSObject::getOwnPropertySlotForWrite): Update to get the propertyMap of the StructureID.
        (JSC::JSObject::getOwnPropertySlot): Ditto.
        (JSC::JSObject::putDirect): Move putting into the StructureID unless the property already exists.
        * kjs/PropertyMap.cpp: Use the propertyStorage as the storage for the JSValues.
        (JSC::PropertyMap::checkConsistency):
        (JSC::PropertyMap::operator=):
        (JSC::PropertyMap::~PropertyMap):
        (JSC::PropertyMap::get):
        (JSC::PropertyMap::getLocation):
        (JSC::PropertyMap::put):
        (JSC::PropertyMap::getOffset):
        (JSC::PropertyMap::insert):
        (JSC::PropertyMap::expand):
        (JSC::PropertyMap::rehash):
        (JSC::PropertyMap::createTable):
        (JSC::PropertyMap::resizePropertyStorage): Resize the storage to match the size of the map
        (JSC::PropertyMap::remove):
        (JSC::PropertyMap::getEnumerablePropertyNames):
        * kjs/PropertyMap.h:
        (JSC::PropertyMapEntry::PropertyMapEntry):
        (JSC::PropertyMap::isEmpty):
        (JSC::PropertyMap::size):
        (JSC::PropertyMap::makingCount):
        (JSC::PropertyMap::PropertyMap):

        * kjs/StructureID.cpp:
        (JSC::StructureID::addPropertyTransition): Transitions now are based off the property name
        and attributes.
        (JSC::StructureID::toDictionaryTransition): Copy the map.
        (JSC::StructureID::changePrototypeTransition): Copy the map.
        (JSC::StructureID::getterSetterTransition): Copy the map.
        (JSC::StructureID::~StructureID):
        * kjs/StructureID.h:
        (JSC::TransitionTableHash::hash): Custom hash for transition map.
        (JSC::TransitionTableHash::equal): Ditto.
        (JSC::TransitionTableHashTraits::emptyValue): Custom traits for transition map
        (JSC::TransitionTableHashTraits::constructDeletedValue): Ditto.
        (JSC::TransitionTableHashTraits::isDeletedValue): Ditto.
        (JSC::StructureID::propertyMap): Added.

JavaScriptGlue:

2008-09-08  Sam Weinig  <sam@webkit.org>

        Reviewed by Maciej Stachowiak and Oliver Hunt.

        Add forwarding headers.

        * ForwardingHeaders/wtf/HashFunctions.h: Added.
        * ForwardingHeaders/wtf/HashTraits.h: Added.

WebCore:

2008-09-08  Sam Weinig  <sam@webkit.org>

        Reviewed by Maciej Stachowiak and Oliver Hunt.

        Add forwarding headers.

        * ForwardingHeaders/wtf/HashFunctions.h: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@36285 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
JavaScriptCore/ChangeLog
JavaScriptCore/JavaScriptCore.base.exp
JavaScriptCore/VM/CTI.cpp
JavaScriptCore/kjs/JSObject.cpp
JavaScriptCore/kjs/JSObject.h
JavaScriptCore/kjs/PropertyMap.cpp
JavaScriptCore/kjs/PropertyMap.h
JavaScriptCore/kjs/StructureID.cpp
JavaScriptCore/kjs/StructureID.h
JavaScriptGlue/ChangeLog
JavaScriptGlue/ForwardingHeaders/wtf/HashFunctions.h [new file with mode: 0644]
JavaScriptGlue/ForwardingHeaders/wtf/HashTraits.h [new file with mode: 0644]
WebCore/ChangeLog
WebCore/ForwardingHeaders/wtf/HashFunctions.h [new file with mode: 0644]