Title: [101924] trunk/Source/WebCore
Revision
101924
Author
kl...@webkit.org
Date
2011-12-03 04:20:26 -0800 (Sat, 03 Dec 2011)

Log Message

Shrink CSSValueList.
<http://webkit.org/b/73732>

Reviewed by Antti Koivisto.

Packed CSSValueList::m_isSpaceSeparated into the CSSValue bit field
and renamed it to m_isSpaceSeparatedValue, shrinking CSSValueList
by one CPU word.

Also renamed CSSValue::m_isImplicit to m_isImplicitInitialValue
for good measure.

* css/CSSInitialValue.h:
(WebCore::CSSInitialValue::CSSInitialValue):
* css/CSSValue.h:
(WebCore::CSSValue::isImplicitInitialValue):
(WebCore::CSSValue::CSSValue):
* css/CSSValueList.cpp:
(WebCore::CSSValueList::CSSValueList):
(WebCore::CSSValueList::copy):
(WebCore::CSSValueList::customCssText):
* css/CSSValueList.h:
(WebCore::CSSValueList::isSpaceSeparated):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (101923 => 101924)


--- trunk/Source/WebCore/ChangeLog	2011-12-03 12:12:07 UTC (rev 101923)
+++ trunk/Source/WebCore/ChangeLog	2011-12-03 12:20:26 UTC (rev 101924)
@@ -1,3 +1,29 @@
+2011-12-03  Andreas Kling  <kl...@webkit.org>
+
+        Shrink CSSValueList.
+        <http://webkit.org/b/73732>
+
+        Reviewed by Antti Koivisto.
+
+        Packed CSSValueList::m_isSpaceSeparated into the CSSValue bit field
+        and renamed it to m_isSpaceSeparatedValue, shrinking CSSValueList
+        by one CPU word.
+
+        Also renamed CSSValue::m_isImplicit to m_isImplicitInitialValue
+        for good measure.
+
+        * css/CSSInitialValue.h:
+        (WebCore::CSSInitialValue::CSSInitialValue):
+        * css/CSSValue.h:
+        (WebCore::CSSValue::isImplicitInitialValue):
+        (WebCore::CSSValue::CSSValue):
+        * css/CSSValueList.cpp:
+        (WebCore::CSSValueList::CSSValueList):
+        (WebCore::CSSValueList::copy):
+        (WebCore::CSSValueList::customCssText):
+        * css/CSSValueList.h:
+        (WebCore::CSSValueList::isSpaceSeparated):
+
 2011-12-02  Philippe Normand  <pnorm...@igalia.com>
 
         [GStreamer] Fullscreen controller support for the new WebKit Fullscreen API

Modified: trunk/Source/WebCore/css/CSSInitialValue.h (101923 => 101924)


--- trunk/Source/WebCore/css/CSSInitialValue.h	2011-12-03 12:12:07 UTC (rev 101923)
+++ trunk/Source/WebCore/css/CSSInitialValue.h	2011-12-03 12:20:26 UTC (rev 101924)
@@ -45,7 +45,7 @@
     CSSInitialValue(bool implicit)
         : CSSValue(InitialClass)
     {
-        m_isImplicit = implicit;
+        m_isImplicitInitialValue = implicit;
     }
 
     static PassRefPtr<CSSInitialValue> create(bool implicit)

Modified: trunk/Source/WebCore/css/CSSValue.h (101923 => 101924)


--- trunk/Source/WebCore/css/CSSValue.h	2011-12-03 12:12:07 UTC (rev 101923)
+++ trunk/Source/WebCore/css/CSSValue.h	2011-12-03 12:20:26 UTC (rev 101924)
@@ -68,7 +68,7 @@
     bool isFontValue() const { return m_classType == FontClass; }
     bool isImageGeneratorValue() const { return m_classType >= CanvasClass && m_classType <= RadialGradientClass; }
     bool isImageValue() const { return m_classType == ImageClass || m_classType == CursorImageClass; }
