Changeset 37981 in webkit for trunk/JavaScriptCore
- Timestamp:
- Oct 29, 2008, 3:27:31 PM (17 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r37976 r37981 1 2008-10-29 Sam Weinig <[email protected]> 2 3 Reviewed by Cameron Zwarich. 4 5 Fix for https://bugs.webkit.org/show_bug.cgi?id=21958 6 Pack bits in StructureID to reduce the size of each StructureID by 2 words. 7 8 * runtime/PropertyMap.h: 9 (JSC::PropertyMap::propertyMapSize): 10 * runtime/StructureID.cpp: 11 (JSC::StructureID::dumpStatistics): Add additional size statistics when dumping. 12 (JSC::StructureID::StructureID): 13 * runtime/StructureID.h: 14 1 15 2008-10-29 Kevin Ollivier <[email protected]> 2 16 -
trunk/JavaScriptCore/runtime/PropertyMap.h
r37938 r37981 104 104 unsigned storageSize() const { return m_table ? m_table->keyCount + m_deletedOffsets.size() : 0; } 105 105 106 size_t propertyMapSize() const 107 { 108 return sizeof(PropertyMap) + (m_table ? PropertyMapHashTable::allocationSize(m_table->size) : 0); 109 } 110 106 111 static const unsigned emptyEntryIndex = 0; 107 112 -
trunk/JavaScriptCore/runtime/StructureID.cpp
r37938 r37981 61 61 unsigned numberUsingSingleSlot = 0; 62 62 unsigned numberSingletons = 0; 63 unsigned totalPropertyMapsSize = 0; 63 64 64 65 HashSet<StructureID*>::const_iterator end = liveStructureIDSet.end(); … … 74 75 ++numberSingletons; 75 76 } 77 78 totalPropertyMapsSize += structureID->propertyMap().propertyMapSize(); 76 79 } 77 80 … … 80 83 printf("Number of StructureIDs that are leaf nodes: %d\n", numberLeaf); 81 84 printf("Number of StructureIDs that singletons: %d\n", numberSingletons); 85 86 printf("Size of a single StructureIDs: %d\n", static_cast<unsigned>(sizeof(StructureID))); 87 printf("Size of sum of all property maps: %d\n", totalPropertyMapsSize); 88 printf("Size of average of all property maps: %f\n", static_cast<double>(totalPropertyMapsSize) / static_cast<double>(liveStructureIDSet.size())); 82 89 } 83 90 #endif … … 85 92 StructureID::StructureID(JSValue* prototype, const TypeInfo& typeInfo) 86 93 : m_typeInfo(typeInfo) 87 , m_isDictionary(false)88 , m_hasGetterSetterProperties(false)89 94 , m_prototype(prototype) 90 95 , m_cachedPrototypeChain(0) … … 92 97 , m_nameInPrevious(0) 93 98 , m_transitionCount(0) 94 , m_usingSingleTransitionSlot(true)95 99 , m_propertyStorageCapacity(JSObject::inlineStorageCapacity) 96 100 , m_cachedTransistionOffset(WTF::notFound) 101 , m_isDictionary(false) 102 , m_hasGetterSetterProperties(false) 103 , m_usingSingleTransitionSlot(true) 104 , m_attributesInPrevious(0) 97 105 { 98 106 ASSERT(m_prototype); -
trunk/JavaScriptCore/runtime/StructureID.h
r37938 r37981 150 150 TypeInfo m_typeInfo; 151 151 152 bool m_isDictionary;153 154 bool m_hasGetterSetterProperties;155 156 152 JSValue* m_prototype; 157 153 RefPtr<StructureIDChain> m_cachedPrototypeChain; … … 159 155 RefPtr<StructureID> m_previous; 160 156 UString::Rep* m_nameInPrevious; 161 unsigned m_attributesInPrevious;162 157 163 158 size_t m_transitionCount; 164 bool m_usingSingleTransitionSlot;165 159 union { 166 160 StructureID* singleTransition; … … 174 168 175 169 size_t m_cachedTransistionOffset; 170 171 bool m_isDictionary : 1; 172 bool m_hasGetterSetterProperties : 1; 173 bool m_usingSingleTransitionSlot : 1; 174 unsigned m_attributesInPrevious : 5; 176 175 }; 177 176
Note:
See TracChangeset
for help on using the changeset viewer.