Ignore:
Timestamp:
Jan 2, 2009, 4:25:59 PM (16 years ago)
Author:
[email protected]
Message:

JavaScriptCore:

2009-01-02 David Smith <[email protected]>

Reviewed by Darin Adler.


https://bugs.webkit.org/show_bug.cgi?id=22699
Enable NodeList caching for getElementsByTagName

  • wtf/HashFunctions.h: Moved the definition of PHI here and renamed to stringHashingStartValue

WebCore:

2009-01-02 David Smith <[email protected]>

Reviewed by Darin Adler.


https://bugs.webkit.org/show_bug.cgi?id=22699
Enable NodeList caching for getElementsByTagName


test: fast/dom/getelementsbytagnamens-mixed-namespaces.html

  • dom/Document.cpp: (WebCore::FormElementKeyHash::hash): Use WTF::stringHashingStartValue
  • dom/Node.cpp: (WebCore::Node::getElementsByTagNameNS): Ensure rare data and add a node list cache (WebCore::NodeListsNodeData::invalidateCaches): Invalidate the tag name node list cache as well as the others (WebCore::NodeListsNodeData::isEmpty): Check the tag name node list cache as well as the others
  • dom/NodeRareData.h: Add m_tagNodeListCaches
  • dom/QualifiedName.cpp:
  • dom/QualifiedName.h: Move QNameHash to the header, make it work on QualifiedNames, and rename to QualifiedNameHash
  • dom/StyledElement.cpp: (WebCore::MappedAttributeHash::hash): Use WTF::stringHashingStartValue
  • dom/TagNodeList.cpp: (WebCore::TagNodeList::TagNodeList): Add a NodeList cache argument
  • dom/TagNodeList.h: (WebCore::TagNodeList::create): Add a NodeList cache argument
  • platform/text/StringHash.h: (WebCore::CaseFoldingHash::hash): Use WTF::stringHashingStartValue
  • platform/text/TextEncodingRegistry.cpp: (WebCore::TextEncodingNameHash::hash): Use WTF::stringHashingStartValue

LayoutTests:

2009-01-02 David Smith <[email protected]>

Reviewed by Darin Adler.


https://bugs.webkit.org/show_bug.cgi?id=22699
Enable NodeList caching for getElementsByTagName


  • fast/dom/getelementsbytagnamens-mixed-namespaces-expected.txt: Added.
  • fast/dom/getelementsbytagnamens-mixed-namespaces.html: Added.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/wtf/HashFunctions.h

    r35900 r39563  
    174174
    175175    template<typename T, typename U> struct DefaultHash<std::pair<T, U> > { typedef PairHash<T, U> Hash; };
     176   
     177    // Golden ratio - arbitrary start value to avoid mapping all 0's to all 0's
     178    static const unsigned stringHashingStartValue = 0x9e3779b9U;
    176179
    177180} // namespace WTF
Note: See TracChangeset for help on using the changeset viewer.