Changeset 10653 in webkit for trunk/JavaScriptCore/kjs


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/kjs
Files:
2 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • 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.