Title: [195179] trunk/Source/WebCore
- Revision
- 195179
- Author
- [email protected]
- Date
- 2016-01-16 16:21:44 -0800 (Sat, 16 Jan 2016)
Log 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:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (195178 => 195179)
--- trunk/Source/WebCore/ChangeLog 2016-01-17 00:04:37 UTC (rev 195178)
+++ trunk/Source/WebCore/ChangeLog 2016-01-17 00:21:44 UTC (rev 195179)
@@ -1,3 +1,16 @@
+2016-01-16 Andreas Kling <[email protected]>
+
+ 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:
+
2016-01-16 Michael Catanzaro <[email protected]>
[GTK] Add a couple comments to ScrollbarThemeGtk
Modified: trunk/Source/WebCore/css/CSSGrammar.y.in (195178 => 195179)
--- trunk/Source/WebCore/css/CSSGrammar.y.in 2016-01-17 00:04:37 UTC (rev 195178)
+++ trunk/Source/WebCore/css/CSSGrammar.y.in 2016-01-17 00:21:44 UTC (rev 195179)
@@ -581,7 +581,7 @@
maybe_source_media_query_exp:
/* empty */ {
- $$ = new MediaQueryExp;
+ $$ = new (parser->arena()) MediaQueryExp;
}
| base_media_query_exp maybe_space;
@@ -590,7 +590,7 @@
base_media_query_exp: '(' maybe_space IDENT maybe_space maybe_media_value ')' {
std::unique_ptr<CSSParserValueList> mediaValue($5);
$3.lower();
- $$ = new MediaQueryExp($3, mediaValue.get());
+ $$ = new (parser->arena()) MediaQueryExp($3, mediaValue.get());
}
;
@@ -600,7 +600,7 @@
// If restrictor is specified, media query _expression_ is invalid.
// Create empty media query _expression_ and continue parsing media query.
delete $3;
- $$ = new MediaQueryExp;
+ $$ = new (parser->arena()) MediaQueryExp;
} else
$$ = $3;
}
@@ -640,12 +640,12 @@
media_query:
media_query_exp_list {
- $$ = new MediaQuery(MediaQuery::None, "all", std::unique_ptr<Vector<std::unique_ptr<MediaQueryExp>>>($1));
+ $$ = new (parser->arena()) MediaQuery(MediaQuery::None, "all", std::unique_ptr<Vector<std::unique_ptr<MediaQueryExp>>>($1));
}
|
maybe_media_restrictor maybe_space IDENT maybe_space maybe_and_media_query_exp_list {
$3.lower();
- $$ = new MediaQuery($1, $3, std::unique_ptr<Vector<std::unique_ptr<MediaQueryExp>>>($5));
+ $$ = new (parser->arena()) MediaQuery($1, $3, std::unique_ptr<Vector<std::unique_ptr<MediaQueryExp>>>($5));
}
;
Modified: trunk/Source/WebCore/css/MediaQuery.h (195178 => 195179)
--- trunk/Source/WebCore/css/MediaQuery.h 2016-01-17 00:04:37 UTC (rev 195178)
+++ trunk/Source/WebCore/css/MediaQuery.h 2016-01-17 00:21:44 UTC (rev 195179)
@@ -30,6 +30,7 @@
#define MediaQuery_h
#include <memory>
+#include <wtf/BumpArena.h>
#include <wtf/Vector.h>
#include <wtf/text/StringHash.h>
#include <wtf/text/WTFString.h>
@@ -38,7 +39,7 @@
class MediaQueryExp;
class MediaQuery {
- WTF_MAKE_FAST_ALLOCATED;
+ WTF_MAKE_BUMPARENA_ALLOCATED;
public:
enum Restrictor {
Only, Not, None
Modified: trunk/Source/WebCore/css/MediaQueryExp.h (195178 => 195179)
--- trunk/Source/WebCore/css/MediaQueryExp.h 2016-01-17 00:04:37 UTC (rev 195178)
+++ trunk/Source/WebCore/css/MediaQueryExp.h 2016-01-17 00:21:44 UTC (rev 195179)
@@ -31,6 +31,7 @@
#include "CSSValue.h"
#include "MediaFeatureNames.h"
#include <memory>
+#include <wtf/BumpArena.h>
#include <wtf/text/AtomicString.h>
namespace WebCore {
@@ -38,7 +39,7 @@
class CSSParserValueList;
class MediaQueryExp {
- WTF_MAKE_FAST_ALLOCATED;
+ WTF_MAKE_BUMPARENA_ALLOCATED;
public:
explicit MediaQueryExp(const AtomicString& mediaFeature = emptyAtom, CSSParserValueList* values = nullptr);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes