Title: [220378] trunk/Source/WebCore
Revision
220378
Author
simon.fra...@apple.com
Date
2017-08-07 19:46:06 -0700 (Mon, 07 Aug 2017)

Log Message

Inline ~Color and Color::isExtended()
https://bugs.webkit.org/show_bug.cgi?id=175293

Reviewed by Zalan Bujtas.

The Color destructor and Color::isExtended() show up on profiles, so inline them.
Before r207265 the destructor was inlined.

Also make sure that LengthSize::operator== is inlined, which it was not (according
to profiles).

* platform/LengthSize.h:
(WebCore::operator==):
* platform/graphics/Color.cpp:
(WebCore::Color::~Color): Deleted.
(WebCore::Color::isExtended const): Deleted.
* platform/graphics/Color.h:
(WebCore::Color::~Color):
(WebCore::Color::isExtended const):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (220377 => 220378)


--- trunk/Source/WebCore/ChangeLog	2017-08-08 02:29:42 UTC (rev 220377)
+++ trunk/Source/WebCore/ChangeLog	2017-08-08 02:46:06 UTC (rev 220378)
@@ -1,3 +1,25 @@
+2017-08-07  Simon Fraser  <simon.fra...@apple.com>
+
+        Inline ~Color and Color::isExtended()
+        https://bugs.webkit.org/show_bug.cgi?id=175293
+
+        Reviewed by Zalan Bujtas.
+
+        The Color destructor and Color::isExtended() show up on profiles, so inline them.
+        Before r207265 the destructor was inlined.
+        
+        Also make sure that LengthSize::operator== is inlined, which it was not (according
+        to profiles).
+
+        * platform/LengthSize.h:
+        (WebCore::operator==):
+        * platform/graphics/Color.cpp:
+        (WebCore::Color::~Color): Deleted.
+        (WebCore::Color::isExtended const): Deleted.
+        * platform/graphics/Color.h:
+        (WebCore::Color::~Color):
+        (WebCore::Color::isExtended const):
+
 2017-08-04  Brent Fulgham  <bfulg...@apple.com>
 
         Implement the HTML5 same-origin restriction specification

Modified: trunk/Source/WebCore/platform/LengthSize.h (220377 => 220378)


--- trunk/Source/WebCore/platform/LengthSize.h	2017-08-08 02:29:42 UTC (rev 220377)
+++ trunk/Source/WebCore/platform/LengthSize.h	2017-08-08 02:46:06 UTC (rev 220378)
@@ -28,7 +28,7 @@
     Length height;
 };
 
-inline bool operator==(const LengthSize& a, const LengthSize& b)
+ALWAYS_INLINE bool operator==(const LengthSize& a, const LengthSize& b)
 {
     return a.width == b.width && a.height == b.height;
 }

Modified: trunk/Source/WebCore/platform/graphics/Color.cpp (220377 => 220378)


--- trunk/Source/WebCore/platform/graphics/Color.cpp	2017-08-08 02:29:42 UTC (rev 220377)
+++ trunk/Source/WebCore/platform/graphics/Color.cpp	2017-08-08 02:46:06 UTC (rev 220378)
@@ -307,12 +307,6 @@
     ASSERT(isExtended());
 }
 
-Color::~Color()
-{
-    if (isExtended())
-        m_colorData.extendedColor->deref();
-}
-
 Color& Color::operator=(const Color& other)
 {
     if (*this == other)
@@ -665,11 +659,6 @@
     m_colorData.rgbaAndFlags |= validRGBAColor;
 }
 
-bool Color::isExtended() const
-{
-    return !(m_colorData.rgbaAndFlags & invalidRGBAColor);
-}
-
 ExtendedColor& Color::asExtended() const
 {
     ASSERT(isExtended());

Modified: trunk/Source/WebCore/platform/graphics/Color.h (220377 => 220378)


--- trunk/Source/WebCore/platform/graphics/Color.h	2017-08-08 02:29:42 UTC (rev 220377)
+++ trunk/Source/WebCore/platform/graphics/Color.h	2017-08-08 02:46:06 UTC (rev 220378)
@@ -173,7 +173,11 @@
     WEBCORE_EXPORT Color(const Color&);
     WEBCORE_EXPORT Color(Color&&);
 
-    WEBCORE_EXPORT ~Color();
+    ~Color()
+    {
+        if (isExtended())
+            m_colorData.extendedColor->deref();
+    }
 
     static Color createUnchecked(int r, int g, int b)
     {
@@ -274,7 +278,10 @@
     static const RGBA32 compositionFill = 0xFFE1DD55;
 #endif
 
-    WEBCORE_EXPORT bool isExtended() const;
+    bool isExtended() const
+    {
+        return !(m_colorData.rgbaAndFlags & invalidRGBAColor);
+    }
     WEBCORE_EXPORT ExtendedColor& asExtended() const;
 
     WEBCORE_EXPORT Color& operator=(const Color&);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to