⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 286034 in webkit


Ignore:
Timestamp:
Nov 18, 2021, 3:19:03 PM (5 years ago)
Author:
mark.lam@apple.com
Message:

Rename PropertyMapHashTable.h to PropertyTable.h to match the class.
https://bugs.webkit.org/show_bug.cgi?id=233333
rdar://85565760

Reviewed by Yusuke Suzuki.

Also renamed some supporting data structures to match. This is just a refactoring
patch. There are no behavior changes.

  • CMakeLists.txt:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • runtime/PropertyMapHashTable.h: Removed.
  • runtime/PropertyTable.cpp:
  • runtime/PropertyTable.h: Copied from Source/JavaScriptCore/runtime/PropertyMapHashTable.h.

(JSC::PropertyTable::find):
(JSC::PropertyTable::get):
(JSC::PropertyTable::add):
(JSC::PropertyTable::remove):
(JSC::PropertyTable::reinsert):
(JSC::PropertyTable::rehash):

  • runtime/Structure.cpp:

(JSC::PropertyTableStatisticsExitLogger::PropertyTableStatisticsExitLogger):
(JSC::PropertyTableStatisticsExitLogger::~PropertyTableStatisticsExitLogger):
(JSC::PropertyMapStatisticsExitLogger::PropertyMapStatisticsExitLogger): Deleted.
(JSC::PropertyMapStatisticsExitLogger::~PropertyMapStatisticsExitLogger): Deleted.

  • runtime/StructureInlines.h:
  • runtime/VM.cpp:
