Changeset 37629 in webkit for trunk/JavaScriptCore
- Timestamp:
- Oct 15, 2008, 10:31:41 PM (17 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r37627 r37629 1 2008-10-15 Sam Weinig <[email protected]> 2 3 Reviewed by Goeffrey Garen. 4 5 Add function to dump statistics for StructureIDs. 6 7 * kjs/StructureID.cpp: 8 (JSC::StructureID::dumpStatistics): 9 (JSC::StructureID::StructureID): 10 (JSC::StructureID::~StructureID): 11 * kjs/StructureID.h: 12 1 13 2008-10-15 Cameron Zwarich <[email protected]> 2 14 -
trunk/JavaScriptCore/kjs/StructureID.cpp
r37627 r37629 38 38 namespace JSC { 39 39 40 #ifndef NDEBUG 40 #ifndef NDEBUG 41 41 static WTF::RefCountedLeakCounter structureIDCounter("StructureID"); 42 42 43 43 static bool shouldIgnoreLeaks; 44 44 static HashSet<StructureID*> ignoreSet; 45 #endif 46 47 #if DUMP_STRUCTURE_ID_STATISTICS 48 static HashSet<StructureID*> liveStructureIDSet; 49 50 void StructureID::dumpStatistics() 51 { 52 unsigned numberUsingSingleSlot = 0; 53 54 HashSet<StructureID*>::const_iterator end = liveStructureIDSet.end(); 55 for (HashSet<StructureID*>::const_iterator it = liveStructureIDSet.begin(); it != end; ++it) { 56 StructureID* structureID = *it; 57 if (structureID->m_usingSingleTransitionSlot) 58 ++numberUsingSingleSlot; 59 } 60 61 printf("Number of live StructureIDs: %d\n", liveStructureIDSet.size()); 62 printf("Number of StructureIDs using the single item optimization for transition map: %d\n", numberUsingSingleSlot); 63 } 45 64 #endif 46 65 … … 69 88 structureIDCounter.increment(); 70 89 #endif 90 91 #if DUMP_STRUCTURE_ID_STATISTICS 92 liveStructureIDSet.add(this); 93 #endif 71 94 } 72 95 … … 98 121 else 99 122 structureIDCounter.decrement(); 123 #endif 124 125 #if DUMP_STRUCTURE_ID_STATISTICS 126 liveStructureIDSet.remove(this); 100 127 #endif 101 128 } -
trunk/JavaScriptCore/kjs/StructureID.h
r37627 r37629 38 38 #include <wtf/PassRefPtr.h> 39 39 #include <wtf/RefCounted.h> 40 41 #define DUMP_STRUCTURE_ID_STATISTICS 0 40 42 41 43 namespace JSC { … … 85 87 static void startIgnoringLeaks(); 86 88 static void stopIgnoringLeaks(); 89 90 #if DUMP_STRUCTURE_ID_STATISTICS 91 static void dumpStatistics(); 92 #endif 87 93 88 94 static PassRefPtr<StructureID> changePrototypeTransition(StructureID*, JSValue* prototype);
Note:
See TracChangeset
for help on using the changeset viewer.