Changeset 286034 in webkit
- Timestamp:
- Nov 18, 2021, 3:19:03 PM (5 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 7 edited
- 1 moved
-
CMakeLists.txt (modified) (2 diffs)
-
ChangeLog (modified) (1 diff)
-
JavaScriptCore.xcodeproj/project.pbxproj (modified) (5 diffs)
-
runtime/PropertyTable.cpp (modified) (1 diff)
-
runtime/PropertyTable.h (moved) (moved from trunk/Source/JavaScriptCore/runtime/PropertyMapHashTable.h ) (13 diffs)
-
runtime/Structure.cpp (modified) (2 diffs)
-
runtime/StructureInlines.h (modified) (1 diff)
-
runtime/VM.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/CMakeLists.txt
r285955 r286034 1140 1140 runtime/ProgramExecutable.h 1141 1141 runtime/PropertyDescriptor.h 1142 runtime/PropertyMapHashTable.h1143 1142 runtime/PropertyName.h 1144 1143 runtime/PropertyNameArray.h … … 1146 1145 runtime/PropertySlot.h 1147 1146 runtime/PropertyStorage.h 1147 runtime/PropertyTable.h 1148 1148 runtime/Protect.h 1149 1149 runtime/PrototypeKey.h -
trunk/Source/JavaScriptCore/ChangeLog
r286033 r286034 1 2021-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 1 31 2021-11-18 Mark Lam <mark.lam@apple.com> 2 32 -
trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r286018 r286034 1751 1751 BC87CDB910712AD4000614CF /* JSONObject.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = BC87CDB810712ACA000614CF /* JSONObject.lut.h */; }; 1752 1752 BC9041480EB9250900FE26FA /* StructureTransitionTable.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9041470EB9250900FE26FA /* StructureTransitionTable.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1753 BC95437D0EBA70FD0072B6D3 /* Property MapHashTable.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, ); }; }; 1754 1754 BCBE2CAE14E985AA000593AD /* GCAssertions.h in Headers */ = {isa = PBXBuildFile; fileRef = BCBE2CAD14E985AA000593AD /* GCAssertions.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1755 1755 BCCF0D080EF0AAB900413C8F /* StructureStubInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = BCCF0D070EF0AAB900413C8F /* StructureStubInfo.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 4992 4992 BC8F3CCF0DAF17BA00577A80 /* ConstructData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConstructData.h; sourceTree = "<group>"; }; 4993 4993 BC9041470EB9250900FE26FA /* StructureTransitionTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StructureTransitionTable.h; sourceTree = "<group>"; }; 4994 BC95437C0EBA70FD0072B6D3 /* Property MapHashTable.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>"; }; 4995 4995 BC9BB95B0E19680600DF8855 /* InternalFunction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InternalFunction.cpp; sourceTree = "<group>"; }; 4996 4996 BCA62DFE0E2826230004F30D /* CallData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CallData.cpp; sourceTree = "<group>"; }; … … 7959 7959 A7FB60A3103F7DC20017A286 /* PropertyDescriptor.cpp */, 7960 7960 A7FB604B103F5EAB0017A286 /* PropertyDescriptor.h */, 7961 BC95437C0EBA70FD0072B6D3 /* PropertyMapHashTable.h */,7962 7961 86158AB2155C8B3F00B45C9C /* PropertyName.h */, 7963 7962 65400C100A69BAF200509887 /* PropertyNameArray.h */, … … 7967 7966 0FB7F39015ED8E3800F167B2 /* PropertyStorage.h */, 7968 7967 AD1CF06816DCAB2D00B97123 /* PropertyTable.cpp */, 7968 BC95437C0EBA70FD0072B6D3 /* PropertyTable.h */, 7969 7969 65C02FBB0637462A003E7EE6 /* Protect.h */, 7970 7970 0F74B93A1F89614500B935D3 /* PrototypeKey.h */, … … 10677 10677 0FD3E40E1B618B6600C80E1E /* PropertyCondition.h in Headers */, 10678 10678 A7FB61001040C38B0017A286 /* PropertyDescriptor.h in Headers */, 10679 BC95437D0EBA70FD0072B6D3 /* Property MapHashTable.h in Headers */,10679 BC95437D0EBA70FD0072B6D3 /* PropertyTable.h in Headers */, 10680 10680 86158AB3155C8B4000B45C9C /* PropertyName.h in Headers */, 10681 10681 BC18C4540E16F5CD00B34460 /* PropertyNameArray.h in Headers */, -
trunk/Source/JavaScriptCore/runtime/PropertyTable.cpp
r285730 r286034 25 25 26 26 #include "config.h" 27 #include "Property MapHashTable.h"27 #include "PropertyTable.h" 28 28 29 29 #include "JSCJSValueInlines.h" -
trunk/Source/JavaScriptCore/runtime/PropertyTable.h
r286033 r286034 43 43 #if DUMP_PROPERTYMAP_STATS 44 44 45 struct Property MapHashTableStats {45 struct PropertyTableStats { 46 46 std::atomic<unsigned> numFinds; 47 47 std::atomic<unsigned> numCollisions; … … 54 54 }; 55 55 56 JS_EXPORT_PRIVATE extern Property MapHashTableStats* propertyMapHashTableStats;56 JS_EXPORT_PRIVATE extern PropertyTableStats* propertyTableStats; 57 57 58 58 #endif … … 174 174 std::pair<find_iterator, bool> WARN_UNUSED_RETURN add(VM&, const ValueType& entry); 175 175 // 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&); 178 178 179 179 // Returns the number of values in the hashtable. … … 220 220 void reinsert(const ValueType& entry); 221 221 222 // Rehash the table. Used to grow, or to recover deleted slots.222 // Rehash the table. Used to grow, or to recover deleted slots. 223 223 void rehash(VM&, unsigned newCapacity); 224 224 … … 231 231 // For example, if m_tableSize is 16, then tableCapacity() is 8 - but the 232 232 // 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 the233 // iteration guard). The 8 valid entries are numbered 1..8, so the 234 234 // deleted index is 9 (0 being reserved for empty). 235 235 unsigned deletedEntryIndex() const; … … 299 299 300 300 #if DUMP_PROPERTYMAP_STATS 301 ++property MapHashTableStats->numFinds;301 ++propertyTableStats->numFinds; 302 302 #endif 303 303 … … 310 310 311 311 #if DUMP_PROPERTYMAP_STATS 312 ++property MapHashTableStats->numCollisions;312 ++propertyTableStats->numCollisions; 313 313 #endif 314 314 … … 334 334 335 335 #if DUMP_PROPERTYMAP_STATS 336 ++property MapHashTableStats->numLookups;336 ++propertyTableStats->numLookups; 337 337 #endif 338 338 … … 347 347 348 348 #if DUMP_PROPERTYMAP_STATS 349 ++property MapHashTableStats->numLookupProbing;349 ++propertyTableStats->numLookupProbing; 350 350 #endif 351 351 … … 364 364 365 365 #if DUMP_PROPERTYMAP_STATS 366 ++property MapHashTableStats->numAdds;366 ++propertyTableStats->numAdds; 367 367 #endif 368 368 … … 395 395 396 396 #if DUMP_PROPERTYMAP_STATS 397 ++property MapHashTableStats->numRemoves;397 ++propertyTableStats->numRemoves; 398 398 #endif 399 399 … … 490 490 { 491 491 #if DUMP_PROPERTYMAP_STATS 492 ++property MapHashTableStats->numReinserts;492 ++propertyTableStats->numReinserts; 493 493 #endif 494 494 … … 509 509 { 510 510 #if DUMP_PROPERTYMAP_STATS 511 ++property MapHashTableStats->numRehashes;511 ++propertyTableStats->numRehashes; 512 512 #endif 513 513 -
trunk/Source/JavaScriptCore/runtime/Structure.cpp
r285687 r286034 32 32 #include "DumpContext.h" 33 33 #include "JSCInlines.h" 34 #include "PropertyMapHashTable.h"35 34 #include "PropertyNameArray.h" 35 #include "PropertyTable.h" 36 36 #include <wtf/CommaPrinter.h> 37 37 #include <wtf/NeverDestroyed.h> … … 1049 1049 #if DUMP_PROPERTYMAP_STATS 1050 1050 1051 Property MapHashTableStats* propertyMapHashTableStats = 0;1052 1053 struct Property MapStatisticsExitLogger {1054 Property MapStatisticsExitLogger();1055 ~Property MapStatisticsExitLogger();1051 PropertyTableStats* propertyTableStats = 0; 1052 1053 struct PropertyTableStatisticsExitLogger { 1054 PropertyTableStatisticsExitLogger(); 1055 ~PropertyTableStatisticsExitLogger(); 1056 1056 }; 1057 1057 1058 DEFINE_GLOBAL_FOR_LOGGING(Property MapStatisticsExitLogger, logger,);1059 1060 Property MapStatisticsExitLogger::PropertyMapStatisticsExitLogger()1061 { 1062 property MapHashTableStats = adoptPtr(new PropertyMapHashTableStats()).leakPtr();1063 } 1064 1065 Property MapStatisticsExitLogger::~PropertyMapStatisticsExitLogger()1066 { 1067 unsigned finds = property MapHashTableStats->numFinds;1068 unsigned collisions = property MapHashTableStats->numCollisions;1058 DEFINE_GLOBAL_FOR_LOGGING(PropertyTableStatisticsExitLogger, logger, { }); 1059 1060 PropertyTableStatisticsExitLogger::PropertyTableStatisticsExitLogger() 1061 { 1062 propertyTableStats = adoptPtr(new PropertyTableStats()).leakPtr(); 1063 } 1064 1065 PropertyTableStatisticsExitLogger::~PropertyTableStatisticsExitLogger() 1066 { 1067 unsigned finds = propertyTableStats->numFinds; 1068 unsigned collisions = propertyTableStats->numCollisions; 1069 1069 dataLogF("\nJSC::PropertyMap statistics for process %d\n\n", getCurrentProcessID()); 1070 1070 dataLogF("%d finds\n", finds); 1071 1071 dataLogF("%d collisions (%.1f%%)\n", collisions, 100.0 * collisions / finds); 1072 dataLogF("%d lookups\n", property MapHashTableStats->numLookups.load());1073 dataLogF("%d lookup probings\n", property MapHashTableStats->numLookupProbing.load());1074 dataLogF("%d adds\n", property MapHashTableStats->numAdds.load());1075 dataLogF("%d removes\n", property MapHashTableStats->numRemoves.load());1076 dataLogF("%d rehashes\n", property MapHashTableStats->numRehashes.load());1077 dataLogF("%d reinserts\n", property MapHashTableStats->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()); 1078 1078 } 1079 1079 -
trunk/Source/JavaScriptCore/runtime/StructureInlines.h
r285730 r286034 30 30 #include "JSCJSValueInlines.h" 31 31 #include "JSGlobalObject.h" 32 #include "Property MapHashTable.h"32 #include "PropertyTable.h" 33 33 #include "Structure.h" 34 34 #include "StructureChain.h" -
trunk/Source/JavaScriptCore/runtime/VM.cpp
r285795 r286034 150 150 #include "ProgramCodeBlock.h" 151 151 #include "ProgramExecutable.h" 152 #include "Property MapHashTable.h"152 #include "PropertyTable.h" 153 153 #include "ProxyRevoke.h" 154 154 #include "RandomizingFuzzerAgent.h"
Note:
See TracChangeset
for help on using the changeset viewer.