Location:
trunk/Source/JavaScriptCore
Files:
7 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/CMakeLists.txt

    r285955 r286034  
    11401140    runtime/ProgramExecutable.h
    11411141    runtime/PropertyDescriptor.h
    1142     runtime/PropertyMapHashTable.h
    11431142    runtime/PropertyName.h
    11441143    runtime/PropertyNameArray.h
     
    11461145    runtime/PropertySlot.h
    11471146    runtime/PropertyStorage.h
     1147    runtime/PropertyTable.h
    11481148    runtime/Protect.h
    11491149    runtime/PrototypeKey.h
  • trunk/Source/JavaScriptCore/ChangeLog

    r286033 r286034  
     12021-11-18  Mark Lam  <mark.lam@apple.com>
     2
     3        Rename PropertyMapHashTable.h to PropertyTable.h to match the class.
     4        https://bugs.webkit.org/show_bug.cgi?id=233333
     5        rdar://85565760
     6
     7        Reviewed by Yusuke Suzuki.
     8
     9        Also renamed some supporting data structures to match.  This is just a refactoring
     10        patch.  There are no behavior changes.
     11
     12        * CMakeLists.txt:
     13        * JavaScriptCore.xcodeproj/project.pbxproj:
     14        * runtime/PropertyMapHashTable.h: Removed.
     15        * runtime/PropertyTable.cpp:
     16        * runtime/PropertyTable.h: Copied from Source/JavaScriptCore/runtime/PropertyMapHashTable.h.
     17        (JSC::PropertyTable::find):
     18        (JSC::PropertyTable::get):
     19        (JSC::PropertyTable::add):
     20        (JSC::PropertyTable::remove):
     21        (JSC::PropertyTable::reinsert):
     22        (JSC::PropertyTable::rehash):
     23        * runtime/Structure.cpp:
     24        (JSC::PropertyTableStatisticsExitLogger::PropertyTableStatisticsExitLogger):
     25        (JSC::PropertyTableStatisticsExitLogger::~PropertyTableStatisticsExitLogger):
     26        (JSC::PropertyMapStatisticsExitLogger::PropertyMapStatisticsExitLogger): Deleted.
     27        (JSC::PropertyMapStatisticsExitLogger::~PropertyMapStatisticsExitLogger): Deleted.
     28        * runtime/StructureInlines.h:
     29        * runtime/VM.cpp:
     30
    1312021-11-18  Mark Lam  <mark.lam@apple.com>
    232
  • trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj

    r286018 r286034  
    17511751                BC87CDB910712AD4000614CF /* JSONObject.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = BC87CDB810712ACA000614CF /* JSONObject.lut.h */; };
    17521752                BC9041480EB9250900FE26FA /* StructureTransitionTable.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9041470EB9250900FE26FA /* StructureTransitionTable.h */; settings = {ATTRIBUTES = (Private, ); }; };
    1753                 BC95437D0EBA70FD0072B6D3 /* PropertyMapHashTable.h in Headers */ = {isa = PBXBuildFile; fileRef = BC95437C0EBA70FD0072B6D3 /* PropertyMapHashTable.h */; settings = {ATTRIBUTES = (Private, ); }; };
     1753                BC95437D0EBA70FD0072B6D3 /* PropertyTable.h in Headers */ = {isa = PBXBuildFile; fileRef = BC95437C0EBA70FD0072B6D3 /* PropertyTable.h */; settings = {ATTRIBUTES = (Private, ); }; };
    17541754                BCBE2CAE14E985AA000593AD /* GCAssertions.h in Headers */ = {isa = PBXBuildFile; fileRef = BCBE2CAD14E985AA000593AD /* GCAssertions.h */; settings = {ATTRIBUTES = (Private, ); }; };
    17551755                BCCF0D080EF0AAB900413C8F /* StructureStubInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = BCCF0D070EF0AAB900413C8F /* StructureStubInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    49924992                BC8F3CCF0DAF17BA00577A80 /* ConstructData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConstructData.h; sourceTree = "<group>"; };
    49934993                BC9041470EB9250900FE26FA /* StructureTransitionTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StructureTransitionTable.h; sourceTree = "<group>"; };
    4994                 BC95437C0EBA70FD0072B6D3 /* PropertyMapHashTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PropertyMapHashTable.h; sourceTree = "<group>"; };
     4994                BC95437C0EBA70FD0072B6D3 /* PropertyTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PropertyTable.h; sourceTree = "<group>"; };
    49954995                BC9BB95B0E19680600DF8855 /* InternalFunction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InternalFunction.cpp; sourceTree = "<group>"; };
    49964996                BCA62DFE0E2826230004F30D /* CallData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CallData.cpp; sourceTree = "<group>"; };
     
    79597959                                A7FB60A3103F7DC20017A286 /* PropertyDescriptor.cpp */,
    79607960                                A7FB604B103F5EAB0017A286 /* PropertyDescriptor.h */,
    7961                                 BC95437C0EBA70FD0072B6D3 /* PropertyMapHashTable.h */,
    79627961                                86158AB2155C8B3F00B45C9C /* PropertyName.h */,
    79637962                                65400C100A69BAF200509887 /* PropertyNameArray.h */,
     
    79677966                                0FB7F39015ED8E3800F167B2 /* PropertyStorage.h */,
    79687967                                AD1CF06816DCAB2D00B97123 /* PropertyTable.cpp */,
     7968                                BC95437C0EBA70FD0072B6D3 /* PropertyTable.h */,
    79697969                                65C02FBB0637462A003E7EE6 /* Protect.h */,
    79707970                                0F74B93A1F89614500B935D3 /* PrototypeKey.h */,
     
    1067710677                                0FD3E40E1B618B6600C80E1E /* PropertyCondition.h in Headers */,
    1067810678                                A7FB61001040C38B0017A286 /* PropertyDescriptor.h in Headers */,
    10679                                 BC95437D0EBA70FD0072B6D3 /* PropertyMapHashTable.h in Headers */,
     10679                                BC95437D0EBA70FD0072B6D3 /* PropertyTable.h in Headers */,
    1068010680                                86158AB3155C8B4000B45C9C /* PropertyName.h in Headers */,
    1068110681                                BC18C4540E16F5CD00B34460 /* PropertyNameArray.h in Headers */,
  • trunk/Source/JavaScriptCore/runtime/PropertyTable.cpp

    r285730 r286034  
    2525
    2626#include "config.h"
    27 #include "PropertyMapHashTable.h"
     27#include "PropertyTable.h"
    2828
    2929#include "JSCJSValueInlines.h"
  • trunk/Source/JavaScriptCore/runtime/PropertyTable.h

    r286033 r286034  
    4343#if DUMP_PROPERTYMAP_STATS
    4444
    45 struct PropertyMapHashTableStats {
     45struct PropertyTableStats {
    4646    std::atomic<unsigned> numFinds;
    4747    std::atomic<unsigned> numCollisions;
     
    5454};
    5555
    56 JS_EXPORT_PRIVATE extern PropertyMapHashTableStats* propertyMapHashTableStats;
     56JS_EXPORT_PRIVATE extern PropertyTableStats* propertyTableStats;
    5757
    5858#endif
     
    174174    std::pair<find_iterator, bool> WARN_UNUSED_RETURN add(VM&, const ValueType& entry);
    175175    // Remove a value from the table.
    176     void remove(VM&, const find_iterator& iter);
    177     void remove(VM&, const KeyType& key);
     176    void remove(VM&, const find_iterator&);
     177    void remove(VM&, const KeyType&);
    178178
    179179    // Returns the number of values in the hashtable.
     
    220220    void reinsert(const ValueType& entry);
    221221
    222     // Rehash the table.  Used to grow, or to recover deleted slots.
     222    // Rehash the table. Used to grow, or to recover deleted slots.
    223223    void rehash(VM&, unsigned newCapacity);
    224224
     
    231231    // For example, if m_tableSize is 16, then tableCapacity() is 8 - but the
    232232    // values array is actually 9 long (the 9th used for the deleted value/
    233     // iteration guard).  The 8 valid entries are numbered 1..8, so the
     233    // iteration guard). The 8 valid entries are numbered 1..8, so the
    234234    // deleted index is 9 (0 being reserved for empty).
    235235    unsigned deletedEntryIndex() const;
     
    299299
    300300#if DUMP_PROPERTYMAP_STATS
    301     ++propertyMapHashTableStats->numFinds;
     301    ++propertyTableStats->numFinds;
    302302#endif
    303303
     
    310310
    311311#if DUMP_PROPERTYMAP_STATS
    312         ++propertyMapHashTableStats->numCollisions;
     312        ++propertyTableStats->numCollisions;
    313313#endif
    314314
     
    334334
    335335#if DUMP_PROPERTYMAP_STATS
    336     ++propertyMapHashTableStats->numLookups;
     336    ++propertyTableStats->numLookups;
    337337#endif
    338338
     
    347347
    348348#if DUMP_PROPERTYMAP_STATS
    349         ++propertyMapHashTableStats->numLookupProbing;
     349        ++propertyTableStats->numLookupProbing;
    350350#endif
    351351
     
    364364
    365365#if DUMP_PROPERTYMAP_STATS
    366     ++propertyMapHashTableStats->numAdds;
     366    ++propertyTableStats->numAdds;
    367367#endif
    368368
     
    395395
    396396#if DUMP_PROPERTYMAP_STATS
    397     ++propertyMapHashTableStats->numRemoves;
     397    ++propertyTableStats->numRemoves;
    398398#endif
    399399
     
    490490{
    491491#if DUMP_PROPERTYMAP_STATS
    492     ++propertyMapHashTableStats->numReinserts;
     492    ++propertyTableStats->numReinserts;
    493493#endif
    494494
     
    509509{
    510510#if DUMP_PROPERTYMAP_STATS
    511     ++propertyMapHashTableStats->numRehashes;
     511    ++propertyTableStats->numRehashes;
    512512#endif
    513513
  • trunk/Source/JavaScriptCore/runtime/Structure.cpp

    r285687 r286034  
    3232#include "DumpContext.h"
    3333#include "JSCInlines.h"
    34 #include "PropertyMapHashTable.h"
    3534#include "PropertyNameArray.h"
     35#include "PropertyTable.h"
    3636#include <wtf/CommaPrinter.h>
    3737#include <wtf/NeverDestroyed.h>
     
    10491049#if DUMP_PROPERTYMAP_STATS
    10501050
    1051 PropertyMapHashTableStats* propertyMapHashTableStats = 0;
    1052 
    1053 struct PropertyMapStatisticsExitLogger {
    1054     PropertyMapStatisticsExitLogger();
    1055     ~PropertyMapStatisticsExitLogger();
     1051PropertyTableStats* propertyTableStats = 0;
     1052
     1053struct PropertyTableStatisticsExitLogger {
     1054    PropertyTableStatisticsExitLogger();
     1055    ~PropertyTableStatisticsExitLogger();
    10561056};
    10571057
    1058 DEFINE_GLOBAL_FOR_LOGGING(PropertyMapStatisticsExitLogger, logger, );
    1059 
    1060 PropertyMapStatisticsExitLogger::PropertyMapStatisticsExitLogger()
    1061 {
    1062     propertyMapHashTableStats = adoptPtr(new PropertyMapHashTableStats()).leakPtr();
    1063 }
    1064 
    1065 PropertyMapStatisticsExitLogger::~PropertyMapStatisticsExitLogger()
    1066 {
    1067     unsigned finds = propertyMapHashTableStats->numFinds;
    1068     unsigned collisions = propertyMapHashTableStats->numCollisions;
     1058DEFINE_GLOBAL_FOR_LOGGING(PropertyTableStatisticsExitLogger, logger, { });
     1059
     1060PropertyTableStatisticsExitLogger::PropertyTableStatisticsExitLogger()
     1061{
     1062    propertyTableStats = adoptPtr(new PropertyTableStats()).leakPtr();
     1063}
     1064
     1065PropertyTableStatisticsExitLogger::~PropertyTableStatisticsExitLogger()
     1066{
     1067    unsigned finds = propertyTableStats->numFinds;
     1068    unsigned collisions = propertyTableStats->numCollisions;
    10691069    dataLogF("\nJSC::PropertyMap statistics for process %d\n\n", getCurrentProcessID());
    10701070    dataLogF("%d finds\n", finds);
    10711071    dataLogF("%d collisions (%.1f%%)\n", collisions, 100.0 * collisions / finds);
    1072     dataLogF("%d lookups\n", propertyMapHashTableStats->numLookups.load());
    1073     dataLogF("%d lookup probings\n", propertyMapHashTableStats->numLookupProbing.load());
    1074     dataLogF("%d adds\n", propertyMapHashTableStats->numAdds.load());
    1075     dataLogF("%d removes\n", propertyMapHashTableStats->numRemoves.load());
    1076     dataLogF("%d rehashes\n", propertyMapHashTableStats->numRehashes.load());
    1077     dataLogF("%d reinserts\n", propertyMapHashTableStats->numReinserts.load());
     1072    dataLogF("%d lookups\n", propertyTableStats->numLookups.load());
     1073    dataLogF("%d lookup probings\n", propertyTableStats->numLookupProbing.load());
     1074    dataLogF("%d adds\n", propertyTableStats->numAdds.load());
     1075    dataLogF("%d removes\n", propertyTableStats->numRemoves.load());
     1076    dataLogF("%d rehashes\n", propertyTableStats->numRehashes.load());
     1077    dataLogF("%d reinserts\n", propertyTableStats->numReinserts.load());
    10781078}
    10791079
  • trunk/Source/JavaScriptCore/runtime/StructureInlines.h

    r285730 r286034  
    3030#include "JSCJSValueInlines.h"
    3131#include "JSGlobalObject.h"
    32 #include "PropertyMapHashTable.h"
     32#include "PropertyTable.h"
    3333#include "Structure.h"
    3434#include "StructureChain.h"
  • trunk/Source/JavaScriptCore/runtime/VM.cpp

    r285795 r286034  
    150150#include "ProgramCodeBlock.h"
    151151#include "ProgramExecutable.h"
    152 #include "PropertyMapHashTable.h"
     152#include "PropertyTable.h"
    153153#include "ProxyRevoke.h"
    154154#include "RandomizingFuzzerAgent.h"
Note: See TracChangeset for help on using the changeset viewer.