Changeset 195141 in webkit


Ignore:
Timestamp:
Jan 15, 2016 12:01:42 PM (8 years ago)
Author:
akling@apple.com
Message:

Source/WebCore:
Use BumpArena for style sheet object tree.
<https://webkit.org/b/152696>

Reviewed by Antti Koivisto.

Give each StyleSheetContents its own BumpArena, and plumb it down through CSSParser
to allocate StyleRule, StyleProperties and CSSSelectorList's selector arrays there.

This basically means that most objects that make up a given style sheet will end up
in one (or a few) contiguous region(s) of memory, instead of being scattered all
over the malloc heap.

In the common case (no CSSOM manipulation), the lifetimes of these objects are very
predictable: everything tends to die when the StyleSheetContents dies.
This dramatically improves space-efficiency in those cases, and allows us to return
contiguous chunks of memory to the system once a style sheet is no longer needed.

One-off CSS parses that don't work within a StyleSheetContents context will have
their StyleRules & co allocated through FastMalloc just like before.

Bonus: give SelectorQueryCache a dedicated BumpArena as well, since it has very
predictable lifetime.

  • css/CSSGrammar.y.in:
  • css/CSSKeyframesRule.h:

(WebCore::StyleRuleKeyframes::create):

  • css/CSSParser.cpp:

(WebCore::CSSParser::createStyleProperties):
(WebCore::CSSParser::createMediaRule):
(WebCore::CSSParser::createSupportsRule):
(WebCore::CSSParser::createKeyframesRule):
(WebCore::CSSParser::setArena):
(WebCore::CSSParser::arena):
(WebCore::CSSParser::createStyleRule):
(WebCore::CSSParser::createFontFaceRule):
(WebCore::CSSParser::createPageRule):
(WebCore::CSSParser::createRegionRule):
(WebCore::CSSParser::createViewportRule):

  • css/CSSParser.h:
  • css/CSSParserValues.cpp:

(WebCore::CSSParserSelector::parsePseudoElementCueFunctionSelector):
(WebCore::CSSParserSelector::adoptSelectorVector):

  • css/CSSParserValues.h:
  • css/CSSSelectorList.cpp:

(WebCore::CSSSelectorList::CSSSelectorList):
(WebCore::CSSSelectorList::adoptSelectorVector):
(WebCore::CSSSelectorList::deleteSelectors):

  • css/CSSSelectorList.h:
  • css/StyleProperties.cpp:

(WebCore::ImmutableStyleProperties::create):
(WebCore::StyleProperties::immutableCopyIfNeeded):

  • css/StyleProperties.h:
  • css/StyleRule.cpp:

(WebCore::StyleRule::create):
(WebCore::StyleRule::splitIntoMultipleRulesWithMaximumSelectorComponentCount):
(WebCore::StyleRuleRegion::StyleRuleRegion):

  • css/StyleRule.h:

(WebCore::StyleRule::create):
(WebCore::StyleRule::parserAdoptSelectorVector):
(WebCore::StyleRuleFontFace::create):
(WebCore::StyleRulePage::create):
(WebCore::StyleRulePage::parserAdoptSelectorVector):
(WebCore::StyleRuleMedia::create):
(WebCore::StyleRuleSupports::create):
(WebCore::StyleRuleRegion::create):
(WebCore::StyleRuleViewport::create):

  • css/StyleSheetContents.cpp:

(WebCore::StyleSheetContents::StyleSheetContents):
(WebCore::StyleSheetContents::parseAuthorStyleSheet):
(WebCore::StyleSheetContents::parseStringAtPosition):

  • css/StyleSheetContents.h:
  • dom/SelectorQuery.cpp:

(WebCore::SelectorQueryCache::SelectorQueryCache):
(WebCore::SelectorQueryCache::add):

  • dom/SelectorQuery.h:
  • svg/SVGFontFaceElement.cpp:

(WebCore::SVGFontFaceElement::SVGFontFaceElement):

Source/WTF:
Fragmentation-free allocator for timeless and/or coupled allocations.
<https://webkit.org/b/152696>

Reviewed by Antti Koivisto.

Introduce BumpArena, a space-efficient memory allocator for situations where
you feel pretty confident betting on allocation lifetimes.

Basic design:

  • Reserves 128MB range of memory at startup.
  • Allocates 4kB-aligned blocks of 4kB from VM at a time.
  • Bump-pointer allocates out of a block until it reaches end.
  • Each allocation increments the ref-count of its block.
  • Each deallocation decrements the ref-count of its block.
  • Transparently falls back to fastMalloc()/fastFree() when needed.

Interface:

  • BumpArena::create()

Create your very own BumpArena!

  • BumpArena::allocate(BumpArena* arena, size_t size)

Allocates 'size' bytes of memory from 'arena'.
If 'arena' is null, falls back to fastMalloc().

  • BumpArena::deallocate(void* ptr)

If 'ptr' is BumpArena allocation, decrements block ref-count.
If 'ptr' is FastMalloc allocation, calls fastFree() on it.

  • WTF_MAKE_BUMPARENA_ALLOCATED;

Macro that gives a class or struct custom operators new and delete
for allocation out of BumpArena. Just like WTF_MAKE_FAST_ALLOCATED;

Note that while the name of this patch says "fragmentation-free allocator"
it will only be fragmentation-free when used for appropriate things.
This is not meant to be a general-purpose allocator. Only use it for sets of
allocations that are known to die roughly at the same time.

BumpArena will never resume allocating from a block that has been filled,
so it's even more important than usual that everything gets deallocated.

BumpArena redirects allocations to FastMalloc in three cases:

  • When invoked with a null BumpArena*
  • When allocation request is larger than BumpArena's block size (4kB)
  • When BumpArena has exhausted all of its pre-reserved VM. (128MB)

The VM allocator will eagerly return blocks of VM to the kernel by calling
madvise(). Average time spent in madvise is around 0.007ms on my box.

  • WTF.vcxproj/WTF.vcxproj:
  • WTF.vcxproj/WTF.vcxproj.filters:
  • WTF.xcodeproj/project.pbxproj:
  • wtf/BumpArena.cpp: Added.

