Changeset 266769 in webkit


Ignore:
Timestamp:
Sep 8, 2020 8:32:10 PM (4 years ago)
Author:
rniwa@webkit.org
Message:

Having an iframe as a descendent node shouldn't require ElementRareData
https://bugs.webkit.org/show_bug.cgi?id=216264

Reviewed by Darin Adler.

Store the number of connected frames in the descendent nodes directly in Node using CompactUniquePtrTuple
in the same space as where we store the NodeRareData pointer. This avoids creating ElementRareData on every
ancestor element and shadow host / document of an iframe.

Also moved TabIndexState there to simply NodeFlags, and created CustomElementState to replace the existing
flags in NodeFlags to match the latest terminology used in the specification:
https://dom.spec.whatwg.org/#concept-element-custom-element-state

CustomElementState has four states: "uncustomized" (default; builtin elements), "undefined" (i.e. element has
a valid custom element but it hasn't been defined or upgraded yet), "custom" (a valid custom element instance),
and "failed" (upgrading has resulted in an error). Before this patch, "uncustomized" meant that neither
IsCustomElement nor IsEditingTextOrUndefinedCustomElementFlag is set, "undefined" had IsCustomElement
and IsEditingTextOrUndefinedCustomElementFlag set, and "custom" had IsCustomElement set but
IsEditingTextOrUndefinedCustomElementFlag unset whereas "failed" had the opposite.

No new tests since there should be no observable behavioral change.

  • cssjit/SelectorCompiler.cpp:

(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChild): Mask out the bits stored in
the pointer in the 64-bit architecture. In the 32-bit architecture, the pointer is the first component
without any extra bits stored in it.

  • dom/Element.cpp:

(WebCore::Node::setTabIndexState): Moved from Node.h. Updated to use the newly introduced bitfields.
(WebCore::Node::setCustomElementState): Added.
(WebCore::Element::setIsDefinedCustomElement): Now updates CustomElementState in the newly added bitfields.
(WebCore::Element::setIsFailedCustomElementWithoutClearingReactionQueue): Ditto.
(WebCore::Element::setIsCustomElementUpgradeCandidate): Ditto.

  • dom/ElementRareData.cpp:
  • dom/ElementRareData.h:

(WebCore::ElementRareData): Moved m_unusualTabIndex and m_childIndex to NodeRareData for better packing.

  • dom/Node.cpp:

(WebCore::Node::materializeRareData):
(WebCore::Node::clearRareData):
(WebCore::Node::connectedSubframeCount const): Moved to the header file.
(WebCore::Node::incrementConnectedSubframeCount): Now updates the newly added bitfields.
(WebCore::Node::decrementConnectedSubframeCount): Ditto.

  • dom/Node.h:

(WebCore::Node::isUndefinedCustomElement const): Now uses CustomElementState in the newly added bitfields.
(WebCore::Node::isCustomElementUpgradeCandidate const): Ditto.
(WebCore::Node::isDefinedCustomElement const): Ditto.
(WebCore::Node::isFailedCustomElement const): Ditto.
(WebCore::Node::isEditingText const):
(WebCore::Node::connectedSubframeCount const): Moved here from cpp file.
(WebCore::Node::rareDataMemoryOffset):
(WebCore::Node::rareDataPointerMask): Added.
(WebCore::Node::CustomElementState): Added.
(WebCore::Node::RareDataBitFields): Added.
(WebCore::Node::rareDataBitfields const): Added.
(WebCore::Node::setRareDataBitfields): Added.
(WebCore::Node::tabIndexState const): Updated to use rareDataBitfields.
(WebCore::Node::setTabIndexState): Moved to Element.cpp.
(WebCore::Node::customElementState const): Added.
(WebCore::Node::hasRareData const):
(WebCore::Node::rareData const):

  • dom/NodeRareData.cpp:
  • dom/NodeRareData.h:

(WebCore::NodeRareData::UseType): Removed ConnectedFrameCount.
(WebCore::NodeRareData::NodeRareData):
(WebCore::NodeRareData::useTypes const):
(WebCore::NodeRareData::connectedSubframeCount const): Deleted.
(WebCore::NodeRareData::incrementConnectedSubframeCount): Deleted.
(WebCore::NodeRareData::decrementConnectedSubframeCount): Deleted.
(WebCore::NodeRareData): Moved m_unusualTabIndex and m_childIndex here for better packing in 64-bit architecture.

Location:
trunk/Source/WebCore
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r266768 r266769  
     12020-09-08  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Having an iframe as a descendent node shouldn't require ElementRareData
     4        https://bugs.webkit.org/show_bug.cgi?id=216264
     5
     6        Reviewed by Darin Adler.
     7
     8        Store the number of connected frames in the descendent nodes directly in Node using CompactUniquePtrTuple
     9        in the same space as where we store the NodeRareData pointer. This avoids creating ElementRareData on every
     10        ancestor element and shadow host / document of an iframe.
     11
     12        Also moved TabIndexState there to simply NodeFlags, and created CustomElementState to replace the existing
     13        flags in NodeFlags to match the latest terminology used in the specification:
     14        https://dom.spec.whatwg.org/#concept-element-custom-element-state
     15
     16        CustomElementState has four states: "uncustomized" (default; builtin elements), "undefined" (i.e. element has
     17        a valid custom element but it hasn't been defined or upgraded yet), "custom" (a valid custom element instance),
     18        and "failed" (upgrading has resulted in an error). Before this patch, "uncustomized" meant that neither
     19        IsCustomElement nor IsEditingTextOrUndefinedCustomElementFlag is set, "undefined" had IsCustomElement
     20        and IsEditingTextOrUndefinedCustomElementFlag set, and "custom" had IsCustomElement set but
     21        IsEditingTextOrUndefinedCustomElementFlag unset whereas "failed" had the opposite.
     22
     23        No new tests since there should be no observable behavioral change.
     24
     25        * cssjit/SelectorCompiler.cpp:
     26        (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChild): Mask out the bits stored in
     27        the pointer in the 64-bit architecture. In the 32-bit architecture, the pointer is the first component
     28        without any extra bits stored in it.
     29        * dom/Element.cpp:
     30        (WebCore::Node::setTabIndexState): Moved from Node.h. Updated to use the newly introduced bitfields.
     31        (WebCore::Node::setCustomElementState): Added.
     32        (WebCore::Element::setIsDefinedCustomElement): Now updates CustomElementState in the newly added bitfields.
     33        (WebCore::Element::setIsFailedCustomElementWithoutClearingReactionQueue): Ditto.
     34        (WebCore::Element::setIsCustomElementUpgradeCandidate): Ditto.
     35        * dom/ElementRareData.cpp:
     36        * dom/ElementRareData.h:
     37        (WebCore::ElementRareData): Moved m_unusualTabIndex and m_childIndex to NodeRareData for better packing.
     38        * dom/Node.cpp:
     39        (WebCore::Node::materializeRareData):
     40        (WebCore::Node::clearRareData):
     41        (WebCore::Node::connectedSubframeCount const): Moved to the header file.
     42        (WebCore::Node::incrementConnectedSubframeCount): Now updates the newly added bitfields.
     43        (WebCore::Node::decrementConnectedSubframeCount): Ditto.
     44        * dom/Node.h:
     45        (WebCore::Node::isUndefinedCustomElement const): Now uses CustomElementState in the newly added bitfields.
     46        (WebCore::Node::isCustomElementUpgradeCandidate const): Ditto.
     47        (WebCore::Node::isDefinedCustomElement const): Ditto.
     48        (WebCore::Node::isFailedCustomElement const): Ditto.
     49        (WebCore::Node::isEditingText const):
     50        (WebCore::Node::connectedSubframeCount const): Moved here from cpp file.
     51        (WebCore::Node::rareDataMemoryOffset):
     52        (WebCore::Node::rareDataPointerMask): Added.
     53        (WebCore::Node::CustomElementState): Added.
     54        (WebCore::Node::RareDataBitFields): Added.
     55        (WebCore::Node::rareDataBitfields const): Added.
     56        (WebCore::Node::setRareDataBitfields): Added.
     57        (WebCore::Node::tabIndexState const): Updated to use rareDataBitfields.
     58        (WebCore::Node::setTabIndexState): Moved to Element.cpp.
     59        (WebCore::Node::customElementState const): Added.
     60        (WebCore::Node::hasRareData const):
     61        (WebCore::Node::rareData const):
     62        * dom/NodeRareData.cpp:
     63        * dom/NodeRareData.h:
     64        (WebCore::NodeRareData::UseType): Removed ConnectedFrameCount.
     65        (WebCore::NodeRareData::NodeRareData):
     66        (WebCore::NodeRareData::useTypes const):
     67        (WebCore::NodeRareData::connectedSubframeCount const): Deleted.
     68        (WebCore::NodeRareData::incrementConnectedSubframeCount): Deleted.
     69        (WebCore::NodeRareData::decrementConnectedSubframeCount): Deleted.
     70        (WebCore::NodeRareData): Moved m_unusualTabIndex and m_childIndex here for better packing in 64-bit architecture.
     71
    1722020-09-08  Tim Horton  <timothy_horton@apple.com>
    273
  • trunk/Source/WebCore/cssjit/SelectorCompiler.cpp

    r263117 r266769  
    35833583        m_assembler.loadPtr(Assembler::Address(previousSibling, Node::rareDataMemoryOffset()), elementRareData);
    35843584
     3585        LocalRegister rareDataPointerMask(m_registerAllocator);
     3586        m_assembler.move(Assembler::TrustedImmPtr(Node::rareDataPointerMask()), rareDataPointerMask);
     3587        m_assembler.andPtr(rareDataPointerMask, elementRareData);
     3588
    35853589        noCachedChildIndexCases.append(m_assembler.branchTestPtr(Assembler::Zero, elementRareData));
    35863590        {
  • trunk/Source/WebCore/dom/Element.cpp

    r266714 r266769  
    242242}
    243243
     244inline void Node::setTabIndexState(TabIndexState state)
     245{
     246    auto bitfields = rareDataBitfields();
     247    bitfields.tabIndexState = static_cast<uint16_t>(state);
     248    setRareDataBitfields(bitfields);
     249}
     250
    244251void Element::setTabIndexExplicitly(Optional<int> tabIndex)
    245252{
     
    24232430}
    24242431
     2432inline void Node::setCustomElementState(CustomElementState state)
     2433{
     2434    auto bitfields = rareDataBitfields();
     2435    bitfields.customElementState = static_cast<uint16_t>(state);
     2436    setRareDataBitfields(bitfields);
     2437}
     2438
    24252439void Element::setIsDefinedCustomElement(JSCustomElementInterface& elementInterface)
    24262440{
    2427     clearFlag(IsEditingTextOrUndefinedCustomElementFlag);
    2428     setFlag(IsCustomElement);
     2441    setCustomElementState(CustomElementState::Custom);
    24292442    auto& data = ensureElementRareData();
    24302443    if (!data.customElementReactionQueue())
     
    24432456{
    24442457    ASSERT(isUndefinedCustomElement());
    2445     ASSERT(getFlag(IsEditingTextOrUndefinedCustomElementFlag));
    2446     clearFlag(IsCustomElement);
     2458    ASSERT(customElementState() == CustomElementState::Undefined);
     2459    setCustomElementState(CustomElementState::Failed);
    24472460    InspectorInstrumentation::didChangeCustomElementState(*this);
    24482461}
     
    24602473void Element::setIsCustomElementUpgradeCandidate()
    24612474{
    2462     ASSERT(!getFlag(IsCustomElement));
    2463     setFlag(IsCustomElement);
    2464     setFlag(IsEditingTextOrUndefinedCustomElementFlag);
     2475    ASSERT(customElementState() == CustomElementState::Uncustomized);
     2476    setCustomElementState(CustomElementState::Undefined);
    24652477    InspectorInstrumentation::didChangeCustomElementState(*this);
    24662478}
  • trunk/Source/WebCore/dom/ElementRareData.cpp

    r266714 r266769  
    3535
    3636struct SameSizeAsElementRareData : NodeRareData {
    37     int tabIndex;
    38     unsigned short childIndex;
    3937    LayoutSize sizeForResizing;
    4038    IntPoint savedLayerScrollPosition;
  • trunk/Source/WebCore/dom/ElementRareData.h

    r266714 r266769  
    159159
    160160private:
    161     int m_unusualTabIndex { 0 };
    162     unsigned short m_childIndex { 0 };
    163 
    164161    LayoutSize m_minimumSizeForResizing;
    165162    IntPoint m_savedLayerScrollPosition;
  • trunk/Source/WebCore/dom/Node.cpp

    r266714 r266769  
    414414{
    415415    if (is<Element>(*this))
    416         m_rareData = std::unique_ptr<NodeRareData, NodeRareDataDeleter>(new ElementRareData);
     416        m_rareDataWithBitfields.setPointer(std::unique_ptr<NodeRareData, NodeRareDataDeleter>(new ElementRareData));
    417417    else
    418         m_rareData = std::unique_ptr<NodeRareData, NodeRareDataDeleter>(new NodeRareData);
     418        m_rareDataWithBitfields.setPointer(std::unique_ptr<NodeRareData, NodeRareDataDeleter>(new NodeRareData));
    419419}
    420420
     
    432432    ASSERT(!transientMutationObserverRegistry() || transientMutationObserverRegistry()->isEmpty());
    433433
    434     m_rareData = nullptr;
     434    m_rareDataWithBitfields.setPointer(nullptr);
    435435}
    436436
     
    25742574}
    25752575
    2576 unsigned Node::connectedSubframeCount() const
    2577 {
    2578     return hasRareData() ? rareData()->connectedSubframeCount() : 0;
    2579 }
    2580 
    25812576void Node::incrementConnectedSubframeCount(unsigned amount)
    25822577{
     2578    static_assert(RareDataBitFields { Page::maxNumberOfFrames, 0, 0 }.connectedSubframeCount == Page::maxNumberOfFrames, "connectedSubframeCount must fit Page::maxNumberOfFrames");
     2579
    25832580    ASSERT(isContainerNode());
    2584     ensureRareData().incrementConnectedSubframeCount(amount);
     2581    auto bitfields = rareDataBitfields();
     2582    bitfields.connectedSubframeCount += amount;
     2583    RELEASE_ASSERT(bitfields.connectedSubframeCount == rareDataBitfields().connectedSubframeCount + amount);
     2584    setRareDataBitfields(bitfields);
    25852585}
    25862586
    25872587void Node::decrementConnectedSubframeCount(unsigned amount)
    25882588{
    2589     ASSERT(rareData());
    2590     if (!hasRareData())
    2591         return; // Defend against type confusion when the above assertion fails. See webkit.org/b/200300.
    2592     rareData()->decrementConnectedSubframeCount(amount);
     2589    ASSERT(isContainerNode());
     2590    auto bitfields = rareDataBitfields();
     2591    RELEASE_ASSERT(amount <= bitfields.connectedSubframeCount);
     2592    bitfields.connectedSubframeCount -= amount;
     2593    setRareDataBitfields(bitfields);
    25932594}
    25942595
  • trunk/Source/WebCore/dom/Node.h

    r266714 r266769  
    3333#include "TreeScope.h"
    3434#include <wtf/CompactPointerTuple.h>
     35#include <wtf/CompactUniquePtrTuple.h>
    3536#include <wtf/Forward.h>
    3637#include <wtf/IsoMalloc.h>
     
    230231    HTMLSlotElement* assignedSlotForBindings() const;
    231232
    232     bool isUndefinedCustomElement() const { return isElementNode() && getFlag(IsEditingTextOrUndefinedCustomElementFlag); }
    233     bool isCustomElementUpgradeCandidate() const { return getFlag(IsCustomElement) && getFlag(IsEditingTextOrUndefinedCustomElementFlag); }
    234     bool isDefinedCustomElement() const { return getFlag(IsCustomElement) && !getFlag(IsEditingTextOrUndefinedCustomElementFlag); }
    235     bool isFailedCustomElement() const { return isElementNode() && !getFlag(IsCustomElement) && getFlag(IsEditingTextOrUndefinedCustomElementFlag); }
     233    bool isUndefinedCustomElement() const { return customElementState() == CustomElementState::Undefined || customElementState() == CustomElementState::Failed; }
     234    bool isCustomElementUpgradeCandidate() const { return customElementState() == CustomElementState::Undefined; }
     235    bool isDefinedCustomElement() const { return customElementState() == CustomElementState::Custom; }
     236    bool isFailedCustomElement() const { return customElementState() == CustomElementState::Failed; }
    236237
    237238    // Returns null, a child of ShadowRoot, or a legacy shadow root.
     
    297298    bool styleResolutionShouldRecompositeLayer() const { return hasStyleFlag(NodeStyleFlag::StyleResolutionShouldRecompositeLayer); }
    298299    bool childNeedsStyleRecalc() const { return hasStyleFlag(NodeStyleFlag::DescendantNeedsStyleResolution); }
    299     bool isEditingText() const { return getFlag(IsTextFlag) && getFlag(IsEditingTextOrUndefinedCustomElementFlag); }
     300    bool isEditingText() const { return getFlag(IsTextFlag) && getFlag(IsEditingText); }
    300301
    301302    void setChildNeedsStyleRecalc() { setStyleFlag(NodeStyleFlag::DescendantNeedsStyleResolution); }
     
    492493    void notifyMutationObserversNodeWillDetach();
    493494
    494     unsigned connectedSubframeCount() const;
     495    unsigned connectedSubframeCount() const { return rareDataBitfields().connectedSubframeCount; }
    495496    void incrementConnectedSubframeCount(unsigned amount = 1);
    496497    void decrementConnectedSubframeCount(unsigned amount = 1);
     
    500501#if ENABLE(JIT)
    501502    static ptrdiff_t nodeFlagsMemoryOffset() { return OBJECT_OFFSETOF(Node, m_nodeFlags); }
    502     static ptrdiff_t rareDataMemoryOffset() { return OBJECT_OFFSETOF(Node, m_rareData); }
     503    static ptrdiff_t rareDataMemoryOffset() { return OBJECT_OFFSETOF(Node, m_rareDataWithBitfields); }
     504#if CPU(ADDRESS64)
     505    static uint64_t rareDataPointerMask() { return CompactPointerTuple<NodeRareData*, uint16_t>::pointerMask; }
     506#else
     507    static uint32_t rareDataPointerMask() { return -1; }
     508#endif
    503509    static int32_t flagIsText() { return IsTextFlag; }
    504510    static int32_t flagIsContainer() { return IsContainerFlag; }
     
    527533        // UnusedFlag = 1 << 12,
    528534        // UnusedFlag = 1 << 13,
     535        // UnusedFlag = 1 << 14,
    529536
    530537        // These bits are used by derived classes, pulled up here so they can
    531538        // be stored in the same memory word as the Node bits above.
    532         IsEditingTextOrUndefinedCustomElementFlag = 1 << 14, // Text and Element
    533         IsCustomElement = 1 << 15, // Element
    534         HasFocusWithin = 1 << 16,
     539        IsEditingText = 1 << 15, // Text
     540        HasFocusWithin = 1 << 16, // Element
    535541        IsLinkFlag = 1 << 17,
    536542        IsUserActionElement = 1 << 18,
     
    548554#endif
    549555
    550         // Bits 27-29 are free.
    551         // Bits 30-31: TabIndexState
     556        // Bits 27-31 are free.
    552557
    553558        DefaultNodeFlags = IsParsingChildrenFinishedFlag
    554559    };
    555560
    556     static constexpr unsigned s_tabIndexStateBitOffset = 30;
    557     static constexpr uint32_t s_tabIndexStateBitMask = 3U << s_tabIndexStateBitOffset;
    558561    enum class TabIndexState : uint8_t {
    559562        NotSet = 0,
     
    563566    };
    564567
     568    enum class CustomElementState : uint8_t {
     569        Uncustomized = 0,
     570        Undefined = 1,
     571        Custom = 2,
     572        Failed = 3,
     573    };
     574
     575    struct RareDataBitFields {
     576        uint16_t connectedSubframeCount : 10;
     577        uint16_t tabIndexState : 2;
     578        uint16_t customElementState : 2;
     579    };
     580
    565581    bool getFlag(NodeFlags mask) const { return m_nodeFlags & mask; }
    566582    void setFlag(bool f, NodeFlags mask) const { m_nodeFlags = (m_nodeFlags & ~mask) | (-(int32_t)f & mask); }
     
    568584    void clearFlag(NodeFlags mask) const { m_nodeFlags &= ~mask; }
    569585
    570     TabIndexState tabIndexState() const { return static_cast<TabIndexState>((m_nodeFlags & s_tabIndexStateBitMask) >> s_tabIndexStateBitOffset); }
    571     void setTabIndexState(TabIndexState state) { m_nodeFlags = (m_nodeFlags & ~s_tabIndexStateBitMask) | (static_cast<uint32_t>(state) << s_tabIndexStateBitOffset); }
     586    RareDataBitFields rareDataBitfields() const { return bitwise_cast<RareDataBitFields>(m_rareDataWithBitfields.type()); }
     587    void setRareDataBitfields(RareDataBitFields bitfields) { m_rareDataWithBitfields.setType(bitwise_cast<uint16_t>(bitfields)); }
     588
     589    TabIndexState tabIndexState() const { return static_cast<TabIndexState>(rareDataBitfields().tabIndexState); }
     590    void setTabIndexState(TabIndexState);
     591
     592    CustomElementState customElementState() const { return static_cast<CustomElementState>(rareDataBitfields().customElementState); }
     593    void setCustomElementState(CustomElementState);
    572594
    573595    bool isParsingChildrenFinished() const { return getFlag(IsParsingChildrenFinishedFlag); }
     
    587609        CreateMathMLElement = CreateElement | IsMathMLFlag,
    588610        CreateDocument = CreateContainer | IsDocumentNodeFlag | IsConnectedFlag,
    589         CreateEditingText = CreateText | IsEditingTextOrUndefinedCustomElementFlag,
     611        CreateEditingText = CreateText | IsEditingText,
    590612    };
    591613    Node(Document&, ConstructionType);
     
    649671    virtual void addSubresourceAttributeURLs(ListHashSet<URL>&) const { }
    650672
    651     bool hasRareData() const { return !!m_rareData; }
    652     NodeRareData* rareData() const { return m_rareData.get(); }
     673    bool hasRareData() const { return !!m_rareDataWithBitfields.pointer(); }
     674    NodeRareData* rareData() const { return m_rareDataWithBitfields.pointer(); }
    653675    NodeRareData& ensureRareData();
    654676    void clearRareData();
     
    706728    Node* m_next { nullptr };
    707729    CompactPointerTuple<RenderObject*, uint16_t> m_rendererWithStyleFlags;
    708     std::unique_ptr<NodeRareData, NodeRareDataDeleter> m_rareData;
     730    CompactUniquePtrTuple<NodeRareData, uint16_t, NodeRareDataDeleter> m_rareDataWithBitfields;
    709731};
    710732
  • trunk/Source/WebCore/dom/NodeRareData.cpp

    r253987 r266769  
    3737
    3838struct SameSizeAsNodeRareData {
    39     unsigned m_frameCountAndIsElementRareDataFlag;
     39    uint32_t m_tabIndex;
     40    uint32_t m_childIndexAndIsElementRareDataFlag;
    4041    void* m_pointer[2];
    4142};
  • trunk/Source/WebCore/dom/NodeRareData.h

    r266714 r266769  
    246246#if defined(DUMP_NODE_STATISTICS) && DUMP_NODE_STATISTICS
    247247    enum class UseType : uint32_t {
    248         ConnectedFrameCount = 1 << 0,
    249         NodeList = 1 << 1,
    250         MutationObserver = 1 << 2,
    251         TabIndex = 1 << 3,
    252         MinimumSize = 1 << 4,
    253         ScrollingPosition = 1 << 5,
    254         ComputedStyle = 1 << 6,
    255         Dataset = 1 << 7,
    256         ClassList = 1 << 8,
    257         ShadowRoot = 1 << 9,
    258         CustomElementQueue = 1 << 10,
    259         AttributeMap = 1 << 11,
    260         InteractionObserver = 1 << 12,
    261         ResizeObserver = 1 << 13,
    262         Animations = 1 << 14,
    263         PseudoElements = 1 << 15,
    264         StyleMap = 1 << 16,
    265         PartList = 1 << 17,
    266         PartNames = 1 << 18,
     248        NodeList = 1 << 0,
     249        MutationObserver = 1 << 1,
     250        TabIndex = 1 << 2,
     251        MinimumSize = 1 << 3,
     252        ScrollingPosition = 1 << 4,
     253        ComputedStyle = 1 << 5,
     254        Dataset = 1 << 6,
     255        ClassList = 1 << 7,
     256        ShadowRoot = 1 << 8,
     257        CustomElementQueue = 1 << 9,
     258        AttributeMap = 1 << 10,
     259        InteractionObserver = 1 << 11,
     260        ResizeObserver = 1 << 12,
     261        Animations = 1 << 13,
     262        PseudoElements = 1 << 14,
     263        StyleMap = 1 << 15,
     264        PartList = 1 << 16,
     265        PartNames = 1 << 17,
    267266    };
    268267#endif
     
    271270
    272271    NodeRareData(Type type = Type::Node)
    273         : m_connectedFrameCount(0)
    274         , m_isElementRareData(type == Type::Element)
     272        : m_isElementRareData(type == Type::Element)
    275273    {
    276274    }
     
    295293    }
    296294
    297     unsigned connectedSubframeCount() const { return m_connectedFrameCount; }
    298     void incrementConnectedSubframeCount(unsigned amount)
    299     {
    300         m_connectedFrameCount += amount;
    301     }
    302     void decrementConnectedSubframeCount(unsigned amount)
    303     {
    304         ASSERT(m_connectedFrameCount);
    305         ASSERT(amount <= m_connectedFrameCount);
    306         m_connectedFrameCount -= amount;
    307     }
    308 
    309295#if DUMP_NODE_STATISTICS
    310296    OptionSet<UseType> useTypes() const
    311297    {
    312298        OptionSet<UseType> result;
    313         if (m_connectedFrameCount)
    314             result.add(UseType::ConnectedFrameCount);
    315299        if (m_nodeLists)
    316300            result.add(UseType::NodeList);
     
    321305#endif
    322306
     307protected:
     308    // Used by ElementRareData. Defined here for better packing in 64-bit.
     309    int m_unusualTabIndex { 0 };
     310    unsigned short m_childIndex { 0 };
     311
    323312private:
    324     unsigned m_connectedFrameCount : 31; // Must fit Page::maxNumberOfFrames.
    325     unsigned m_isElementRareData : 1;
     313    bool m_isElementRareData;
    326314
    327315    std::unique_ptr<NodeListsNodeData> m_nodeLists;
Note: See TracChangeset for help on using the changeset viewer.