-    bool isImplicitInitialValue() const { return m_classType == InitialClass && m_isImplicit; }
+    bool isImplicitInitialValue() const { return m_classType == InitialClass && m_isImplicitInitialValue; }
     bool isInheritedValue() const { return m_classType == InheritedClass; }
     bool isInitialValue() const { return m_classType == InitialClass; }
     bool isReflectValue() const { return m_classType == ReflectClass; }
@@ -151,7 +151,8 @@
         : m_primitiveUnitType(0)
         , m_hasCachedCSSText(false)
         , m_isQuirkValue(false)
-        , m_isImplicit(false)
+        , m_isImplicitInitialValue(false)
+        , m_isSpaceSeparatedValueList(false)
         , m_classType(classType)
     {
     }
@@ -174,8 +175,11 @@
     bool m_isQuirkValue : 1;
 
     // CSSInitialValue bits:
-    bool m_isImplicit : 1;
+    bool m_isImplicitInitialValue : 1;
 
+    // CSSValueList bits:
+    bool m_isSpaceSeparatedValueList : 1;
+
 private:
     unsigned char m_classType : ClassTypeBits; // ClassType
 };

Modified: trunk/Source/WebCore/css/CSSValueList.cpp (101923 => 101924)


--- trunk/Source/WebCore/css/CSSValueList.cpp	2011-12-03 12:12:07 UTC (rev 101923)
+++ trunk/Source/WebCore/css/CSSValueList.cpp	2011-12-03 12:20:26 UTC (rev 101924)
@@ -29,20 +29,20 @@
 
 CSSValueList::CSSValueList(ClassType classType, bool isSpaceSeparated)
     : CSSValue(classType)
-    , m_isSpaceSeparated(isSpaceSeparated)
 {
+    m_isSpaceSeparatedValueList = isSpaceSeparated;
 }
 
 CSSValueList::CSSValueList(bool isSpaceSeparated)
     : CSSValue(ValueListClass)
-    , m_isSpaceSeparated(isSpaceSeparated)
 {
+    m_isSpaceSeparatedValueList = isSpaceSeparated;
 }
 
 CSSValueList::CSSValueList(CSSParserValueList* list)
     : CSSValue(ValueListClass)
-    , m_isSpaceSeparated(true)
 {
+    m_isSpaceSeparatedValueList = true;
     if (list) {
         size_t size = list->size();
         for (unsigned i = 0; i < size; ++i)
@@ -88,7 +88,7 @@
 
 PassRefPtr<CSSValueList> CSSValueList::copy()
 {
-    PassRefPtr<CSSValueList> newList = m_isSpaceSeparated ? createSpaceSeparated() : createCommaSeparated();
+    PassRefPtr<CSSValueList> newList = isSpaceSeparated() ? createSpaceSeparated() : createCommaSeparated();
     for (size_t index = 0; index < m_values.size(); index++)
         newList->append(m_values[index]);
     return newList;
@@ -101,7 +101,7 @@
     unsigned size = m_values.size();
     for (unsigned i = 0; i < size; i++) {
         if (!result.isEmpty()) {
-            if (m_isSpaceSeparated)
+            if (isSpaceSeparated())
                 result += " ";
             else
                 result += ", ";

Modified: trunk/Source/WebCore/css/CSSValueList.h (101923 => 101924)


--- trunk/Source/WebCore/css/CSSValueList.h	2011-12-03 12:12:07 UTC (rev 101923)
+++ trunk/Source/WebCore/css/CSSValueList.h	2011-12-03 12:20:26 UTC (rev 101924)
@@ -65,8 +65,9 @@
     explicit CSSValueList(bool isSpaceSeparated);
     explicit CSSValueList(CSSParserValueList*);
 
+    bool isSpaceSeparated() const { return m_isSpaceSeparatedValueList; }
+
     Vector<RefPtr<CSSValue> > m_values;
-    bool m_isSpaceSeparated;
 };
 
 // Objects of this class are intended to be stack-allocated and scoped to a single function.
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to