(WTF::BumpArena::Block::capacity):
(WTF::BumpArena::Block::arena):
(WTF::BumpArena::Block::payloadStart):
(WTF::arenas):
(WTF::BumpArena::Block::Block):
(WTF::BumpArena::Block::~Block):
(WTF::BumpArena::Block::ref):
(WTF::BlockAllocator::BlockAllocator):
(WTF::BlockAllocator::isAllocation):
(WTF::blockAllocator):
(WTF::BlockAllocator::allocateBlock):
(WTF::BlockAllocator::deallocateBlock):
(WTF::BumpArena::Block::deref):
(WTF::BumpArena::Block::create):
(WTF::BumpArena::Block::dump):
(WTF::BumpArena::dump):
(WTF::BumpArena::create):
(WTF::BumpArena::BumpArena):
(WTF::BumpArena::~BumpArena):
(WTF::BumpArena::allocateSlow):
(WTF::BumpArena::allocate):
(WTF::BumpArena::deallocate):
(WTF::BumpArena::Block::blockFor):
(WTF::BumpArena::arenaFor):

  • wtf/BumpArena.h: Added.
  • wtf/CMakeLists.txt:
Location:
trunk/Source
Files:
2 added
23 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r195094 r195141  
     12016-01-15  Andreas Kling  <akling@apple.com>
     2
     3        Fragmentation-free allocator for timeless and/or coupled allocations.
     4        <https://webkit.org/b/152696>
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Introduce BumpArena, a space-efficient memory allocator for situations where
     9        you feel pretty confident betting on allocation lifetimes.
     10
     11        Basic design:
     12
     13            - Reserves 128MB range of memory at startup.
     14            - Allocates 4kB-aligned blocks of 4kB from VM at a time.
     15            - Bump-pointer allocates out of a block until it reaches end.
     16            - Each allocation increments the ref-count of its block.
     17            - Each deallocation decrements the ref-count of its block.
     18            - Transparently falls back to fastMalloc()/fastFree() when needed.
     19
     20        Interface:
     21
     22            - BumpArena::create()
     23
     24                Create your very own BumpArena!
     25
     26            - BumpArena::allocate(BumpArena* arena, size_t size)
     27
     28                Allocates 'size' bytes of memory from 'arena'.
     29                If 'arena' is null, falls back to fastMalloc().
     30
     31            - BumpArena::deallocate(void* ptr)
     32
     33                If 'ptr' is BumpArena allocation, decrements block ref-count.
     34                If 'ptr' is FastMalloc allocation, calls fastFree() on it.
     35
     36            - WTF_MAKE_BUMPARENA_ALLOCATED;
     37
     38                Macro that gives a class or struct custom operators new and delete
     39                for allocation out of BumpArena. Just like WTF_MAKE_FAST_ALLOCATED;
     40
     41        Note that while the name of this patch says "fragmentation-free allocator"
     42        it will only be fragmentation-free when used for appropriate things.
     43        This is not meant to be a general-purpose allocator. Only use it for sets of
     44        allocations that are known to die roughly at the same time.
     45
     46        BumpArena will never resume allocating from a block that has been filled,
     47        so it's even more important than usual that everything gets deallocated.
     48
     49        BumpArena redirects allocations to FastMalloc in three cases:
     50
     51            - When invoked with a null BumpArena*
     52            - When allocation request is larger than BumpArena's block size (4kB)
     53            - When BumpArena has exhausted all of its pre-reserved VM. (128MB)
     54
     55        The VM allocator will eagerly return blocks of VM to the kernel by calling
     56        madvise(). Average time spent in madvise is around 0.007ms on my box.
     57
     58        * WTF.vcxproj/WTF.vcxproj:
     59        * WTF.vcxproj/WTF.vcxproj.filters:
     60        * WTF.xcodeproj/project.pbxproj:
     61        * wtf/BumpArena.cpp: Added.
     62        (WTF::BumpArena::Block::capacity):
     63        (WTF::BumpArena::Block::arena):
     64        (WTF::BumpArena::Block::payloadStart):
     65        (WTF::arenas):
     66        (WTF::BumpArena::Block::Block):
     67        (WTF::BumpArena::Block::~Block):
     68        (WTF::BumpArena::Block::ref):
     69        (WTF::BlockAllocator::BlockAllocator):
     70        (WTF::BlockAllocator::isAllocation):
     71        (WTF::blockAllocator):
     72        (WTF::BlockAllocator::allocateBlock):
     73        (WTF::BlockAllocator::deallocateBlock):
     74        (WTF::BumpArena::Block::deref):
     75        (WTF::BumpArena::Block::create):
     76        (WTF::BumpArena::Block::dump):
     77        (WTF::BumpArena::dump):
     78        (WTF::BumpArena::create):
     79        (WTF::BumpArena::BumpArena):
     80        (WTF::BumpArena::~BumpArena):
     81        (WTF::BumpArena::allocateSlow):
     82        (WTF::BumpArena::allocate):
     83        (WTF::BumpArena::deallocate):
     84        (WTF::BumpArena::Block::blockFor):
     85        (WTF::BumpArena::arenaFor):
     86        * wtf/BumpArena.h: Added.
     87        * wtf/CMakeLists.txt:
     88
    1892016-01-15  Konstantin Tokarev  <annulen@yandex.ru>
    290
  • trunk/Source/WTF/WTF.vcxproj/WTF.vcxproj

    r194980 r195141  
    5454    <ClCompile Include="..\wtf\Assertions.cpp" />
    5555    <ClCompile Include="..\wtf\BitVector.cpp" />
     56    <ClCompile Include="..\wtf\BumpArena.cpp" />
    5657    <ClCompile Include="..\wtf\CompilationThread.cpp" />
    5758    <ClCompile Include="..\wtf\CryptographicUtilities.cpp" />
  • trunk/Source/WTF/WTF.vcxproj/WTF.vcxproj.filters

    r194980 r195141  
    119119    </ClCompile>
    120120    <ClCompile Include="..\wtf\BitVector.cpp">
     121      <Filter>wtf</Filter>
     122    </ClCompile>
     123    <ClCompile Include="..\wtf\BumpArena.cpp">
    121124      <Filter>wtf</Filter>
    122125    </ClCompile>
  • trunk/Source/WTF/WTF.xcodeproj/project.pbxproj

    r194980 r195141  
    288288                A8A47487151A825B004123FF /* WTFThreadData.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4737B151A825B004123FF /* WTFThreadData.h */; };
    289289                A8A4748C151A8264004123FF /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4748B151A8264004123FF /* config.h */; };
     290                AD9C50C11C3C1D5D005FBF1E /* BumpArena.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AD9C50BF1C3C1D5D005FBF1E /* BumpArena.cpp */; };
     291                AD9C50C21C3C1D5D005FBF1E /* BumpArena.h in Headers */ = {isa = PBXBuildFile; fileRef = AD9C50C01C3C1D5D005FBF1E /* BumpArena.h */; settings = {ATTRIBUTES = (Private, ); }; };
    290292                B38FD7BD168953E80065C969 /* FeatureDefines.h in Headers */ = {isa = PBXBuildFile; fileRef = B38FD7BC168953E80065C969 /* FeatureDefines.h */; };
    291293                C4F8A93719C65EB400B2B15D /* Stopwatch.h in Headers */ = {isa = PBXBuildFile; fileRef = C4F8A93619C65EB400B2B15D /* Stopwatch.h */; };
     
    601603                A8A4737B151A825B004123FF /* WTFThreadData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WTFThreadData.h; sourceTree = "<group>"; };
    602604                A8A4748B151A8264004123FF /* config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = "<group>"; };
     605                AD9C50BF1C3C1D5D005FBF1E /* BumpArena.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BumpArena.cpp; sourceTree = "<group>"; };
     606                AD9C50C01C3C1D5D005FBF1E /* BumpArena.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BumpArena.h; sourceTree = "<group>"; };
    603607                B38FD7BC168953E80065C969 /* FeatureDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FeatureDefines.h; sourceTree = "<group>"; };
    604608                C4F8A93619C65EB400B2B15D /* Stopwatch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Stopwatch.h; sourceTree = "<group>"; };
     
    758762                                0F93274A1C17F4B700CF6564 /* Box.h */,
    759763                                0F4570441BE834410062A629 /* BubbleSort.h */,
     764                                AD9C50BF1C3C1D5D005FBF1E /* BumpArena.cpp */,
     765                                AD9C50C01C3C1D5D005FBF1E /* BumpArena.h */,
    760766                                A8A47267151A825A004123FF /* BumpPointerAllocator.h */,
    761767                                EB95E1EF161A72410089A2F5 /* ByteOrder.h */,
     
    12621268                                A8A4743F151A825B004123FF /* StringHash.h in Headers */,
    12631269                                A748745417A0BDAE00FA04CB /* StringHashDumpContext.h in Headers */,
     1270                                AD9C50C21C3C1D5D005FBF1E /* BumpArena.h in Headers */,
    12641271                                A8A47441151A825B004123FF /* StringImpl.h in Headers */,
    12651272                                A8A47442151A825B004123FF /* StringOperators.h in Headers */,
     
    14051412                                9BC70F05176C379D00101DEC /* AtomicStringTable.cpp in Sources */,
    14061413                                1469419D16EAB10A0024E146 /* AutodrainedPoolMac.mm in Sources */,
     1414                                AD9C50C11C3C1D5D005FBF1E /* BumpArena.cpp in Sources */,
    14071415                                8134013815B092FD001FF0B8 /* Base64.cpp in Sources */,
    14081416                                A8A473A8151A825B004123FF /* bignum-dtoa.cc in Sources */,
  • trunk/Source/WTF/wtf/CMakeLists.txt

    r194980 r195141  
    88    Bitmap.h
    99    BubbleSort.h
     10    BumpArena.h
    1011    BumpPointerAllocator.h
    1112    ByteOrder.h
     
    154155    Atomics.cpp
    155156    BitVector.cpp
     157    BumpArena.cpp
    156158    CompilationThread.cpp
    157159    CryptographicUtilities.cpp
  • trunk/Source/WebCore/ChangeLog

    r195132 r195141  
     12016-01-15  Andreas Kling  <akling@apple.com>
     2
     3        Use BumpArena for style sheet object tree.
     4        <https://webkit.org/b/152696>
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Give each StyleSheetContents its own BumpArena, and plumb it down through CSSParser
     9        to allocate StyleRule, StyleProperties and CSSSelectorList's selector arrays there.
     10
     11        This basically means that most objects that make up a given style sheet will end up
     12        in one (or a few) contiguous region(s) of memory, instead of being scattered all
     13        over the malloc heap.
     14
     15        In the common case (no CSSOM manipulation), the lifetimes of these objects are very
     16        predictable: everything tends to die when the StyleSheetContents dies.
     17        This dramatically improves space-efficiency in those cases, and allows us to return
     18        contiguous chunks of memory to the system once a style sheet is no longer needed.
     19
     20        One-off CSS parses that don't work within a StyleSheetContents context will have
     21        their StyleRules & co allocated through FastMalloc just like before.
     22
     23        Bonus: give SelectorQueryCache a dedicated BumpArena as well, since it has very
     24        predictable lifetime.
     25
     26        * css/CSSGrammar.y.in:
     27        * css/CSSKeyframesRule.h:
     28        (WebCore::StyleRuleKeyframes::create):
     29        * css/CSSParser.cpp:
     30        (WebCore::CSSParser::createStyleProperties):
     31        (WebCore::CSSParser::createMediaRule):
     32        (WebCore::CSSParser::createSupportsRule):
     33        (WebCore::CSSParser::createKeyframesRule):
     34        (WebCore::CSSParser::setArena):
     35        (WebCore::CSSParser::arena):
     36        (WebCore::CSSParser::createStyleRule):
     37        (WebCore::CSSParser::createFontFaceRule):
     38        (WebCore::CSSParser::createPageRule):
     39        (WebCore::CSSParser::createRegionRule):
     40        (WebCore::CSSParser::createViewportRule):
     41        * css/CSSParser.h:
     42        * css/CSSParserValues.cpp:
     43        (WebCore::CSSParserSelector::parsePseudoElementCueFunctionSelector):
     44        (WebCore::CSSParserSelector::adoptSelectorVector):
     45        * css/CSSParserValues.h:
     46        * css/CSSSelectorList.cpp:
     47        (WebCore::CSSSelectorList::CSSSelectorList):
     48        (WebCore::CSSSelectorList::adoptSelectorVector):
     49        (WebCore::CSSSelectorList::deleteSelectors):
     50        * css/CSSSelectorList.h:
     51        * css/StyleProperties.cpp:
     52        (WebCore::ImmutableStyleProperties::create):
     53        (WebCore::StyleProperties::immutableCopyIfNeeded):
     54        * css/StyleProperties.h:
     55        * css/StyleRule.cpp:
     56        (WebCore::StyleRule::create):
     57        (WebCore::StyleRule::splitIntoMultipleRulesWithMaximumSelectorComponentCount):
     58        (WebCore::StyleRuleRegion::StyleRuleRegion):
     59        * css/StyleRule.h:
     60        (WebCore::StyleRule::create):
     61        (WebCore::StyleRule::parserAdoptSelectorVector):
     62        (WebCore::StyleRuleFontFace::create):
     63        (WebCore::StyleRulePage::create):
     64        (WebCore::StyleRulePage::parserAdoptSelectorVector):
     65        (WebCore::StyleRuleMedia::create):
     66        (WebCore::StyleRuleSupports::create):
     67        (WebCore::StyleRuleRegion::create):
     68        (WebCore::StyleRuleViewport::create):
     69        * css/StyleSheetContents.cpp:
     70        (WebCore::StyleSheetContents::StyleSheetContents):
     71        (WebCore::StyleSheetContents::parseAuthorStyleSheet):
     72        (WebCore::StyleSheetContents::parseStringAtPosition):
     73        * css/StyleSheetContents.h:
     74        * dom/SelectorQuery.cpp:
     75        (WebCore::SelectorQueryCache::SelectorQueryCache):
     76        (WebCore::SelectorQueryCache::add):
     77        * dom/SelectorQuery.h:
     78        * svg/SVGFontFaceElement.cpp:
     79        (WebCore::SVGFontFaceElement::SVGFontFaceElement):
     80
    1812016-01-15  Dave Hyatt  <hyatt@apple.com>
    282
  • trunk/Source/WebCore/css/CSSGrammar.y.in

    r194980 r195141  
    404404        if ($4) {
    405405            if (parser->m_selectorListForParseSelector)
    406                 parser->m_selectorListForParseSelector->adoptSelectorVector(*$4);
     406                parser->m_selectorListForParseSelector->adoptSelectorVector(parser->arena(), *$4);
    407407            parser->recycleSelectorVector(std::unique_ptr<Vector<std::unique_ptr<CSSParserSelector>>>($4));
    408408        }
     
    13541354    // used by ::cue(:past/:future)
    13551355    | ':' ':' CUEFUNCTION maybe_space simple_selector_list maybe_space ')' {
    1356         $$ = CSSParserSelector::parsePseudoElementCueFunctionSelector($3, $5);
     1356        $$ = CSSParserSelector::parsePseudoElementCueFunctionSelector(parser->arena(), $3, $5);
    13571357    }
    13581358#endif
     
    13671367            auto selector = std::make_unique<CSSParserSelector>();
    13681368            selector->setMatch(CSSSelector::PseudoClass);
    1369             selector->adoptSelectorVector(*std::unique_ptr<Vector<std::unique_ptr<CSSParserSelector>>>($4));
     1369            selector->adoptSelectorVector(parser->arena(), *std::unique_ptr<Vector<std::unique_ptr<CSSParserSelector>>>($4));
    13701370            selector->setPseudoClassValue($2);
    13711371            if (selector->pseudoClassType() == CSSSelector::PseudoClassAny)
     
    13781378            auto selector = std::make_unique<CSSParserSelector>();
    13791379            selector->setMatch(CSSSelector::PseudoClass);
    1380             selector->adoptSelectorVector(*std::unique_ptr<Vector<std::unique_ptr<CSSParserSelector>>>($4));
     1380            selector->adoptSelectorVector(parser->arena(), *std::unique_ptr<Vector<std::unique_ptr<CSSParserSelector>>>($4));
    13811381            selector->setPseudoClassValue($2);
    13821382            if (selector->pseudoClassType() == CSSSelector::PseudoClassMatches)
     
    14281428            selector->setPseudoClassValue($2);
    14291429            if (ending)
    1430                 selector->adoptSelectorVector(*ending);
     1430                selector->adoptSelectorVector(parser->arena(), *ending);
    14311431            CSSSelector::PseudoClassType pseudoClassType = selector->pseudoClassType();
    14321432            if (pseudoClassType == CSSSelector::PseudoClassNthChild || pseudoClassType == CSSSelector::PseudoClassNthLastChild)
     
    14431443            selector->setPseudoClassValue($2);
    14441444            if (ending)
    1445                 selector->adoptSelectorVector(*ending);
     1445                selector->adoptSelectorVector(parser->arena(), *ending);
    14461446            CSSSelector::PseudoClassType pseudoClassType = selector->pseudoClassType();
    14471447            if (pseudoClassType == CSSSelector::PseudoClassNthChild || pseudoClassType == CSSSelector::PseudoClassNthLastChild)
     
    14581458            selector->setPseudoClassValue($2);
    14591459            if (ending)
    1460                selector->adoptSelectorVector(*ending);
     1460               selector->adoptSelectorVector(parser->arena(), *ending);
    14611461            CSSSelector::PseudoClassType pseudoClassType = selector->pseudoClassType();
    14621462            if (pseudoClassType == CSSSelector::PseudoClassNthChild || pseudoClassType == CSSSelector::PseudoClassNthLastChild)
     
    15121512                selector->setMatch(CSSSelector::PseudoClass);
    15131513                selector->setPseudoClassValue($2);
    1514                 selector->adoptSelectorVector(*list);
     1514                selector->adoptSelectorVector(parser->arena(), *list);
    15151515                if (selector->pseudoClassType() == CSSSelector::PseudoClassNot)
    15161516                    $$ = selector.release();
  • trunk/Source/WebCore/css/CSSKeyframesRule.h

    r194980 r195141  
    4141class StyleRuleKeyframes : public StyleRuleBase {
    4242public:
    43     static Ref<StyleRuleKeyframes> create() { return adoptRef(*new StyleRuleKeyframes()); }
     43    static Ref<StyleRuleKeyframes> create(BumpArena* arena) { return adoptRef(*new (arena) StyleRuleKeyframes); }
    4444   
    4545    ~StyleRuleKeyframes();
  • trunk/Source/WebCore/css/CSSParser.cpp

    r194980 r195141  
    16451645        results.remove(0, unusedEntries);
    16461646
    1647     return ImmutableStyleProperties::create(results.data(), results.size(), m_context.mode);
     1647    return ImmutableStyleProperties::create(arena(), results.data(), results.size(), m_context.mode);
    16481648}
    16491649
     
    1270212702        // To comply with w3c test suite expectation, create an empty media query
    1270312703        // even when it is syntactically incorrect.
    12704         rule = StyleRuleMedia::create(MediaQuerySet::create(), emptyRules);
     12704        rule = StyleRuleMedia::create(arena(), MediaQuerySet::create(), emptyRules);
    1270512705    } else
    12706         rule = StyleRuleMedia::create(media, rules ? *rules : emptyRules);
     12706        rule = StyleRuleMedia::create(arena(), media, rules ? *rules : emptyRules);
    1270712707    processAndAddNewRuleToSourceTreeIfNeeded();
    1270812708    return rule;
     
    1273012730
    1273112731    if (rules)
    12732         rule = StyleRuleSupports::create(conditionText, conditionIsSupported, *rules);
     12732        rule = StyleRuleSupports::create(arena(), conditionText, conditionIsSupported, *rules);
    1273312733    else {
    1273412734        RuleList emptyRules;
    12735         rule = StyleRuleSupports::create(conditionText, conditionIsSupported, emptyRules);
     12735        rule = StyleRuleSupports::create(arena(), conditionText, conditionIsSupported, emptyRules);
    1273612736    }
    1273712737
     
    1284212842    std::unique_ptr<Vector<RefPtr<StyleKeyframe>>> keyframes = WTFMove(popKeyframes);
    1284312843    m_allowImportRules = m_allowNamespaceDeclarations = false;
    12844     RefPtr<StyleRuleKeyframes> rule = StyleRuleKeyframes::create();
     12844    RefPtr<StyleRuleKeyframes> rule = StyleRuleKeyframes::create(arena());
    1284512845    for (size_t i = 0; i < keyframes->size(); ++i)
    1284612846        rule->parserAppendKeyframe(keyframes->at(i));
     
    1285012850}
    1285112851
     12852void CSSParser::setArena(BumpArena& arena)
     12853{
     12854    m_arena = &arena;
     12855}
     12856
     12857BumpArena* CSSParser::arena()
     12858{
     12859    return m_arena.get();
     12860}
     12861
    1285212862RefPtr<StyleRuleBase> CSSParser::createStyleRule(Vector<std::unique_ptr<CSSParserSelector>>* selectors)
    1285312863{
     
    1285612866        m_allowImportRules = false;
    1285712867        m_allowNamespaceDeclarations = false;
    12858         rule = StyleRule::create(m_lastSelectorLineNumber, createStyleProperties());
    12859         rule->parserAdoptSelectorVector(*selectors);
     12868        rule = StyleRule::create(arena(), m_lastSelectorLineNumber, createStyleProperties());
     12869        rule->parserAdoptSelectorVector(arena(), *selectors);
    1286012870        processAndAddNewRuleToSourceTreeIfNeeded();
    1286112871    } else
     
    1288012890        }
    1288112891    }
    12882     RefPtr<StyleRuleFontFace> rule = StyleRuleFontFace::create(createStyleProperties());
     12892    RefPtr<StyleRuleFontFace> rule = StyleRuleFontFace::create(arena(), createStyleProperties());
    1288312893    clearProperties();
    1288412894    processAndAddNewRuleToSourceTreeIfNeeded();
     
    1296412974    RefPtr<StyleRulePage> rule;
    1296512975    if (pageSelector) {
    12966         rule = StyleRulePage::create(createStyleProperties());
     12976        rule = StyleRulePage::create(arena(), createStyleProperties());
    1296712977        Vector<std::unique_ptr<CSSParserSelector>> selectorVector;
    1296812978        selectorVector.append(WTFMove(pageSelector));
    12969         rule->parserAdoptSelectorVector(selectorVector);
     12979        rule->parserAdoptSelectorVector(arena(), selectorVector);
    1297012980        processAndAddNewRuleToSourceTreeIfNeeded();
    1297112981    } else
     
    1299913009    m_allowImportRules = m_allowNamespaceDeclarations = false;
    1300013010
    13001     RefPtr<StyleRuleRegion> regionRule = StyleRuleRegion::create(regionSelector, *rules);
     13011    RefPtr<StyleRuleRegion> regionRule = StyleRuleRegion::create(arena(), regionSelector, *rules);
    1300213012
    1300313013    if (isExtractingSourceData())
     
    1327313283    m_allowImportRules = m_allowNamespaceDeclarations = false;
    1327413284
    13275     RefPtr<StyleRuleViewport> rule = StyleRuleViewport::create(createStyleProperties());
     13285    RefPtr<StyleRuleViewport> rule = StyleRuleViewport::create(arena(), createStyleProperties());
    1327613286    clearProperties();
    1327713287
  • trunk/Source/WebCore/css/CSSParser.h

    r194980 r195141  
    3737#include "WebKitCSSFilterValue.h"
    3838#include <memory>
     39#include <wtf/BumpArena.h>
    3940#include <wtf/HashMap.h>
    4041#include <wtf/HashSet.h>
     
    115116    WEBCORE_EXPORT ~CSSParser();
    116117
     118    void setArena(BumpArena&);
     119
    117120    void parseSheet(StyleSheetContents*, const String&, const TextPosition&, RuleSourceDataList*, bool logErrors);
    118121    RefPtr<StyleRuleBase> parseRule(StyleSheetContents*, const String&);
     
    398401    CSSParserContext m_context;
    399402
     403    BumpArena* arena();
     404    RefPtr<BumpArena> m_arena;
    400405    bool m_important;
    401406    CSSPropertyID m_id;
  • trunk/Source/WebCore/css/CSSParserValues.cpp

    r194980 r195141  
    215215
    216216#if ENABLE(VIDEO_TRACK)
    217 CSSParserSelector* CSSParserSelector::parsePseudoElementCueFunctionSelector(const CSSParserString& functionIdentifier, Vector<std::unique_ptr<CSSParserSelector>>* parsedSelectorVector)
     217CSSParserSelector* CSSParserSelector::parsePseudoElementCueFunctionSelector(BumpArena* arena, const CSSParserString& functionIdentifier, Vector<std::unique_ptr<CSSParserSelector>>* parsedSelectorVector)
    218218{
    219219    ASSERT_UNUSED(functionIdentifier, String(functionIdentifier) == "cue(");
     
    227227    selector->m_selector->setMatch(CSSSelector::PseudoElement);
    228228    selector->m_selector->setPseudoElementType(CSSSelector::PseudoElementCue);
    229     selector->adoptSelectorVector(*selectorVector);
     229    selector->adoptSelectorVector(arena, *selectorVector);
    230230    return selector.release();
    231231}
     
    280280}
    281281
    282 void CSSParserSelector::adoptSelectorVector(Vector<std::unique_ptr<CSSParserSelector>>& selectorVector)
     282void CSSParserSelector::adoptSelectorVector(BumpArena* arena, Vector<std::unique_ptr<CSSParserSelector>>& selectorVector)
    283283{
    284284    auto selectorList = std::make_unique<CSSSelectorList>();
    285     selectorList->adoptSelectorVector(selectorVector);
     285    selectorList->adoptSelectorVector(arena, selectorVector);
    286286    m_selector->setSelectorList(WTFMove(selectorList));
    287287}
  • trunk/Source/WebCore/css/CSSParserValues.h

    r194980 r195141  
    2525#include "CSSValueKeywords.h"
    2626#include "CSSValueList.h"
     27#include <wtf/BumpArena.h>
    2728#include <wtf/text/AtomicString.h>
    2829#include <wtf/text/AtomicStringHash.h>
     
    212213    static CSSParserSelector* parsePagePseudoSelector(const CSSParserString& pseudoTypeString);
    213214    static CSSParserSelector* parsePseudoElementSelector(CSSParserString& pseudoTypeString);
    214     static CSSParserSelector* parsePseudoElementCueFunctionSelector(const CSSParserString& functionIdentifier, Vector<std::unique_ptr<CSSParserSelector>>* selectorVector);
     215    static CSSParserSelector* parsePseudoElementCueFunctionSelector(BumpArena*, const CSSParserString& functionIdentifier, Vector<std::unique_ptr<CSSParserSelector>>* selectorVector);
    215216    static CSSParserSelector* parsePseudoClassAndCompatibilityElementSelector(CSSParserString& pseudoTypeString);
    216217
     
    229230    void setForPage() { m_selector->setForPage(); }
    230231
    231     void adoptSelectorVector(Vector<std::unique_ptr<CSSParserSelector>>& selectorVector);
     232    void adoptSelectorVector(BumpArena*, Vector<std::unique_ptr<CSSParserSelector>>& selectorVector);
    232233    void setLangArgumentList(const Vector<CSSParserString>& stringVector);
    233234
  • trunk/Source/WebCore/css/CSSSelectorList.cpp

    r194980 r195141  
    3838    ASSERT_WITH_SECURITY_IMPLICATION(otherComponentCount);
    3939
    40     m_selectorArray = reinterpret_cast<CSSSelector*>(fastMalloc(sizeof(CSSSelector) * otherComponentCount));
     40    m_selectorArray = reinterpret_cast<CSSSelector*>(BumpArena::allocate(BumpArena::arenaFor(other.m_selectorArray), sizeof(CSSSelector) * otherComponentCount));
    4141    for (unsigned i = 0; i < otherComponentCount; ++i)
    4242        new (NotNull, &m_selectorArray[i]) CSSSelector(other.m_selectorArray[i]);
     
    5050}
    5151
    52 void CSSSelectorList::adoptSelectorVector(Vector<std::unique_ptr<CSSParserSelector>>& selectorVector)
     52void CSSSelectorList::adoptSelectorVector(BumpArena* arena, Vector<std::unique_ptr<CSSParserSelector>>& selectorVector)
    5353{
    5454    ASSERT_WITH_SECURITY_IMPLICATION(!selectorVector.isEmpty());
     
    6161    }
    6262    ASSERT(flattenedSize);
    63     m_selectorArray = reinterpret_cast<CSSSelector*>(fastMalloc(sizeof(CSSSelector) * flattenedSize));
     63    m_selectorArray = reinterpret_cast<CSSSelector*>(BumpArena::allocate(arena, sizeof(CSSSelector) * flattenedSize));
    6464    size_t arrayIndex = 0;
    6565    for (size_t i = 0; i < selectorVector.size(); ++i) {
     
    120120        s->~CSSSelector();
    121121    }
    122     fastFree(selectorArray);
     122    BumpArena::deallocate(selectorArray);
    123123}
    124124
  • trunk/Source/WebCore/css/CSSSelectorList.h

    r194980 r195141  
    2929#include "CSSSelector.h"
    3030#include <memory>
     31#include <wtf/BumpArena.h>
    3132
    3233namespace WebCore {
     
    4344    ~CSSSelectorList() { deleteSelectors(); }
    4445
    45     void adoptSelectorVector(Vector<std::unique_ptr<CSSParserSelector>>& selectorVector);
     46    void adoptSelectorVector(BumpArena*, Vector<std::unique_ptr<CSSParserSelector>>&);
    4647    void adoptSelectorArray(CSSSelector* selectors) { ASSERT(!m_selectorArray); m_selectorArray = selectors; }
    4748
  • trunk/Source/WebCore/css/StyleProperties.cpp

    r194980 r195141  
    5656}
    5757
    58 Ref<ImmutableStyleProperties> ImmutableStyleProperties::create(const CSSProperty* properties, unsigned count, CSSParserMode cssParserMode)
    59 {
    60     void* slot = WTF::fastMalloc(sizeForImmutableStylePropertiesWithPropertyCount(count));
     58Ref<ImmutableStyleProperties> ImmutableStyleProperties::create(BumpArena* arena, const CSSProperty* properties, unsigned count, CSSParserMode cssParserMode)
     59{
     60    void* slot = BumpArena::allocate(arena, sizeForImmutableStylePropertiesWithPropertyCount(count));
    6161    return adoptRef(*new (NotNull, slot) ImmutableStyleProperties(properties, count, cssParserMode));
    6262}
     
    6767        return downcast<ImmutableStyleProperties>(const_cast<StyleProperties&>(*this));
    6868    const MutableStyleProperties& mutableThis = downcast<MutableStyleProperties>(*this);
    69     return ImmutableStyleProperties::create(mutableThis.m_propertyVector.data(), mutableThis.m_propertyVector.size(), cssParserMode());
     69    return ImmutableStyleProperties::create(BumpArena::arenaFor(this), mutableThis.m_propertyVector.data(), mutableThis.m_propertyVector.size(), cssParserMode());
    7070}
    7171
  • trunk/Source/WebCore/css/StyleProperties.h

    r194980 r195141  
    3030#include "CSSValueKeywords.h"
    3131#include <memory>
     32#include <wtf/BumpArena.h>
    3233#include <wtf/ListHashSet.h>
    3334#include <wtf/TypeCasts.h>
     
    4748class StyleSheetContents;
    4849
    49 class StyleProperties : public RefCounted<StyleProperties> {
     50class StyleProperties : public WTF::RefCountedBase {
     51    WTF_MAKE_BUMPARENA_ALLOCATED;
    5052    friend class PropertyReference;
    5153public:
     
    162164public:
    163165    WEBCORE_EXPORT ~ImmutableStyleProperties();
    164     static Ref<ImmutableStyleProperties> create(const CSSProperty* properties, unsigned count, CSSParserMode);
     166    static Ref<ImmutableStyleProperties> create(BumpArena*, const CSSProperty* properties, unsigned count, CSSParserMode);
    165167
    166168    unsigned propertyCount() const { return m_arraySize; }
  • trunk/Source/WebCore/css/StyleRule.cpp

    r194980 r195141  
    220220}
    221221
    222 Ref<StyleRule> StyleRule::create(int sourceLine, const Vector<const CSSSelector*>& selectors, Ref<StyleProperties>&& properties)
     222Ref<StyleRule> StyleRule::create(BumpArena* arena, int sourceLine, const Vector<const CSSSelector*>& selectors, Ref<StyleProperties>&& properties)
    223223{
    224224    ASSERT_WITH_SECURITY_IMPLICATION(!selectors.isEmpty());
    225     CSSSelector* selectorListArray = reinterpret_cast<CSSSelector*>(fastMalloc(sizeof(CSSSelector) * selectors.size()));
     225    CSSSelector* selectorListArray = reinterpret_cast<CSSSelector*>(BumpArena::allocate(arena, sizeof(CSSSelector) * selectors.size()));
    226226    for (unsigned i = 0; i < selectors.size(); ++i)
    227227        new (NotNull, &selectorListArray[i]) CSSSelector(*selectors.at(i));
    228228    selectorListArray[selectors.size() - 1].setLastInSelectorList();
    229     auto rule = StyleRule::create(sourceLine, WTFMove(properties));
     229    auto rule = StyleRule::create(arena, sourceLine, WTFMove(properties));
    230230    rule.get().parserAdoptSelectorArray(selectorListArray);
    231231    return rule;
     
    245245
    246246        if (componentsInThisSelector.size() + componentsSinceLastSplit.size() > maxCount && !componentsSinceLastSplit.isEmpty()) {
    247             rules.append(create(sourceLine(), componentsSinceLastSplit, const_cast<StyleProperties&>(m_properties.get())));
     247            rules.append(create(BumpArena::arenaFor(this), sourceLine(), componentsSinceLastSplit, const_cast<StyleProperties&>(m_properties.get())));
    248248            componentsSinceLastSplit.clear();
    249249        }
     
    253253
    254254    if (!componentsSinceLastSplit.isEmpty())
    255         rules.append(create(sourceLine(), componentsSinceLastSplit, const_cast<StyleProperties&>(m_properties.get())));
     255        rules.append(create(BumpArena::arenaFor(this), sourceLine(), componentsSinceLastSplit, const_cast<StyleProperties&>(m_properties.get())));
    256256
    257257    return rules;
     
    361361    : StyleRuleGroup(Region, adoptRules)
    362362{
    363     m_selectorList.adoptSelectorVector(*selectors);
     363    m_selectorList.adoptSelectorVector(BumpArena::arenaFor(this), *selectors);
    364364}
    365365
  • trunk/Source/WebCore/css/StyleRule.h

    r194980 r195141  
    2626#include "MediaList.h"
    2727#include "StyleProperties.h"
     28#include <wtf/BumpArena.h>
    2829#include <wtf/RefPtr.h>
    2930#include <wtf/TypeCasts.h>
     
    3839
    3940class StyleRuleBase : public WTF::RefCountedBase {
    40     WTF_MAKE_FAST_ALLOCATED;
     41    WTF_MAKE_BUMPARENA_ALLOCATED;
    4142public:
    4243    enum Type {
     
    102103
    103104class StyleRule : public StyleRuleBase {
    104     WTF_MAKE_FAST_ALLOCATED;
    105 public:
    106     static Ref<StyleRule> create(int sourceLine, Ref<StyleProperties>&& properties)
    107     {
    108         return adoptRef(*new StyleRule(sourceLine, WTFMove(properties)));
     105public:
     106    static Ref<StyleRule> create(BumpArena* arena, int sourceLine, Ref<StyleProperties>&& properties)
     107    {
     108        return adoptRef(*new (arena) StyleRule(sourceLine, WTFMove(properties)));
    109109    }
    110110   
     
    115115    MutableStyleProperties& mutableProperties();
    116116   
    117     void parserAdoptSelectorVector(Vector<std::unique_ptr<CSSParserSelector>>& selectors) { m_selectorList.adoptSelectorVector(selectors); }
     117    void parserAdoptSelectorVector(BumpArena* arena, Vector<std::unique_ptr<CSSParserSelector>>& selectors) { m_selectorList.adoptSelectorVector(arena, selectors); }
    118118    void wrapperAdoptSelectorList(CSSSelectorList& selectors) { m_selectorList = WTFMove(selectors); }
    119119    void parserAdoptSelectorArray(CSSSelector* selectors) { m_selectorList.adoptSelectorArray(selectors); }
     
    129129    StyleRule(const StyleRule&);
    130130
    131     static Ref<StyleRule> create(int sourceLine, const Vector<const CSSSelector*>&, Ref<StyleProperties>&&);
     131    static Ref<StyleRule> create(BumpArena*, int sourceLine, const Vector<const CSSSelector*>&, Ref<StyleProperties>&&);
    132132
    133133    Ref<StyleProperties> m_properties;
     
    137137class StyleRuleFontFace : public StyleRuleBase {
    138138public:
    139     static Ref<StyleRuleFontFace> create(Ref<StyleProperties>&& properties) { return adoptRef(*new StyleRuleFontFace(WTFMove(properties))); }
     139    static Ref<StyleRuleFontFace> create(BumpArena* arena, Ref<StyleProperties>&& properties) { return adoptRef(*new (arena) StyleRuleFontFace(WTFMove(properties))); }
    140140   
    141141    ~StyleRuleFontFace();
     
    156156class StyleRulePage : public StyleRuleBase {
    157157public:
    158     static Ref<StyleRulePage> create(Ref<StyleProperties>&& properties) { return adoptRef(*new StyleRulePage(WTFMove(properties))); }
     158    static Ref<StyleRulePage> create(BumpArena* arena, Ref<StyleProperties>&& properties) { return adoptRef(*new (arena) StyleRulePage(WTFMove(properties))); }
    159159
    160160    ~StyleRulePage();
     
    164164    MutableStyleProperties& mutableProperties();
    165165
    166     void parserAdoptSelectorVector(Vector<std::unique_ptr<CSSParserSelector>>& selectors) { m_selectorList.adoptSelectorVector(selectors); }
     166    void parserAdoptSelectorVector(BumpArena* arena, Vector<std::unique_ptr<CSSParserSelector>>& selectors) { m_selectorList.adoptSelectorVector(arena, selectors); }
    167167    void wrapperAdoptSelectorList(CSSSelectorList& selectors) { m_selectorList = WTFMove(selectors); }
    168168
     
    194194class StyleRuleMedia : public StyleRuleGroup {
    195195public:
    196     static Ref<StyleRuleMedia> create(PassRefPtr<MediaQuerySet> media, Vector<RefPtr<StyleRuleBase>>& adoptRules)
    197     {
    198         return adoptRef(*new StyleRuleMedia(media, adoptRules));
     196    static Ref<StyleRuleMedia> create(BumpArena* arena, PassRefPtr<MediaQuerySet> media, Vector<RefPtr<StyleRuleBase>>& adoptRules)
     197    {
     198        return adoptRef(*new (arena) StyleRuleMedia(media, adoptRules));
    199199    }
    200200
     
    212212class StyleRuleSupports : public StyleRuleGroup {
    213213public:
    214     static Ref<StyleRuleSupports> create(const String& conditionText, bool conditionIsSupported, Vector<RefPtr<StyleRuleBase>>& adoptRules)
    215     {
    216         return adoptRef(*new StyleRuleSupports(conditionText, conditionIsSupported, adoptRules));
     214    static Ref<StyleRuleSupports> create(BumpArena* arena, const String& conditionText, bool conditionIsSupported, Vector<RefPtr<StyleRuleBase>>& adoptRules)
     215    {
     216        return adoptRef(*new (arena) StyleRuleSupports(conditionText, conditionIsSupported, adoptRules));
    217217    }
    218218
     
    231231class StyleRuleRegion : public StyleRuleGroup {
    232232public:
    233     static Ref<StyleRuleRegion> create(Vector<std::unique_ptr<CSSParserSelector>>* selectors, Vector<RefPtr<StyleRuleBase>>& adoptRules)
    234     {
    235         return adoptRef(*new StyleRuleRegion(selectors, adoptRules));
     233    static Ref<StyleRuleRegion> create(BumpArena* arena, Vector<std::unique_ptr<CSSParserSelector>>* selectors, Vector<RefPtr<StyleRuleBase>>& adoptRules)
     234    {
     235        return adoptRef(*new (arena) StyleRuleRegion(selectors, adoptRules));
    236236    }
    237237
     
    250250class StyleRuleViewport : public StyleRuleBase {
    251251public:
    252     static Ref<StyleRuleViewport> create(Ref<StyleProperties>&& properties) { return adoptRef(*new StyleRuleViewport(WTFMove(properties))); }
     252    static Ref<StyleRuleViewport> create(BumpArena* arena, Ref<StyleProperties>&& properties) { return adoptRef(*new (arena) StyleRuleViewport(WTFMove(properties))); }
    253253
    254254    ~StyleRuleViewport();
  • trunk/Source/WebCore/css/StyleSheetContents.cpp

    r194980 r195141  
    7272    , m_isInMemoryCache(false)
    7373    , m_parserContext(context)
     74    , m_arena(BumpArena::create())
    7475{
    7576}
     
    9293    , m_isInMemoryCache(false)
    9394    , m_parserContext(o.m_parserContext)
     95    , m_arena(BumpArena::create())
    9496{
    9597    ASSERT(o.isCacheable());
     
    314316
    315317    CSSParser p(parserContext());
     318    p.setArena(m_arena.get());
    316319    p.parseSheet(this, sheetText, TextPosition(), nullptr, true);
    317320
     
    335338{
    336339    CSSParser p(parserContext());
     340    p.setArena(m_arena.get());
    337341    p.parseSheet(this, sheetText, textPosition, nullptr, createdByParser);
    338342    return true;
  • trunk/Source/WebCore/css/StyleSheetContents.h

    r194980 r195141  
    2525#include "CachePolicy.h"
    2626#include "URL.h"
     27#include <wtf/BumpArena.h>
    2728#include <wtf/HashMap.h>
    2829#include <wtf/ListHashSet.h>
     
    174175
    175176    Vector<CSSStyleSheet*> m_clients;
     177
     178    Ref<BumpArena> m_arena;
    176179};
    177180
  • trunk/Source/WebCore/dom/SelectorQuery.cpp

    r194980 r195141  
    610610}
    611611
     612SelectorQueryCache::SelectorQueryCache()
     613    : m_arena(BumpArena::create())
     614{
     615}
     616
    612617SelectorQuery* SelectorQueryCache::add(const String& selectors, Document& document, ExceptionCode& ec)
    613618{
     
    617622
    618623    CSSParser parser(document);
     624    parser.setArena(m_arena.get());
    619625    CSSSelectorList selectorList;
    620626    parser.parseSelector(selectors, selectorList);
  • trunk/Source/WebCore/dom/SelectorQuery.h

    r194980 r195141  
    3030#include "NodeList.h"
    3131#include "SelectorCompiler.h"
     32#include <wtf/BumpArena.h>
    3233#include <wtf/HashMap.h>
    3334#include <wtf/Vector.h>
     
    133134
    134135public:
     136    SelectorQueryCache();
    135137    SelectorQuery* add(const String&, Document&, ExceptionCode&);
    136138
    137139private:
    138140    HashMap<String, std::unique_ptr<SelectorQuery>> m_entries;
     141    Ref<BumpArena> m_arena;
    139142};
    140143
  • trunk/Source/WebCore/svg/SVGFontFaceElement.cpp

    r194980 r195141  
    5050inline SVGFontFaceElement::SVGFontFaceElement(const QualifiedName& tagName, Document& document)
    5151    : SVGElement(tagName, document)
    52     , m_fontFaceRule(StyleRuleFontFace::create(MutableStyleProperties::create(CSSStrictMode)))
     52    , m_fontFaceRule(StyleRuleFontFace::create(nullptr, MutableStyleProperties::create(CSSStrictMode)))
    5353    , m_fontElement(nullptr)
    5454{
Note: See TracChangeset for help on using the changeset viewer.