Changeset 95447 in webkit


Ignore:
Timestamp:
Sep 19, 2011 11:30:07 AM (13 years ago)
Author:
oliver@apple.com
Message:

Remove direct property slot pointers from the instruction stream
https://bugs.webkit.org/show_bug.cgi?id=68373

Reviewed by Gavin Barraclough.

Use an indirect load to access prototype properties rather than directly
storing the property address in the instruction stream. This should allow
further optimisations in future, and also provides a 0.5% win to sunspider.

  • dfg/DFGRepatch.cpp:

(JSC::DFG::generateProtoChainAccessStub):

  • jit/JITPropertyAccess.cpp:

(JSC::JIT::compileGetDirectOffset):

  • jit/JITPropertyAccess32_64.cpp:

(JSC::JIT::compileGetDirectOffset):

  • runtime/JSObject.h:

(JSC::JSObject::addressOfPropertyStorage):

Location:
trunk/Source/JavaScriptCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r95439 r95447  
     12011-09-19  Oliver Hunt  <oliver@apple.com>
     2
     3        Remove direct property slot pointers from the instruction stream
     4        https://bugs.webkit.org/show_bug.cgi?id=68373
     5
     6        Reviewed by Gavin Barraclough.
     7
     8        Use an indirect load to access prototype properties rather than directly
     9        storing the property address in the instruction stream.  This should allow
     10        further optimisations in future, and also provides a 0.5% win to sunspider.
     11
     12        * dfg/DFGRepatch.cpp:
     13        (JSC::DFG::generateProtoChainAccessStub):
     14        * jit/JITPropertyAccess.cpp:
     15        (JSC::JIT::compileGetDirectOffset):
     16        * jit/JITPropertyAccess32_64.cpp:
     17        (JSC::JIT::compileGetDirectOffset):
     18        * runtime/JSObject.h:
     19        (JSC::JSObject::addressOfPropertyStorage):
     20
    1212011-09-19  Oliver Hunt  <oliver@apple.com>
    222
  • trunk/Source/JavaScriptCore/dfg/DFGRepatch.cpp

    r95397 r95447  
    125125    }
    126126   
    127     stubJit.loadPtr(protoObject->addressOfPropertyAtOffset(offset), resultGPR);
    128        
     127    stubJit.loadPtr(protoObject->addressOfPropertyStorage(), resultGPR);
     128    stubJit.loadPtr(MacroAssembler::Address(resultGPR, offset * sizeof(WriteBarrier<Unknown>)), resultGPR);
     129
    129130    MacroAssembler::Jump success, fail;
    130131   
  • trunk/Source/JavaScriptCore/jit/JITPropertyAccess.cpp

    r95397 r95447  
    500500void JIT::compileGetDirectOffset(JSObject* base, RegisterID result, size_t cachedOffset)
    501501{
    502     loadPtr(static_cast<void*>(&base->m_propertyStorage[cachedOffset]), result);
     502    loadPtr(base->addressOfPropertyStorage(), result);
     503    loadPtr(Address(result, cachedOffset * sizeof(WriteBarrier<Unknown>)), result);
    503504}
    504505
  • trunk/Source/JavaScriptCore/jit/JITPropertyAccess32_64.cpp

    r95397 r95447  
    459459void JIT::compileGetDirectOffset(JSObject* base, RegisterID resultTag, RegisterID resultPayload, size_t cachedOffset)
    460460{
    461     load32(reinterpret_cast<char*>(&base->m_propertyStorage[cachedOffset]) + OBJECT_OFFSETOF(JSValue, u.asBits.payload), resultPayload);
    462     load32(reinterpret_cast<char*>(&base->m_propertyStorage[cachedOffset]) + OBJECT_OFFSETOF(JSValue, u.asBits.tag), resultTag);
     461    loadPtr(base->addressOfPropertyStorage(), resultTag);
     462    load32(Address(resultTag, cachedOffset * sizeof(WriteBarrier<Unknown>) + OBJECT_OFFSETOF(JSValue, u.asBits.payload)), result);
     463    load32(Address(resultTag, cachedOffset * sizeof(WriteBarrier<Unknown>) + OBJECT_OFFSETOF(JSValue, u.asBits.tag)), resultTag);
    463464}
    464465
  • trunk/Source/JavaScriptCore/runtime/JSObject.h

    r95439 r95447  
    211211        bool isUsingInlineStorage() const { return static_cast<const void*>(m_propertyStorage.get()) == static_cast<const void*>(this + 1); }
    212212
    213         void* addressOfPropertyAtOffset(size_t offset)
    214         {
    215             return static_cast<void*>(&m_propertyStorage[offset]);
     213        void* addressOfPropertyStorage()
     214        {
     215            return &m_propertyStorage;
    216216        }
    217217
Note: See TracChangeset for help on using the changeset viewer.