Skip to content
  • ggaren@apple.com's avatar
    Reviewed by Darin Adler and Maciej Stachowiak. · 3ab2bcee
    ggaren@apple.com authored
            
            More refactoring to support global variable optimization.
            
            Changed SymbolTable to use RefPtr<UString::Rep> as its key instead of
            UString::Rep*. With globals, the symbol table can outlast the
            declaration node for any given symbol, so the symbol table needs to ref
            its symbol names.
            
            In support, specialized HashMaps with RefPtr keys to allow lookup
            via raw pointer, avoiding refcount churn.
            
            SunSpider reports a .6% speedup (prolly just noise).
    
            * JavaScriptCore.vcproj/WTF/WTF.vcproj: Added new file: wtf/RefPtrHashMap.h
            * JavaScriptCore.xcodeproj/project.pbxproj: ditto
    
            * kjs/JSVariableObject.cpp:
            (KJS::JSVariableObject::getPropertyNames): Symbol table keys are RefPtrs now.
    
            * kjs/SymbolTable.h: Modified key traits to match RefPtr. Added a
            static Rep* for null, which helps compute the deletedValue() trait.
    
            * wtf/HashMap.h: #include the RefPtr specialization so everyone can use it.
    
            * wtf/RefPtrHashMap.h: Copied from wtf/HashMap.h. Added overloaded versions
            of find(), contains(), get(), set(), add(), remove(), and take() that take
            raw pointers as keys.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@28777 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    3ab2bcee