Changeset 10653 in webkit for trunk/JavaScriptCore


Ignore:
Timestamp:
Sep 28, 2005, 3:01:41 PM (20 years ago)
Author:
mjs
Message:

JavaScriptCore:

Reviewed by Eric.

  • 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.

  • 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):
Location:
trunk/JavaScriptCore
Files:
7 added
2 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r10646 r10653  
     12005-09-27  Maciej Stachowiak  <[email protected]>
     2
     3        Reviewed by Eric.
     4
     5        - move HashMap/HashSet code down to JavaScriptCore
     6        http://bugzilla.opendarwin.org/show_bug.cgi?id=5161
     7       
     8        * JavaScriptCore.xcodeproj/project.pbxproj:
     9        * kjs/internal.cpp:
     10        (KJS::interpreterMap): Function that fetches the interpreter map on demand.
     11        (KJS::InterpreterImp::InterpreterImp): Replace use of InterpreterMap
     12        class with an appropriate HashMap.
     13        (KJS::InterpreterImp::clear): ditto
     14        (KJS::InterpreterImp::interpreterWithGlobalObject): ditto
     15        * kjs/interpreter_map.cpp: Removed.
     16        * kjs/interpreter_map.h: Removed.
     17
     18        The HashMap/HashSet code (copied and slightly tweaked from WebCore)
     19       
     20        * kxmlcore/HashFunctions.h: Added.
     21        (KXMLCore::4):
     22        (KXMLCore::8):
     23        (KXMLCore::):
     24        (KXMLCore::PointerHash::hash):
     25        (KXMLCore::PointerHash::equal):
     26        * kxmlcore/HashMap.h: Added.
     27        (KXMLCore::extractFirst):
     28        (KXMLCore::HashMap::HashMap):
     29        (KXMLCore::::size):
     30        (KXMLCore::::capacity):
     31        (KXMLCore::::isEmpty):
     32        (KXMLCore::::begin):
     33        (KXMLCore::::end):
     34        (KXMLCore::::find):
     35        (KXMLCore::::contains):
     36        (KXMLCore::::set):
     37        (KXMLCore::::get):
     38        (KXMLCore::::remove):
     39        (KXMLCore::::clear):
     40        (KXMLCore::deleteAllValues):
     41        * kxmlcore/HashMapPtrSpec.h: Added.
     42        (KXMLCore::PointerHashIteratorAdapter::PointerHashIteratorAdapter):
     43        (KXMLCore::PointerHashIteratorAdapter::operator*):
     44        (KXMLCore::PointerHashIteratorAdapter::operator->):
     45        (KXMLCore::PointerHashIteratorAdapter::operator++):
     46        (KXMLCore::PointerHashIteratorAdapter::operator==):
     47        (KXMLCore::PointerHashIteratorAdapter::operator!=):
     48        (KXMLCore::PointerHashConstIteratorAdapter::PointerHashConstIteratorAdapter):
     49        (KXMLCore::PointerHashConstIteratorAdapter::operator*):
     50        (KXMLCore::PointerHashConstIteratorAdapter::operator->):
     51        (KXMLCore::PointerHashConstIteratorAdapter::operator++):
     52        (KXMLCore::PointerHashConstIteratorAdapter::operator==):
     53        (KXMLCore::PointerHashConstIteratorAdapter::operator!=):
     54        (KXMLCore::):
     55        * kxmlcore/HashSet.h: Added.
     56        (KXMLCore::identityExtract):
     57        (KXMLCore::convertAdapter):
     58        (KXMLCore::HashSet::HashSet):
     59        (KXMLCore::::size):
     60        (KXMLCore::::capacity):
     61        (KXMLCore::::isEmpty):
     62        (KXMLCore::::begin):
     63        (KXMLCore::::end):
     64        (KXMLCore::::find):
     65        (KXMLCore::::contains):
     66        (KXMLCore::::insert):
     67        (KXMLCore::::remove):
     68        (KXMLCore::::clear):
     69        * kxmlcore/HashTable.cpp: Added.
     70        (KXMLCore::HashTableStats::~HashTableStats):
     71        (KXMLCore::HashTableStats::recordCollisionAtCount):
     72        * kxmlcore/HashTable.h: Added.
     73        (KXMLCore::HashTableIterator::skipEmptyBuckets):
     74        (KXMLCore::HashTableIterator::HashTableIterator):
     75        (KXMLCore::HashTableIterator::operator*):
     76        (KXMLCore::HashTableIterator::operator->):
     77        (KXMLCore::HashTableIterator::operator++):
     78        (KXMLCore::HashTableIterator::operator==):
     79        (KXMLCore::HashTableIterator::operator!=):
     80        (KXMLCore::HashTableConstIterator::HashTableConstIterator):
     81        (KXMLCore::HashTableConstIterator::operator*):
     82        (KXMLCore::HashTableConstIterator::operator->):
     83        (KXMLCore::HashTableConstIterator::skipEmptyBuckets):
     84        (KXMLCore::HashTableConstIterator::operator++):
     85        (KXMLCore::HashTableConstIterator::operator==):
     86        (KXMLCore::HashTableConstIterator::operator!=):
     87        (KXMLCore::HashTable::HashTable):
     88        (KXMLCore::HashTable::~HashTable):
     89        (KXMLCore::HashTable::begin):
     90        (KXMLCore::HashTable::end):
     91        (KXMLCore::HashTable::size):
     92        (KXMLCore::HashTable::capacity):
     93        (KXMLCore::HashTable::insert):
     94        (KXMLCore::HashTable::isEmptyBucket):
     95        (KXMLCore::HashTable::isDeletedBucket):
     96        (KXMLCore::HashTable::isEmptyOrDeletedBucket):
     97        (KXMLCore::HashTable::hash):
     98        (KXMLCore::HashTable::equal):
     99        (KXMLCore::HashTable::identityConvert):
     100        (KXMLCore::HashTable::extractKey):
     101        (KXMLCore::HashTable::lookup):
     102        (KXMLCore::HashTable::shouldExpand):
     103        (KXMLCore::HashTable::mustRehashInPlace):
     104        (KXMLCore::HashTable::shouldShrink):
     105        (KXMLCore::HashTable::shrink):
     106        (KXMLCore::HashTable::clearBucket):
     107        (KXMLCore::HashTable::deleteBucket):
     108        (KXMLCore::HashTable::makeLookupResult):
     109        (KXMLCore::HashTable::makeIterator):
     110        (KXMLCore::HashTable::makeConstIterator):
     111        (KXMLCore::::lookup):
     112        (KXMLCore::::insert):
     113        (KXMLCore::::reinsert):
     114        (KXMLCore::::find):
     115        (KXMLCore::::contains):
     116        (KXMLCore::::remove):
     117        (KXMLCore::::allocateTable):
     118        (KXMLCore::::expand):
     119        (KXMLCore::::rehash):
     120        (KXMLCore::::clear):
     121        (KXMLCore::::HashTable):
     122        (KXMLCore::::swap):
     123        (KXMLCore::::operator):
     124        (KXMLCore::::checkTableConsistency):
     125        (KXMLCore::::checkTableConsistencyExceptSize):
     126        * kxmlcore/HashTraits.h: Added.
     127        (KXMLCore::HashTraits::emptyValue):
     128        (KXMLCore::):
     129        (KXMLCore::PairHashTraits::emptyValue):
     130        (KXMLCore::PairHashTraits::deletedValue):
     131
    11322005-09-27  Darin Adler  <[email protected]>
    2133
  • trunk/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj

    r10639 r10653  
    3333                6541BD7408E80A17002CBEE7 /* TCSystemAlloc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6541BD7008E80A17002CBEE7 /* TCSystemAlloc.cpp */; };
    3434                6541BD7508E80A17002CBEE7 /* TCSystemAlloc.h in Headers */ = {isa = PBXBuildFile; fileRef = 6541BD7108E80A17002CBEE7 /* TCSystemAlloc.h */; };
     35                6557E8F808EA5D4D0049CDFC /* HashMapPtrSpec.h in Headers */ = {isa = PBXBuildFile; fileRef = 6557E8F708EA5D4D0049CDFC /* HashMapPtrSpec.h */; settings = {ATTRIBUTES = (Private, ); }; };
    3536                65621E6D089E859700760F35 /* property_slot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65621E6B089E859700760F35 /* property_slot.cpp */; };
    3637                65621E6E089E859700760F35 /* property_slot.h in Headers */ = {isa = PBXBuildFile; fileRef = 65621E6C089E859700760F35 /* property_slot.h */; settings = {ATTRIBUTES = (Private, ); }; };
    3738                65621E6F089E85D300760F35 /* property_slot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65621E6B089E859700760F35 /* property_slot.cpp */; };
    3839                65621E70089E85D300760F35 /* property_slot.h in Headers */ = {isa = PBXBuildFile; fileRef = 65621E6C089E859700760F35 /* property_slot.h */; settings = {ATTRIBUTES = (Private, ); }; };
     40                65DFC93008EA173A00F7300B /* HashFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = 65DFC92A08EA173A00F7300B /* HashFunctions.h */; settings = {ATTRIBUTES = (Private, ); }; };
     41                65DFC93108EA173A00F7300B /* HashMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 65DFC92B08EA173A00F7300B /* HashMap.h */; settings = {ATTRIBUTES = (Private, ); }; };
     42                65DFC93208EA173A00F7300B /* HashSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 65DFC92C08EA173A00F7300B /* HashSet.h */; settings = {ATTRIBUTES = (Private, ); }; };
     43                65DFC93308EA173A00F7300B /* HashTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65DFC92D08EA173A00F7300B /* HashTable.cpp */; };
     44                65DFC93408EA173A00F7300B /* HashTable.h in Headers */ = {isa = PBXBuildFile; fileRef = 65DFC92E08EA173A00F7300B /* HashTable.h */; settings = {ATTRIBUTES = (Private, ); }; };
     45                65DFC93508EA173A00F7300B /* HashTraits.h in Headers */ = {isa = PBXBuildFile; fileRef = 65DFC92F08EA173A00F7300B /* HashTraits.h */; settings = {ATTRIBUTES = (Private, ); }; };
    3946                65E217BD08E7EECC0023E5F6 /* Assertions.h in Headers */ = {isa = PBXBuildFile; fileRef = 65E217B708E7EECC0023E5F6 /* Assertions.h */; settings = {ATTRIBUTES = (Private, ); }; };
    4047                65E217BE08E7EECC0023E5F6 /* Assertions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 65E217B808E7EECC0023E5F6 /* Assertions.mm */; };
     
    112119                932F5B840822A1C700736975 /* NP_jsobject.h in Headers */ = {isa = PBXBuildFile; fileRef = 517BE7F40610E39600221947 /* NP_jsobject.h */; settings = {ATTRIBUTES = (Private, ); }; };
    113120                932F5B850822A1C700736975 /* npruntime.h in Headers */ = {isa = PBXBuildFile; fileRef = 5199B1BE061B65BC0070C006 /* npruntime.h */; settings = {ATTRIBUTES = (Private, ); }; };
    114                 932F5B870822A1C700736975 /* interpreter_map.h in Headers */ = {isa = PBXBuildFile; fileRef = 65AB004906261CBA0076DE63 /* interpreter_map.h */; };
    115121                932F5B880822A1C700736975 /* protect.h in Headers */ = {isa = PBXBuildFile; fileRef = 65C02FBB0637462A003E7EE6 /* protect.h */; settings = {ATTRIBUTES = (Private, ); }; };
    116122                932F5B890822A1C700736975 /* protected_values.h in Headers */ = {isa = PBXBuildFile; fileRef = 650B68D90639033F009D42DE /* protected_values.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    173179                932F5BCA0822A1C700736975 /* c_class.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5182A53A06012C3000CBD2F2 /* c_class.cpp */; };
    174180                932F5BCB0822A1C700736975 /* npruntime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5199B1BD061B65BC0070C006 /* npruntime.cpp */; };
    175                 932F5BCC0822A1C700736975 /* interpreter_map.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65AB004806261CBA0076DE63 /* interpreter_map.cpp */; };
    176181                932F5BCD0822A1C700736975 /* protected_values.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 650B68D80639033F009D42DE /* protected_values.cpp */; };
    177182                932F5BCE0822A1C700736975 /* WebScriptObject.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51863FC406542D3100E9E8DD /* WebScriptObject.mm */; };
     
    270275                A85D8234087B2822006A9172 /* NP_jsobject.h in Headers */ = {isa = PBXBuildFile; fileRef = 517BE7F40610E39600221947 /* NP_jsobject.h */; settings = {ATTRIBUTES = (Private, ); }; };
    271276                A85D8235087B2822006A9172 /* npruntime.h in Headers */ = {isa = PBXBuildFile; fileRef = 5199B1BE061B65BC0070C006 /* npruntime.h */; settings = {ATTRIBUTES = (Private, ); }; };
    272                 A85D8236087B2822006A9172 /* interpreter_map.h in Headers */ = {isa = PBXBuildFile; fileRef = 65AB004906261CBA0076DE63 /* interpreter_map.h */; };
    273277                A85D8237087B2822006A9172 /* protect.h in Headers */ = {isa = PBXBuildFile; fileRef = 65C02FBB0637462A003E7EE6 /* protect.h */; settings = {ATTRIBUTES = (Private, ); }; };
    274278                A85D8238087B2822006A9172 /* protected_values.h in Headers */ = {isa = PBXBuildFile; fileRef = 650B68D90639033F009D42DE /* protected_values.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    333337                A85D8279087B2822006A9172 /* c_class.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5182A53A06012C3000CBD2F2 /* c_class.cpp */; };
    334338                A85D827A087B2822006A9172 /* npruntime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5199B1BD061B65BC0070C006 /* npruntime.cpp */; };
    335                 A85D827B087B2822006A9172 /* interpreter_map.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65AB004806261CBA0076DE63 /* interpreter_map.cpp */; };
    336339                A85D827C087B2822006A9172 /* protected_values.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 650B68D80639033F009D42DE /* protected_values.cpp */; };
    337340                A85D827D087B2822006A9172 /* WebScriptObject.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51863FC406542D3100E9E8DD /* WebScriptObject.mm */; };
     
    500503                6541BD7008E80A17002CBEE7 /* TCSystemAlloc.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = TCSystemAlloc.cpp; sourceTree = "<group>"; };
    501504                6541BD7108E80A17002CBEE7 /* TCSystemAlloc.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = TCSystemAlloc.h; sourceTree = "<group>"; };
     505                6557E8F708EA5D4D0049CDFC /* HashMapPtrSpec.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HashMapPtrSpec.h; sourceTree = "<group>"; };
    502506                6560A4CF04B3B3E7008AE952 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = "<absolute>"; };
    503507                6560A63D04B3B69F008AE952 /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = /System/Library/Frameworks/CoreServices.framework; sourceTree = "<absolute>"; };
    504508                65621E6B089E859700760F35 /* property_slot.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = property_slot.cpp; sourceTree = "<group>"; };
    505509                65621E6C089E859700760F35 /* property_slot.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = property_slot.h; sourceTree = "<group>"; };
    506                 65AB004806261CBA0076DE63 /* interpreter_map.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = interpreter_map.cpp; sourceTree = "<group>"; };
    507                 65AB004906261CBA0076DE63 /* interpreter_map.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = interpreter_map.h; sourceTree = "<group>"; };
    508510                65C02FBB0637462A003E7EE6 /* protect.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = protect.h; sourceTree = "<group>"; };
     511                65DFC92A08EA173A00F7300B /* HashFunctions.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HashFunctions.h; sourceTree = "<group>"; };
     512                65DFC92B08EA173A00F7300B /* HashMap.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HashMap.h; sourceTree = "<group>"; };
     513                65DFC92C08EA173A00F7300B /* HashSet.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HashSet.h; sourceTree = "<group>"; };
     514                65DFC92D08EA173A00F7300B /* HashTable.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = HashTable.cpp; sourceTree = "<group>"; };
     515                65DFC92E08EA173A00F7300B /* HashTable.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HashTable.h; sourceTree = "<group>"; };
     516                65DFC92F08EA173A00F7300B /* HashTraits.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HashTraits.h; sourceTree = "<group>"; };
    509517                65E217B708E7EECC0023E5F6 /* Assertions.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Assertions.h; sourceTree = "<group>"; };
    510518                65E217B808E7EECC0023E5F6 /* Assertions.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = Assertions.mm; sourceTree = "<group>"; };
     
    704712                                652C107E08DA7B1E0020887D /* protected_reference.h */,
    705713                                650B68D90639033F009D42DE /* protected_values.h */,
    706                                 65AB004806261CBA0076DE63 /* interpreter_map.cpp */,
    707                                 65AB004906261CBA0076DE63 /* interpreter_map.h */,
    708714                                F692A84E0255597D01FF60F7 /* array_object.h */,
    709715                                F692A84D0255597D01FF60F7 /* array_object.cpp */,
     
    835841                        isa = PBXGroup;
    836842                        children = (
     843                                6557E8F708EA5D4D0049CDFC /* HashMapPtrSpec.h */,
     844                                65DFC92A08EA173A00F7300B /* HashFunctions.h */,
     845                                65DFC92B08EA173A00F7300B /* HashMap.h */,
     846                                65DFC92C08EA173A00F7300B /* HashSet.h */,
     847                                65DFC92D08EA173A00F7300B /* HashTable.cpp */,
     848                                65DFC92E08EA173A00F7300B /* HashTable.h */,
     849                                65DFC92F08EA173A00F7300B /* HashTraits.h */,
    837850                                6541BD6E08E80A17002CBEE7 /* TCPageMap.h */,
    838851                                6541BD6F08E80A17002CBEE7 /* TCSpinLock.h */,
     
    983996                                932F5B840822A1C700736975 /* NP_jsobject.h in Headers */,
    984997                                932F5B850822A1C700736975 /* npruntime.h in Headers */,
    985                                 932F5B870822A1C700736975 /* interpreter_map.h in Headers */,
    986998                                932F5B880822A1C700736975 /* protect.h in Headers */,
    987999                                932F5B890822A1C700736975 /* protected_values.h in Headers */,
     
    10051017                                6541BD7308E80A17002CBEE7 /* TCSpinLock.h in Headers */,
    10061018                                6541BD7508E80A17002CBEE7 /* TCSystemAlloc.h in Headers */,
     1019                                65DFC93008EA173A00F7300B /* HashFunctions.h in Headers */,
     1020                                65DFC93108EA173A00F7300B /* HashMap.h in Headers */,
     1021                                65DFC93208EA173A00F7300B /* HashSet.h in Headers */,
     1022                                65DFC93408EA173A00F7300B /* HashTable.h in Headers */,
     1023                                65DFC93508EA173A00F7300B /* HashTraits.h in Headers */,
     1024                                6557E8F808EA5D4D0049CDFC /* HashMapPtrSpec.h in Headers */,
    10071025                        );
    10081026                        runOnlyForDeploymentPostprocessing = 0;
     
    10741092                                A85D8234087B2822006A9172 /* NP_jsobject.h in Headers */,
    10751093                                A85D8235087B2822006A9172 /* npruntime.h in Headers */,
    1076                                 A85D8236087B2822006A9172 /* interpreter_map.h in Headers */,
    10771094                                A85D8237087B2822006A9172 /* protect.h in Headers */,
    10781095                                A85D8238087B2822006A9172 /* protected_values.h in Headers */,
     
    16361653                                932F5BCA0822A1C700736975 /* c_class.cpp in Sources */,
    16371654                                932F5BCB0822A1C700736975 /* npruntime.cpp in Sources */,
    1638                                 932F5BCC0822A1C700736975 /* interpreter_map.cpp in Sources */,
    16391655                                932F5BCD0822A1C700736975 /* protected_values.cpp in Sources */,
    16401656                                932F5BCE0822A1C700736975 /* WebScriptObject.mm in Sources */,
     
    16561672                                65E217BF08E7EECC0023E5F6 /* FastMalloc.cpp in Sources */,
    16571673                                6541BD7408E80A17002CBEE7 /* TCSystemAlloc.cpp in Sources */,
     1674                                65DFC93308EA173A00F7300B /* HashTable.cpp in Sources */,
    16581675                        );
    16591676                        runOnlyForDeploymentPostprocessing = 0;
     
    17331750                                A85D8279087B2822006A9172 /* c_class.cpp in Sources */,
    17341751                                A85D827A087B2822006A9172 /* npruntime.cpp in Sources */,
    1735                                 A85D827B087B2822006A9172 /* interpreter_map.cpp in Sources */,
    17361752                                A85D827C087B2822006A9172 /* protected_values.cpp in Sources */,
    17371753                                A85D827D087B2822006A9172 /* WebScriptObject.mm in Sources */,
  • trunk/JavaScriptCore/kjs/internal.cpp

    r10634 r10653  
    3535#include "function_object.h"
    3636#include "internal.h"
    37 #include "interpreter_map.h"
    3837#include "lexer.h"
    3938#include "math_object.h"
     
    4544#include "regexp_object.h"
    4645#include "string_object.h"
     46
     47#include <kxmlcore/HashMap.h>
    4748
    4849#if WIN32
     
    443444}
    444445
     446typedef HashMap<ObjectImp *, InterpreterImp *, PointerHash<ObjectImp *> > InterpreterMap;
     447
     448static inline InterpreterMap &interpreterMap()
     449{
     450    static InterpreterMap *map = new InterpreterMap;
     451    return *map;
     452}
     453
    445454InterpreterImp::InterpreterImp(Interpreter *interp, ObjectImp *glob)
    446455    : globExec(interp, 0)
     
    463472  }
    464473
    465   InterpreterMap::setInterpreterForGlobalObject(this, glob);
     474  interpreterMap().set(glob, this);
    466475
    467476  global = glob;
     
    631640    globalClear();
    632641  }
    633   InterpreterMap::removeInterpreterForGlobalObject(global);
     642  interpreterMap().remove(global);
    634643}
    635644
     
    808817InterpreterImp *InterpreterImp::interpreterWithGlobalObject(ObjectImp *global)
    809818{
    810   return InterpreterMap::getInterpreterForGlobalObject(global);
     819    return interpreterMap().get(global);
    811820}
    812821
Note: See TracChangeset for help on using the changeset viewer.