Ignore:
Timestamp:
Jun 7, 2012, 9:25:58 PM (13 years ago)
Author:
[email protected]
Message:

DFG should inline prototype chain accesses, and do the right things if the
specific function optimization is available
https://bugs.webkit.org/show_bug.cgi?id=88594

Patch by Filip Pizlo <[email protected]> on 2012-06-07
Reviewed by Gavin Barraclough.

Looks like a 3% win on V8.

  • bytecode/CodeBlock.h:

(JSC::Structure::prototypeForLookup):
(JSC):

  • bytecode/GetByIdStatus.cpp:

(JSC::GetByIdStatus::computeFromLLInt):
(JSC):
(JSC::GetByIdStatus::computeForChain):
(JSC::GetByIdStatus::computeFor):

  • bytecode/GetByIdStatus.h:

(JSC::GetByIdStatus::GetByIdStatus):
(JSC::GetByIdStatus::isSimple):
(JSC::GetByIdStatus::chain):
(JSC::GetByIdStatus::specificValue):
(GetByIdStatus):

  • bytecode/StructureSet.h:

(StructureSet):
(JSC::StructureSet::singletonStructure):

  • bytecode/StructureStubInfo.h:

(JSC::StructureStubInfo::initGetByIdProto):
(JSC::StructureStubInfo::initGetByIdChain):

  • dfg/DFGByteCodeParser.cpp:

(JSC::DFG::ByteCodeParser::handleGetById):

  • dfg/DFGRepatch.cpp:

(JSC::DFG::tryCacheGetByID):

  • jit/JITStubs.cpp:

(JSC::JITThunks::tryCacheGetByID):

  • runtime/JSGlobalObject.h:

(JSC::Structure::prototypeForLookup):
(JSC):

  • runtime/Structure.h:

(Structure):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/JSObject.h

    r119568 r119795  
    237237        static size_t offsetOfInlineStorage();
    238238        static size_t offsetOfPropertyStorage();
    239         static size_t offsetOfInheritorID();
    240239
    241240        static JS_EXPORTDATA const ClassInfo s_info;
     
    265264        JSObject(JSGlobalData&, Structure*, PropertyStorage inlineStorage);
    266265       
    267         void resetInheritorID()
    268         {
    269             m_inheritorID.clear();
     266        void resetInheritorID(JSGlobalData& globalData)
     267        {
     268            removeDirect(globalData, globalData.m_inheritorIDKey);
    270269        }
    271270
     
    304303
    305304        StorageBarrier m_propertyStorage;
    306         WriteBarrier<Structure> m_inheritorID;
     305
     306#if USE(JSVALUE32_64)
     307        // FIXME: keep the size of JSObject a multiple of 64-bits, so that the
     308        // internal storage is aligned. We can remove this when we remove JSCell's
     309        // direct ClassInfo pointer.
     310        void* sixtyFourBitAlign;
     311#endif
    307312    };
    308313
     
    312317#define JSFinalObject_inlineStorageCapacity 6
    313318#else
    314 #define JSNonFinalObject_inlineStorageCapacity 2
    315 #define JSFinalObject_inlineStorageCapacity 4
     319#define JSNonFinalObject_inlineStorageCapacity 3
     320#define JSFinalObject_inlineStorageCapacity 5
    316321#endif
    317322
     
    418423}
    419424
    420 inline size_t JSObject::offsetOfInheritorID()
    421 {
    422     return OBJECT_OFFSETOF(JSObject, m_inheritorID);
    423 }
    424 
    425425inline bool JSObject::isGlobalObject() const
    426426{
     
    515515inline Structure* JSObject::inheritorID(JSGlobalData& globalData)
    516516{
    517     if (m_inheritorID) {
    518         ASSERT(m_inheritorID->isEmpty());
    519         return m_inheritorID.get();
     517    if (WriteBarrierBase<Unknown>* location = getDirectLocation(globalData, globalData.m_inheritorIDKey)) {
     518        Structure* inheritorID = jsCast<Structure*>(location->get());
     519        ASSERT(inheritorID->isEmpty());
     520        return inheritorID;
    520521    }
    521522    return createInheritorID(globalData);
Note: See TracChangeset for help on using the changeset viewer.