Ignore:
Timestamp:
Sep 10, 2012, 10:05:53 PM (13 years ago)
Author:
[email protected]
Message:

Remove m_classInfo from JSCell
https://bugs.webkit.org/show_bug.cgi?id=96311

Reviewed by Oliver Hunt.

Now that no one is using the ClassInfo in JSCell, we can remove it for the greater good. This is a 1.5% win on v8v7 and
a 1.7% win on kraken, and is an overall performance progression.

  • dfg/DFGSpeculativeJIT.h:

(JSC::DFG::SpeculativeJIT::emitAllocateBasicJSObject): Had to rearrange the order of when we take things off the free list
and when we store the Structure in the object because we would clobber the free list otherwise. This made it not okay for
the structure argument and the scratch register to alias one another. Also removed the store of the ClassInfo pointer in the
object. Yay!
(SpeculativeJIT):

  • dfg/DFGSpeculativeJIT32_64.cpp: Since it's no longer okay for for the scratch register and structure register to alias

one another as stated above, had to add an extra temporary for passing the Structure.
(JSC::DFG::SpeculativeJIT::compile):

  • dfg/DFGSpeculativeJIT64.cpp: Ditto.

(JSC::DFG::SpeculativeJIT::compile):

  • jit/JITInlineMethods.h:

(JSC::JIT::emitAllocateBasicJSObject): Similar changes to DFG's inline allocation except that it removed the object from
the free list first, so no changes were necessary there.

  • llint/LowLevelInterpreter.asm: Change the constants for amount of inline storage to match PropertyOffset.h and remove

the store of the ClassInfo pointer during inline allocation.

  • llint/LowLevelInterpreter32_64.asm:
  • llint/LowLevelInterpreter64.asm:
  • runtime/JSCell.h: Remove the m_classInfo field and associated methods.

(JSCell):

  • runtime/JSObject.h:

(JSObject):

  • runtime/PropertyOffset.h: Expand the number of inline storage properties to take up the extra space that we're freeing

with the removal of the ClassInfo pointer.
(JSC):

  • runtime/Structure.h:

(JSC):
(JSC::JSCell::JSCell):
(JSC::JSCell::finishCreation):

Location:
trunk/Source/JavaScriptCore/runtime
Files:
4 edited

Legend:

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

    r128084 r128146  
    110110        // Object operations, with the toObject operation included.
    111111        const ClassInfo* classInfo() const;
    112         const ClassInfo* validatedClassInfo() const;
    113112        const MethodTable* methodTable() const;
    114113        static void put(JSCell*, ExecState*, PropertyName, JSValue, PutPropertySlot&);
     
    135134        }
    136135
    137         static ptrdiff_t classInfoOffset()
    138         {
    139             return OBJECT_OFFSETOF(JSCell, m_classInfo);
    140         }
    141        
    142136        void* structureAddress()
    143137        {
     
    172166        friend class LLIntOffsetsExtractor;
    173167       
    174         const ClassInfo* m_classInfo;
    175168        WriteBarrier<Structure> m_structure;
    176169    };
  • trunk/Source/JavaScriptCore/runtime/JSObject.h

    r127202 r128146  
    347347
    348348        StorageBarrier m_outOfLineStorage;
    349 #if USE(JSVALUE32_64)
    350         void* m_padding;
    351 #endif
    352349    };
    353350
  • trunk/Source/JavaScriptCore/runtime/PropertyOffset.h

    r123905 r128146  
    3535
    3636#if USE(JSVALUE32_64)
     37#define INLINE_STORAGE_CAPACITY 7
     38#else
    3739#define INLINE_STORAGE_CAPACITY 6
    38 #else
    39 #define INLINE_STORAGE_CAPACITY 5
    4040#endif
    4141
  • trunk/Source/JavaScriptCore/runtime/Structure.h

    r128141 r128146  
    555555    }
    556556
    557     inline const ClassInfo* JSCell::validatedClassInfo() const
    558     {
    559 #if ENABLE(GC_VALIDATION)
    560         ASSERT(m_structure.unvalidatedGet()->classInfo() == m_classInfo);
    561 #else
    562         ASSERT(m_structure->classInfo() == m_classInfo);
    563 #endif
    564         return m_classInfo;
    565     }
    566 
    567557    ALWAYS_INLINE void SlotVisitor::internalAppend(JSCell* cell)
    568558    {
     
    604594
    605595    inline JSCell::JSCell(JSGlobalData& globalData, Structure* structure)
    606         : m_classInfo(structure->classInfo())
    607         , m_structure(globalData, this, structure)
     596        : m_structure(globalData, this, structure)
    608597    {
    609598    }
     
    617606#endif
    618607            m_structure.setEarlyValue(globalData, this, structure);
    619         m_classInfo = structure->classInfo();
    620608        // Very first set of allocations won't have a real structure.
    621609        ASSERT(m_structure || !globalData.structureStructure);
Note: See TracChangeset for help on using the changeset viewer.