⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 287004 in webkit


Ignore:
Timestamp:
Dec 13, 2021, 7:27:46 PM (5 years ago)
Author:
Russell Epstein
Message:

Cherry-pick r286580. rdar://problem/86445989

TypeInfo should be materializable from Structures as a single load.
https://bugs.webkit.org/show_bug.cgi?id=233875

Reviewed by Mark Lam.

This is mostly just the members of Structure and JSCell so that
JSType and InlineTypeFlags are at the end of the JSCell header.

  • assembler/testmasm.cpp: (JSC::testBranchIfType): (JSC::testBranchIfNotType):
  • ftl/FTLAbstractHeapRepository.cpp: (JSC::FTL::AbstractHeapRepository::AbstractHeapRepository):
  • runtime/JSCell.h:
  • runtime/JSCellInlines.h: (JSC::JSCell::JSCell):
  • runtime/Structure.h: (JSC::Structure::typeInfo const):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@286580 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Location:
branches/safari-613.1.11-branch/Source/JavaScriptCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-613.1.11-branch/Source/JavaScriptCore/ChangeLog

    r287003 r287004  
     12021-12-13  Russell Epstein  <repstein@apple.com>
     2
     3        Cherry-pick r286580. rdar://problem/86445989
     4
     5    TypeInfo should be materializable from Structures as a single load.
     6    https://bugs.webkit.org/show_bug.cgi?id=233875
     7   
     8    Reviewed by Mark Lam.
     9   
     10    This is mostly just the members of Structure and JSCell so that
     11    JSType and InlineTypeFlags are at the end of the JSCell header.
     12   
     13    * assembler/testmasm.cpp:
     14    (JSC::testBranchIfType):
     15    (JSC::testBranchIfNotType):
     16    * ftl/FTLAbstractHeapRepository.cpp:
     17    (JSC::FTL::AbstractHeapRepository::AbstractHeapRepository):
     18    * runtime/JSCell.h:
     19    * runtime/JSCellInlines.h:
     20    (JSC::JSCell::JSCell):
     21    * runtime/Structure.h:
     22    (JSC::Structure::typeInfo const):
     23   
     24   
     25    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@286580 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     26
     27    2021-12-06  Keith Miller  <keith_miller@apple.com>
     28
     29            TypeInfo should be materializable from Structures as a single load.
     30            https://bugs.webkit.org/show_bug.cgi?id=233875
     31
     32            Reviewed by Mark Lam.
     33
     34            This is mostly just the members of Structure and JSCell so that
     35            JSType and InlineTypeFlags are at the end of the JSCell header.
     36
     37            * assembler/testmasm.cpp:
     38            (JSC::testBranchIfType):
     39            (JSC::testBranchIfNotType):
     40            * ftl/FTLAbstractHeapRepository.cpp:
     41            (JSC::FTL::AbstractHeapRepository::AbstractHeapRepository):
     42            * runtime/JSCell.h:
     43            * runtime/JSCellInlines.h:
     44            (JSC::JSCell::JSCell):
     45            * runtime/Structure.h:
     46            (JSC::Structure::typeInfo const):
     47
    1482021-12-03  Keith Miller  <keith_miller@apple.com>
    249
  • branches/safari-613.1.11-branch/Source/JavaScriptCore/assembler/testmasm.cpp

    r286020 r287004  
    56145614        uint32_t structureID;
    56155615        uint8_t indexingType;
     5616        uint8_t cellState;
    56165617        JSType type;
    56175618    };
     
    56485649        uint32_t structureID;
    56495650        uint8_t indexingType;
     5651        uint8_t cellState;
    56505652        JSType type;
    56515653    };
  • branches/safari-613.1.11-branch/Source/JavaScriptCore/ftl/FTLAbstractHeapRepository.cpp

    r262338 r287004  
    7979    // Make sure that our explicit assumptions about the StructureIDBlob match reality.
    8080    RELEASE_ASSERT(!(JSCell_indexingTypeAndMisc.offset() & (sizeof(int32_t) - 1)));
    81     RELEASE_ASSERT(JSCell_indexingTypeAndMisc.offset() + 1 == JSCell_typeInfoType.offset());
    82     RELEASE_ASSERT(JSCell_indexingTypeAndMisc.offset() + 2 == JSCell_typeInfoFlags.offset());
    83     RELEASE_ASSERT(JSCell_indexingTypeAndMisc.offset() + 3 == JSCell_cellState.offset());
     81    RELEASE_ASSERT(JSCell_indexingTypeAndMisc.offset() + 1 == JSCell_cellState.offset());
     82    RELEASE_ASSERT(JSCell_indexingTypeAndMisc.offset() + 2 == JSCell_typeInfoType.offset());
     83    RELEASE_ASSERT(JSCell_indexingTypeAndMisc.offset() + 3 == JSCell_typeInfoFlags.offset());
    8484
    8585    JSCell_structureID.changeParent(&JSCell_header);
  • branches/safari-613.1.11-branch/Source/JavaScriptCore/runtime/JSCell.h

    r286345 r287004  
    267267    StructureID m_structureID;
    268268    IndexingType m_indexingTypeAndMisc; // DO NOT store to this field. Always CAS.
     269    CellState m_cellState;
    269270    JSType m_type;
    270271    TypeInfo::InlineTypeFlags m_flags;
    271     CellState m_cellState;
    272272};
    273273
  • branches/safari-613.1.11-branch/Source/JavaScriptCore/runtime/JSCellInlines.h

    r286345 r287004  
    5959    : m_structureID(structure->id())
    6060    , m_indexingTypeAndMisc(structure->indexingModeIncludingHistory())
     61    , m_cellState(CellState::DefinitelyWhite)
    6162    , m_type(structure->typeInfo().type())
    6263    , m_flags(structure->typeInfo().inlineTypeFlags())
    63     , m_cellState(CellState::DefinitelyWhite)
    6464{
    6565    ASSERT(!isCompilationThread());
  • branches/safari-613.1.11-branch/Source/JavaScriptCore/runtime/Structure.h

    r286502 r287004  
    262262   
    263263    // Type accessors.
     264#if CPU(NEEDS_ALIGNED_ACCESS)
    264265    TypeInfo typeInfo() const { return TypeInfo(m_cellHeaderType, m_cellHeaderInlineTypeFlags, m_outOfLineTypeFlags); }
     266#else
     267    TypeInfo typeInfo() const { return *reinterpret_cast_ptr<const TypeInfo*>(&m_cellHeaderType); }
     268#endif
    265269    bool isObject() const { return typeInfo().isObject(); }
    266270protected:
     
    857861    // JSCell.
    858862    IndexingType m_cellHeaderIndexingModeIncludingHistory;
     863    const CellState m_cellHeaderDefaultCellState { CellState::DefinitelyWhite };
    859864    const JSType m_cellHeaderType;
    860865    TypeInfo::InlineTypeFlags m_cellHeaderInlineTypeFlags;
    861     const CellState m_cellHeaderDefaultCellState { CellState::DefinitelyWhite };
    862866    TypeInfo::OutOfLineTypeFlags m_outOfLineTypeFlags;
    863867
Note: See TracChangeset for help on using the changeset viewer.