Ignore:
Timestamp:
Oct 28, 2009, 6:25:02 PM (16 years ago)
Author:
[email protected]
Message:

Improve for..in enumeration performance
https://bugs.webkit.org/show_bug.cgi?id=30887

Reviewed by Geoff Garen.

Improve indexing of an object with a for..in iterator by
identifying cases where get_by_val is being used with a iterator
as the subscript and replace it with a new get_by_pname
bytecode. get_by_pname then optimizes lookups that directly access
the base object.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/Structure.h

    r49734 r50254  
    9696
    9797        void growPropertyStorageCapacity();
    98         size_t propertyStorageCapacity() const { return m_propertyStorageCapacity; }
    99         size_t propertyStorageSize() const { return m_propertyTable ? m_propertyTable->keyCount + m_propertyTable->anonymousSlotCount + (m_propertyTable->deletedOffsets ? m_propertyTable->deletedOffsets->size() : 0) : m_offset + 1; }
     98        unsigned propertyStorageCapacity() const { return m_propertyStorageCapacity; }
     99        unsigned propertyStorageSize() const { return m_propertyTable ? m_propertyTable->keyCount + m_propertyTable->anonymousSlotCount + (m_propertyTable->deletedOffsets ? m_propertyTable->deletedOffsets->size() : 0) : m_offset + 1; }
    100100        bool isUsingInlineStorage() const;
    101101
     
    120120        void setHasGetterSetterProperties(bool hasGetterSetterProperties) { m_hasGetterSetterProperties = hasGetterSetterProperties; }
    121121
     122        bool hasNonEnumerableProperties() const { return m_hasNonEnumerableProperties; }
     123
     124        bool hasAnonymousSlots() const { return m_propertyTable && m_propertyTable->anonymousSlotCount; }
     125       
    122126        bool isEmpty() const { return m_propertyTable ? !m_propertyTable->keyCount : m_offset == noOffset; }
    123127
     
    191195        PropertyMapHashTable* m_propertyTable;
    192196
    193         size_t m_propertyStorageCapacity;
     197        uint32_t m_propertyStorageCapacity;
    194198        signed char m_offset;
    195199
     
    197201        bool m_isPinnedPropertyTable : 1;
    198202        bool m_hasGetterSetterProperties : 1;
     203        bool m_hasNonEnumerableProperties : 1;
    199204#if COMPILER(WINSCW)
    200205        // Workaround for Symbian WINSCW compiler that cannot resolve unsigned type of the declared
Note: See TracChangeset for help on using the changeset viewer.