Changeset 195179 in webkit


Ignore:
Timestamp:
Jan 16, 2016 4:21:44 PM (8 years ago)
Author:
akling@apple.com
Message:

Allocate style sheet media queries in BumpArena.
<https://webkit.org/b/153188>

Reviewed by Antti Koivisto.

Teach the CSS parser to allocate MediaQuery and MediaQueryExp from BumpArena as well.

  • css/CSSGrammar.y.in:
  • css/MediaQuery.h:
  • css/MediaQueryExp.h:
Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r195177 r195179  
     12016-01-16  Andreas Kling  <akling@apple.com>
     2
     3        Allocate style sheet media queries in BumpArena.
     4        <https://webkit.org/b/153188>
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Teach the CSS parser to allocate MediaQuery and MediaQueryExp from BumpArena as well.
     9
     10        * css/CSSGrammar.y.in:
     11        * css/MediaQuery.h:
     12        * css/MediaQueryExp.h:
     13
    1142016-01-16  Michael Catanzaro  <mcatanzaro@igalia.com>
    215
  • trunk/Source/WebCore/css/CSSGrammar.y.in

    r195141 r195179  
    582582maybe_source_media_query_exp:
    583583    /* empty */ {
    584         $$ = new MediaQueryExp;
     584        $$ = new (parser->arena()) MediaQueryExp;
    585585    }
    586586    | base_media_query_exp maybe_space;
     
    591591        std::unique_ptr<CSSParserValueList> mediaValue($5);
    592592        $3.lower();
    593         $$ = new MediaQueryExp($3, mediaValue.get());
     593        $$ = new (parser->arena()) MediaQueryExp($3, mediaValue.get());
    594594    }
    595595    ;
     
    601601            // Create empty media query expression and continue parsing media query.
    602602            delete $3;
    603             $$ = new MediaQueryExp;
     603            $$ = new (parser->arena()) MediaQueryExp;
    604604        } else
    605605            $$ = $3;
     
    641641media_query:
    642642    media_query_exp_list {
    643         $$ = new MediaQuery(MediaQuery::None, "all", std::unique_ptr<Vector<std::unique_ptr<MediaQueryExp>>>($1));
     643        $$ = new (parser->arena()) MediaQuery(MediaQuery::None, "all", std::unique_ptr<Vector<std::unique_ptr<MediaQueryExp>>>($1));
    644644    }
    645645    |
    646646    maybe_media_restrictor maybe_space IDENT maybe_space maybe_and_media_query_exp_list {
    647647        $3.lower();
    648         $$ = new MediaQuery($1, $3, std::unique_ptr<Vector<std::unique_ptr<MediaQueryExp>>>($5));
     648        $$ = new (parser->arena()) MediaQuery($1, $3, std::unique_ptr<Vector<std::unique_ptr<MediaQueryExp>>>($5));
    649649    }
    650650    ;
  • trunk/Source/WebCore/css/MediaQuery.h

    r165676 r195179  
    3131
    3232#include <memory>
     33#include <wtf/BumpArena.h>
    3334#include <wtf/Vector.h>
    3435#include <wtf/text/StringHash.h>
     
    3940
    4041class MediaQuery {
    41     WTF_MAKE_FAST_ALLOCATED;
     42    WTF_MAKE_BUMPARENA_ALLOCATED;
    4243public:
    4344    enum Restrictor {
  • trunk/Source/WebCore/css/MediaQueryExp.h

    r179476 r195179  
    3232#include "MediaFeatureNames.h"
    3333#include <memory>
     34#include <wtf/BumpArena.h>
    3435#include <wtf/text/AtomicString.h>
    3536
     
    3940
    4041class MediaQueryExp {
    41     WTF_MAKE_FAST_ALLOCATED;
     42    WTF_MAKE_BUMPARENA_ALLOCATED;
    4243public:
    4344    explicit MediaQueryExp(const AtomicString& mediaFeature = emptyAtom, CSSParserValueList* values = nullptr);
Note: See TracChangeset for help on using the changeset viewer.