Ignore:
Timestamp:
Jan 23, 2006, 11:31:21 PM (19 years ago)
Author:
mjs
Message:

JavaScriptCore:

Reviewed by Eric.

  • renamed PointerHash to PtrHash
  • made PtrHash the default hash function for int and pointer types that aren't further specialized
  • added an AtomicStringImpl class to make it easier and more typesafe to identity hash atomic strings
  • did appropriate consequent cleanup (very few places now need to declare a hash function) http://bugzilla.opendarwin.org/show_bug.cgi?id=6752


  • kjs/array_object.cpp: (ArrayProtoFunc::callAsFunction): no need to mention PointerHash
  • kjs/collector.cpp: ditto
  • kjs/identifier.cpp: (KXMLCore::): declare DefaultHash the new way
  • kjs/internal.cpp: no need to mention PointerHash
  • kjs/ustring.h:
  • kxmlcore/HashCountedSet.h: change how we get the default hash to make it easier to specialize on PtrHash
  • kxmlcore/HashFunctions.h: (KXMLCore::): renamed PointerHash to PtrHash; changed DefaultHash so that it has a Hash typedef rather than being a hash function class itself; declared DefaultHash for int and partializy specialized for pointer types
  • kxmlcore/HashMapPtrSpec.h: (KXMLCore::PtrHashIteratorAdapter::PtrHashIteratorAdapter): Slight tweaks for new way of handling pointer hash (KXMLCore::PtrHashConstIteratorAdapter::PtrHashConstIteratorAdapter): ditto (KXMLCore::): ditto
  • kxmlcore/HashMap.h: ditto
  • kxmlcore/HashSet.h: ditto

WebCore:

Reviewed by Eric.

  • renamed PointerHash to PtrHash
  • made PtrHash the default hash function for int and pointer types that aren't further specialized
  • added an AtomicStringImpl class to make it easier and more typesafe to identity hash atomic strings
  • did appropriate consequent cleanup (very few places now need to declare a hash function) http://bugzilla.opendarwin.org/show_bug.cgi?id=6752


  • bindings/objc/DOM.mm:
  • bridge/mac/WebCoreFrameBridge.mm: (-[WebCoreFrameBridge elementWithName:inForm:]):
  • css/cssstyleselector.cpp: (WebCore::CSSRuleSet::getIDRules): (WebCore::CSSRuleSet::getClassRules): (WebCore::CSSRuleSet::getTagRules): (WebCore::CSSRuleSet::addToRuleSet):
  • khtml/dom/dom_string.h: (KXMLCore::):
  • khtml/ecma/kjs_binding.cpp: (KJS::UString::UString):
  • khtml/ecma/kjs_dom.cpp: (KJS::DOMNode::mark):
  • khtml/ecma/kjs_html.cpp: (KJS::KJS::HTMLElement::classInfo): (KJS::HTMLElement::accessors): (KJS::HTMLElement::selectSetter): (KJS::HTMLElement::inputSetter): (KJS::HTMLElement::textAreaSetter): (KJS::HTMLElement::buttonSetter):
  • khtml/ecma/kjs_window.h:
  • khtml/editing/apply_style_command.cpp: (WebCore::ApplyStyleCommand::applyRelativeFontStyleChange):
  • khtml/html/HTMLCollectionImpl.h:
  • khtml/html/HTMLElementImpl.cpp: (WebCore::HTMLElementImpl::isRecognizedTagName): (WebCore::inlineTagList): (WebCore::blockTagList):
  • khtml/html/HTMLFormCollectionImpl.cpp: (WebCore::HTMLFormCollectionImpl::updateNameCache):
  • khtml/html/HTMLGenericFormElementImpl.cpp: (WebCore::HTMLGenericFormElementImpl::name): (WebCore::HTMLGenericFormElementImpl::setName):
  • khtml/html/HTMLGenericFormElementImpl.h:
  • khtml/html/HTMLInputElementImpl.cpp: (WebCore::HTMLInputElementImpl::name):
  • khtml/html/HTMLInputElementImpl.h:
  • khtml/html/htmlfactory.cpp: (DOM::HTMLElementFactory::createHTMLElement):
  • khtml/html/htmlparser.cpp: (HTMLParser::isHeaderTag): (HTMLParser::isResidualStyleTag): (HTMLParser::isAffectedByResidualStyle):
  • khtml/xml/DocumentImpl.cpp: (WebCore::DocumentImpl::checkedRadioButtonForGroup): (WebCore::DocumentImpl::removeRadioButtonGroup):
  • khtml/xml/DocumentImpl.h:
  • khtml/xml/NodeImpl.h:
  • khtml/xml/dom_atomicstring.h: (DOM::AtomicString::AtomicString): (DOM::AtomicString::impl): (KXMLCore::):
  • khtml/xml/dom_stringimpl.cpp: (DOM::equal):
  • khtml/xml/dom_stringimpl.h: (KXMLCore::):
  • khtml/xml/xml_tokenizer.h:
  • ksvg2/misc/KSVGTimeScheduler.cpp: (KSVG::SVGTimer::notifyAll):
  • kwq/KWQKJobClasses.h:
  • kwq/KWQObject.cpp:
  • loader/CachedObject.h:
  • loader/CachedObjectClientWalker.h:
  • loader/loader.h:
  • page/Frame.cpp: (Frame::endAllLifeSupport):
  • rendering/render_canvas.cpp: (RenderCanvas::selectionRect): (RenderCanvas::setSelection):
  • rendering/render_canvas.h:
  • rendering/render_object.h:
  • xml/xmlhttprequest.h:
File:
1 edited

Legend:

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

    r12301 r12329  
    6363        return key;
    6464    }
    65    
    66     template<> struct DefaultHash<void *> {
    67         static unsigned hash(void *key) { return pointerHash<sizeof(void *)>(key); }
    68         static bool equal(void *a, void *b) { return a == b; }
    69     };
    70    
    71     // pointer identity hash - default for void *, must be requested explicitly for other
    72     // pointer types; also should work for integer types
    73     template<typename T> struct PointerHash {
     65
     66    // pointer identity hash - default for pointer types that don't
     67    // explicitly specialize otherwise; also should work for integer
     68    // types
     69    template<typename T> struct PtrHash {
    7470        static unsigned hash(T key) { return pointerHash<sizeof(void *)>((void *)key); }
    7571        static bool equal(T a, T b) { return a == b; }
    7672    };
    7773
    78     template<typename P> struct PointerHash<RefPtr<P> > {
     74    template<typename P> struct PtrHash<RefPtr<P> > {
    7975        static unsigned hash(const RefPtr<P>& key) { return  pointerHash<sizeof(void *)>((void *)key.get()); }
    8076        static bool equal(const RefPtr<P>& a, const RefPtr<P>& b) { return a == b; }
     77    };
     78
     79    template<typename P> struct DefaultHash<P *> {
     80        typedef PtrHash<P *> Hash;
     81    };
     82
     83    template<> struct DefaultHash<int> {
     84        typedef PtrHash<int> Hash;
    8185    };
    8286   
     
    8488
    8589using KXMLCore::DefaultHash;
    86 using KXMLCore::PointerHash;
     90using KXMLCore::PtrHash;
    8791
    8892#endif // KXLMCORE_HASH_FUNCTIONS_H
Note: See TracChangeset for help on using the changeset viewer.