Ignore:
Timestamp:
Dec 16, 2007, 2:53:51 PM (17 years ago)
Author:
[email protected]
Message:

Reviewed by Darin Adler and Maciej Stachowiak.


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

  • 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.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj

    r28635 r28777  
    6868                1483B58A099BC1950016E4F0 /* JSImmediate.h in Headers */ = {isa = PBXBuildFile; fileRef = 1483B589099BC1950016E4F0 /* JSImmediate.h */; settings = {ATTRIBUTES = (Private, ); }; };
    6969                148A1627095D16BB00666D0D /* ListRefPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 148A1626095D16BB00666D0D /* ListRefPtr.h */; settings = {ATTRIBUTES = (Private, ); }; };
     70                148A1ECE0D10C23B0069A47C /* RefPtrHashMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 148A1ECD0D10C23B0069A47C /* RefPtrHashMap.h */; settings = {ATTRIBUTES = (Private, ); }; };
    7071                14A396A70CD2933100B5B4FF /* SymbolTable.h in Headers */ = {isa = PBXBuildFile; fileRef = 14A396A60CD2933100B5B4FF /* SymbolTable.h */; settings = {ATTRIBUTES = (Private, ); }; };
    7172                14ABB36F099C076400E2A24F /* value.h in Headers */ = {isa = PBXBuildFile; fileRef = 14ABB36E099C076400E2A24F /* value.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    425426                1483B589099BC1950016E4F0 /* JSImmediate.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSImmediate.h; sourceTree = "<group>"; };
    426427                148A1626095D16BB00666D0D /* ListRefPtr.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ListRefPtr.h; sourceTree = "<group>"; };
     428                148A1ECD0D10C23B0069A47C /* RefPtrHashMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RefPtrHashMap.h; sourceTree = "<group>"; };
    427429                14A396A60CD2933100B5B4FF /* SymbolTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SymbolTable.h; sourceTree = "<group>"; };
    428430                14ABB36E099C076400E2A24F /* value.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = value.h; sourceTree = "<group>"; };
     
    908910                        isa = PBXGroup;
    909911                        children = (
    910                                 E195678D09E7CF1200B89D13 /* unicode */,
    911912                                93AA4F770957251F0084B3A7 /* AlwaysInline.h */,
    912913                                938C4F690CA06BC700D9310A /* ASCIICType.h */,
     
    938939                                1419D32C0CEA7CDE00FF507A /* RefCounted.h */,
    939940                                65C647B3093EF8D60022C380 /* RefPtr.h */,
     941                                148A1ECD0D10C23B0069A47C /* RefPtrHashMap.h */,
    940942                                51F648D60BB4E2CA0033D760 /* RetainPtr.h */,
    941943                                E11D51750B2E798D0056C188 /* StringExtras.h */,
     944                                5DA479650CFBCF56009328A0 /* TCPackedCache.h */,
    942945                                6541BD6E08E80A17002CBEE7 /* TCPageMap.h */,
    943946                                6541BD6F08E80A17002CBEE7 /* TCSpinLock.h */,
    944                                 5DA479650CFBCF56009328A0 /* TCPackedCache.h */,
    945947                                6541BD7008E80A17002CBEE7 /* TCSystemAlloc.cpp */,
    946948                                6541BD7108E80A17002CBEE7 /* TCSystemAlloc.h */,
     949                                E195678D09E7CF1200B89D13 /* unicode */,
    947950                                935AF46B09E9D9DB00ACD1D8 /* UnusedParam.h */,
    948951                                6592C316098B7DE10003D4F6 /* Vector.h */,
     
    12761279                                5DA479660CFBCF56009328A0 /* TCPackedCache.h in Headers */,
    12771280                                14F252570D08DD8D004ECFFF /* JSVariableObject.h in Headers */,
     1281                                148A1ECE0D10C23B0069A47C /* RefPtrHashMap.h in Headers */,
    12781282                        );
    12791283                        runOnlyForDeploymentPostprocessing = 0;
Note: See TracChangeset for help on using the changeset viewer.