JavaScriptCore:
authormjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 Sep 2005 22:01:41 +0000 (22:01 +0000)
committermjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 Sep 2005 22:01:41 +0000 (22:01 +0000)
commit81a4b8a680adea865d1048d000f1c56c45424de0
treeaa86421045a422b7e830f34a9379c69314763118
parent15373e28234335202fa00aca6653bc389c6fd70d
JavaScriptCore:

        Reviewed by Eric.

- move HashMap/HashSet code down to JavaScriptCore
http://bugzilla.opendarwin.org/show_bug.cgi?id=5161

        * JavaScriptCore.xcodeproj/project.pbxproj:
        * kjs/internal.cpp:
        (KJS::interpreterMap): Function that fetches the interpreter map on demand.
        (KJS::InterpreterImp::InterpreterImp): Replace use of InterpreterMap
class with an appropriate HashMap.
        (KJS::InterpreterImp::clear): ditto
        (KJS::InterpreterImp::interpreterWithGlobalObject): ditto
        * kjs/interpreter_map.cpp: Removed.
        * kjs/interpreter_map.h: Removed.

The HashMap/HashSet code (copied and slightly tweaked from WebCore)

* kxmlcore/HashFunctions.h: Added.
        (KXMLCore::4):
        (KXMLCore::8):
        (KXMLCore::):
        (KXMLCore::PointerHash::hash):
        (KXMLCore::PointerHash::equal):
        * kxmlcore/HashMap.h: Added.
        (KXMLCore::extractFirst):
        (KXMLCore::HashMap::HashMap):
        (KXMLCore::::size):
        (KXMLCore::::capacity):
        (KXMLCore::::isEmpty):
        (KXMLCore::::begin):
        (KXMLCore::::end):
        (KXMLCore::::find):
        (KXMLCore::::contains):
        (KXMLCore::::set):
        (KXMLCore::::get):
        (KXMLCore::::remove):
        (KXMLCore::::clear):
        (KXMLCore::deleteAllValues):
        * kxmlcore/HashMapPtrSpec.h: Added.
        (KXMLCore::PointerHashIteratorAdapter::PointerHashIteratorAdapter):
        (KXMLCore::PointerHashIteratorAdapter::operator*):
        (KXMLCore::PointerHashIteratorAdapter::operator->):
        (KXMLCore::PointerHashIteratorAdapter::operator++):
        (KXMLCore::PointerHashIteratorAdapter::operator==):
        (KXMLCore::PointerHashIteratorAdapter::operator!=):
        (KXMLCore::PointerHashConstIteratorAdapter::PointerHashConstIteratorAdapter):
        (KXMLCore::PointerHashConstIteratorAdapter::operator*):
        (KXMLCore::PointerHashConstIteratorAdapter::operator->):
        (KXMLCore::PointerHashConstIteratorAdapter::operator++):
        (KXMLCore::PointerHashConstIteratorAdapter::operator==):
        (KXMLCore::PointerHashConstIteratorAdapter::operator!=):
        (KXMLCore::):
        * kxmlcore/HashSet.h: Added.
        (KXMLCore::identityExtract):
        (KXMLCore::convertAdapter):
        (KXMLCore::HashSet::HashSet):
        (KXMLCore::::size):
        (KXMLCore::::capacity):
        (KXMLCore::::isEmpty):
        (KXMLCore::::begin):
        (KXMLCore::::end):
        (KXMLCore::::find):
        (KXMLCore::::contains):
        (KXMLCore::::insert):
        (KXMLCore::::remove):
        (KXMLCore::::clear):
        * kxmlcore/HashTable.cpp: Added.
        (KXMLCore::HashTableStats::~HashTableStats):
        (KXMLCore::HashTableStats::recordCollisionAtCount):
        * kxmlcore/HashTable.h: Added.
        (KXMLCore::HashTableIterator::skipEmptyBuckets):
        (KXMLCore::HashTableIterator::HashTableIterator):
        (KXMLCore::HashTableIterator::operator*):
        (KXMLCore::HashTableIterator::operator->):
        (KXMLCore::HashTableIterator::operator++):
        (KXMLCore::HashTableIterator::operator==):
        (KXMLCore::HashTableIterator::operator!=):
        (KXMLCore::HashTableConstIterator::HashTableConstIterator):
        (KXMLCore::HashTableConstIterator::operator*):
        (KXMLCore::HashTableConstIterator::operator->):
        (KXMLCore::HashTableConstIterator::skipEmptyBuckets):
        (KXMLCore::HashTableConstIterator::operator++):
        (KXMLCore::HashTableConstIterator::operator==):
        (KXMLCore::HashTableConstIterator::operator!=):
        (KXMLCore::HashTable::HashTable):
        (KXMLCore::HashTable::~HashTable):
        (KXMLCore::HashTable::begin):
        (KXMLCore::HashTable::end):
        (KXMLCore::HashTable::size):
        (KXMLCore::HashTable::capacity):
        (KXMLCore::HashTable::insert):
        (KXMLCore::HashTable::isEmptyBucket):
        (KXMLCore::HashTable::isDeletedBucket):
        (KXMLCore::HashTable::isEmptyOrDeletedBucket):
        (KXMLCore::HashTable::hash):
        (KXMLCore::HashTable::equal):
        (KXMLCore::HashTable::identityConvert):
        (KXMLCore::HashTable::extractKey):
        (KXMLCore::HashTable::lookup):
        (KXMLCore::HashTable::shouldExpand):
        (KXMLCore::HashTable::mustRehashInPlace):
        (KXMLCore::HashTable::shouldShrink):
        (KXMLCore::HashTable::shrink):
        (KXMLCore::HashTable::clearBucket):
        (KXMLCore::HashTable::deleteBucket):
        (KXMLCore::HashTable::makeLookupResult):
        (KXMLCore::HashTable::makeIterator):
        (KXMLCore::HashTable::makeConstIterator):
        (KXMLCore::::lookup):
        (KXMLCore::::insert):
        (KXMLCore::::reinsert):
        (KXMLCore::::find):
        (KXMLCore::::contains):
        (KXMLCore::::remove):
        (KXMLCore::::allocateTable):
        (KXMLCore::::expand):
        (KXMLCore::::rehash):
        (KXMLCore::::clear):
        (KXMLCore::::HashTable):
        (KXMLCore::::swap):
        (KXMLCore::::operator):
        (KXMLCore::::checkTableConsistency):
        (KXMLCore::::checkTableConsistencyExceptSize):
        * kxmlcore/HashTraits.h: Added.
        (KXMLCore::HashTraits::emptyValue):
        (KXMLCore::):
        (KXMLCore::PairHashTraits::emptyValue):
        (KXMLCore::PairHashTraits::deletedValue):

WebCore:

        Reviewed by Eric.

- move HashMap/HashSet code down to JavaScriptCore; adapt usage to the new header location
http://bugzilla.opendarwin.org/show_bug.cgi?id=5161

        * ForwardingHeaders/kxmlcore/HashMap.h: Added.
        * ForwardingHeaders/kxmlcore/HashSet.h: Added.
        * ForwardingHeaders/misc/hashmap.h: Removed.
        * ForwardingHeaders/misc/hashset.h: Removed.
        * ForwardingHeaders/misc/pointerhash.h: Removed.
        * WebCore.xcodeproj/project.pbxproj:
        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSRuleSet::getIDRules):
        (khtml::CSSRuleSet::getClassRules):
        (khtml::CSSRuleSet::getTagRules):
        (khtml::CSSRuleSet::getUniversalRules):
        (khtml::CSSRuleSet::addToRuleSet):
        * khtml/css/cssstyleselector.h:
        * khtml/ecma/kjs_binding.cpp:
        * khtml/editing/jsediting.cpp:
        * khtml/html/html_documentimpl.cpp:
        (DOM::addItemToMap):
        * khtml/html/html_documentimpl.h:
        * khtml/html/html_elementimpl.cpp:
        * khtml/html/html_formimpl.cpp:
        (DOM::HTMLFormElementImpl::radioButtonChecked):
        * khtml/html/html_formimpl.h:
        * khtml/html/htmlfactory.cpp:
        (DOM::HTMLElementFactory::createHTMLElement):
        * khtml/html/htmlparser.cpp:
        (HTMLParser::getNode):
        * khtml/xml/dom_atomicstring.cpp:
        * khtml/xml/dom_qname.cpp:
        * khtml/xml/dom_stringimpl.h:
        (KXMLCore::):
        (KXMLCore::CaseInsensitiveHash::hash):
        (KXMLCore::CaseInsensitiveHash::equal):
        * khtml/xml/xml_tokenizer.cpp:
        * kwq/DOM.mm:
        (ObjCEventListener::ObjCEventListener):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@10653 268f45cc-cd09-0410-ab3c-d52691b4dbfc
35 files changed:
JavaScriptCore/ChangeLog
JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
JavaScriptCore/kjs/internal.cpp
JavaScriptCore/kjs/interpreter_map.cpp [deleted file]
JavaScriptCore/kjs/interpreter_map.h [deleted file]
JavaScriptCore/kxmlcore/HashFunctions.h [new file with mode: 0644]
JavaScriptCore/kxmlcore/HashMap.h [new file with mode: 0644]
JavaScriptCore/kxmlcore/HashMapPtrSpec.h [new file with mode: 0644]
JavaScriptCore/kxmlcore/HashSet.h [new file with mode: 0644]
JavaScriptCore/kxmlcore/HashTable.cpp [new file with mode: 0644]
JavaScriptCore/kxmlcore/HashTable.h [new file with mode: 0644]
JavaScriptCore/kxmlcore/HashTraits.h [new file with mode: 0644]
WebCore/ChangeLog-2005-12-19
WebCore/ForwardingHeaders/kxmlcore/HashMap.h [new file with mode: 0644]
WebCore/ForwardingHeaders/kxmlcore/HashSet.h [new file with mode: 0644]
WebCore/ForwardingHeaders/misc/hashmap.h [deleted file]
WebCore/ForwardingHeaders/misc/hashset.h [deleted file]
WebCore/ForwardingHeaders/misc/pointerhash.h [deleted file]
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/khtml/css/cssstyleselector.cpp
WebCore/khtml/css/cssstyleselector.h
WebCore/khtml/ecma/kjs_binding.cpp
WebCore/khtml/editing/jsediting.cpp
WebCore/khtml/html/html_documentimpl.cpp
WebCore/khtml/html/html_documentimpl.h
WebCore/khtml/html/html_elementimpl.cpp
WebCore/khtml/html/html_formimpl.cpp
WebCore/khtml/html/html_formimpl.h
WebCore/khtml/html/htmlfactory.cpp
WebCore/khtml/html/htmlparser.cpp
WebCore/khtml/xml/dom_atomicstring.cpp
WebCore/khtml/xml/dom_qname.cpp
WebCore/khtml/xml/dom_stringimpl.h
WebCore/khtml/xml/xml_tokenizer.cpp
WebCore/kwq/DOM.mm