Changeset 37981 in webkit for trunk/JavaScriptCore


Ignore:
Timestamp:
Oct 29, 2008, 3:27:31 PM (17 years ago)
Author:
[email protected]
Message:

2008-10-29 Sam Weinig <[email protected]>

Reviewed by Cameron Zwarich.

Fix for https://bugs.webkit.org/show_bug.cgi?id=21958
Pack bits in StructureID to reduce the size of each StructureID by 2 words.

  • runtime/PropertyMap.h: (JSC::PropertyMap::propertyMapSize):
  • runtime/StructureID.cpp: (JSC::StructureID::dumpStatistics): Add additional size statistics when dumping. (JSC::StructureID::StructureID):
  • runtime/StructureID.h:
Location:
trunk/JavaScriptCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r37976 r37981  
     12008-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
    1152008-10-29  Kevin Ollivier  <[email protected]>
    216
  • trunk/JavaScriptCore/runtime/PropertyMap.h

    r37938 r37981  
    104104        unsigned storageSize() const { return m_table ? m_table->keyCount + m_deletedOffsets.size() : 0; }
    105105
     106        size_t propertyMapSize() const
     107        {
     108            return sizeof(PropertyMap) + (m_table ? PropertyMapHashTable::allocationSize(m_table->size) : 0);
     109        }
     110
    106111        static const unsigned emptyEntryIndex = 0;
    107112
  • trunk/JavaScriptCore/runtime/StructureID.cpp

    r37938 r37981  
    6161    unsigned numberUsingSingleSlot = 0;
    6262    unsigned numberSingletons = 0;
     63    unsigned totalPropertyMapsSize = 0;
    6364
    6465    HashSet<StructureID*>::const_iterator end = liveStructureIDSet.end();
     
    7475                ++numberSingletons;
    7576        }
     77
     78        totalPropertyMapsSize += structureID->propertyMap().propertyMapSize();
    7679    }
    7780
     
    8083    printf("Number of StructureIDs that are leaf nodes: %d\n", numberLeaf);
    8184    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()));
    8289}
    8390#endif
     
    8592StructureID::StructureID(JSValue* prototype, const TypeInfo& typeInfo)
    8693    : m_typeInfo(typeInfo)
    87     , m_isDictionary(false)
    88     , m_hasGetterSetterProperties(false)
    8994    , m_prototype(prototype)
    9095    , m_cachedPrototypeChain(0)
     
    9297    , m_nameInPrevious(0)
    9398    , m_transitionCount(0)
    94     , m_usingSingleTransitionSlot(true)
    9599    , m_propertyStorageCapacity(JSObject::inlineStorageCapacity)
    96100    , m_cachedTransistionOffset(WTF::notFound)
     101    , m_isDictionary(false)
     102    , m_hasGetterSetterProperties(false)
     103    , m_usingSingleTransitionSlot(true)
     104    , m_attributesInPrevious(0)
    97105{
    98106    ASSERT(m_prototype);
  • trunk/JavaScriptCore/runtime/StructureID.h

    r37938 r37981  
    150150        TypeInfo m_typeInfo;
    151151
    152         bool m_isDictionary;
    153 
    154         bool m_hasGetterSetterProperties;
    155 
    156152        JSValue* m_prototype;
    157153        RefPtr<StructureIDChain> m_cachedPrototypeChain;
     
    159155        RefPtr<StructureID> m_previous;
    160156        UString::Rep* m_nameInPrevious;
    161         unsigned m_attributesInPrevious;
    162157
    163158        size_t m_transitionCount;
    164         bool m_usingSingleTransitionSlot;
    165159        union {
    166160            StructureID* singleTransition;
     
    174168
    175169        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;
    176175    };
    177176
Note: See TracChangeset for help on using the changeset viewer.