Changeset 37653 in webkit for trunk/JavaScriptCore/kjs/JSObject.h


Ignore:
Timestamp:
Oct 17, 2008, 4:55:09 AM (17 years ago)
Author:
[email protected]
Message:

2008-10-17 Maciej Stachowiak <[email protected]>

Reviewed by Cameron Zwarich.


  • speed up transitions that resize the property storage a fair bit


~3% speedup on v8 RayTrace benchmark, ~1% on DeltaBlue

  • VM/CTI.cpp: (JSC::resizePropertyStorage): renamed from transitionObject, and reduced to just resize the object's property storage with one inline call. (JSC::CTI::privateCompilePutByIdTransition): Use a separate function for property storage resize, but still do all the rest of the work in assembly in that case, and pass the known compile-time constants of old and new size rather than structureIDs, saving a bunch of redundant memory access.
  • kjs/JSObject.cpp: (JSC::JSObject::allocatePropertyStorage): Just call the inline version.
  • kjs/JSObject.h: (JSC::JSObject::allocatePropertyStorageInline): Inline version of allocatePropertyStorage
  • masm/X86Assembler.h: (JSC::X86Assembler::): (JSC::X86Assembler::pushl_i32): Add code to assmeble push of a constant; code originally by Cameron Zwarich.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/JSObject.h

    r37645 r37653  
    178178
    179179        void allocatePropertyStorage(size_t oldSize, size_t newSize);
     180        void allocatePropertyStorageInline(size_t oldSize, size_t newSize);
    180181        bool usingInlineStorage() const { return m_propertyStorage == m_inlineStorage; }
    181182
     
    507508}
    508509
     510ALWAYS_INLINE void JSObject::allocatePropertyStorageInline(size_t oldSize, size_t newSize)
     511{
     512    ASSERT(newSize > oldSize);
     513
     514    JSValue** oldPropertStorage = m_propertyStorage;
     515    m_propertyStorage = new JSValue*[newSize];
     516
     517    for (unsigned i = 0; i < oldSize; ++i)
     518        m_propertyStorage[i] = oldPropertStorage[i];
     519
     520    if (oldPropertStorage != m_inlineStorage)
     521        delete [] oldPropertStorage;
     522}
     523
    509524} // namespace JSC
    510525
Note: See TracChangeset for help on using the changeset viewer.