Title: [130718] trunk/Source/WebCore
- Revision
- 130718
- Author
- kl...@webkit.org
- Date
- 2012-10-08 22:12:56 -0700 (Mon, 08 Oct 2012)
Log Message
1.18MB below RenderTableSection::setCachedCollapsedBorderValue() on Membuster3.
<http://webkit.org/b/98670>
<rdar://problem/12454276>
Reviewed by Anders Carlsson.
Refactor CollapsedBorderValue to only store the bits and pieces from the BorderValue
that it actually needs. Packed the whole thing into 64 bits.
Reduces memory consumption by 547kB on Membuster3.
* rendering/RenderTableCell.cpp:
Add compile-time size assertion for CollapsedBorderValue.
* rendering/style/CollapsedBorderValue.h:
(WebCore::CollapsedBorderValue::CollapsedBorderValue):
(WebCore::CollapsedBorderValue::width):
(WebCore::CollapsedBorderValue::style):
(WebCore::CollapsedBorderValue::color):
(WebCore::CollapsedBorderValue::isTransparent):
(WebCore::CollapsedBorderValue::precedence):
(WebCore::CollapsedBorderValue::isSameIgnoringColor):
(CollapsedBorderValue):
Apply shrinkwrap to CollapsedBorderValue. Removed specialized copy constructor since
the class only has primitive members now.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (130717 => 130718)
--- trunk/Source/WebCore/ChangeLog 2012-10-09 04:47:07 UTC (rev 130717)
+++ trunk/Source/WebCore/ChangeLog 2012-10-09 05:12:56 UTC (rev 130718)
@@ -1,3 +1,33 @@
+2012-10-08 Andreas Kling <kl...@webkit.org>
+
+ 1.18MB below RenderTableSection::setCachedCollapsedBorderValue() on Membuster3.
+ <http://webkit.org/b/98670>
+ <rdar://problem/12454276>
+
+ Reviewed by Anders Carlsson.
+
+ Refactor CollapsedBorderValue to only store the bits and pieces from the BorderValue
+ that it actually needs. Packed the whole thing into 64 bits.
+
+ Reduces memory consumption by 547kB on Membuster3.
+
+ * rendering/RenderTableCell.cpp:
+
+ Add compile-time size assertion for CollapsedBorderValue.
+
+ * rendering/style/CollapsedBorderValue.h:
+ (WebCore::CollapsedBorderValue::CollapsedBorderValue):
+ (WebCore::CollapsedBorderValue::width):
+ (WebCore::CollapsedBorderValue::style):
+ (WebCore::CollapsedBorderValue::color):
+ (WebCore::CollapsedBorderValue::isTransparent):
+ (WebCore::CollapsedBorderValue::precedence):
+ (WebCore::CollapsedBorderValue::isSameIgnoringColor):
+ (CollapsedBorderValue):
+
+ Apply shrinkwrap to CollapsedBorderValue. Removed specialized copy constructor since
+ the class only has primitive members now.
+
2012-10-08 Yoshifumi Inoue <yo...@chromium.org>
HTMLSelectElement::typeAheadFind depends on implementation dependent behavior
Modified: trunk/Source/WebCore/rendering/RenderTableCell.cpp (130717 => 130718)
--- trunk/Source/WebCore/rendering/RenderTableCell.cpp 2012-10-09 04:47:07 UTC (rev 130717)
+++ trunk/Source/WebCore/rendering/RenderTableCell.cpp 2012-10-09 05:12:56 UTC (rev 130718)
@@ -53,8 +53,8 @@
};
COMPILE_ASSERT(sizeof(RenderTableCell) == sizeof(SameSizeAsRenderTableCell), RenderTableCell_should_stay_small);
+COMPILE_ASSERT(sizeof(CollapsedBorderValue) == 8, CollapsedBorderValue_should_stay_small);
-
RenderTableCell::RenderTableCell(Node* node)
: RenderBlock(node)
, m_column(unsetColumnIndex)
Modified: trunk/Source/WebCore/rendering/style/CollapsedBorderValue.h (130717 => 130718)
--- trunk/Source/WebCore/rendering/style/CollapsedBorderValue.h 2012-10-09 04:47:07 UTC (rev 130717)
+++ trunk/Source/WebCore/rendering/style/CollapsedBorderValue.h 2012-10-09 05:12:56 UTC (rev 130718)
@@ -32,42 +32,44 @@
class CollapsedBorderValue {
public:
CollapsedBorderValue()
- : m_precedence(BOFF)
+ : m_color(0)
+ , m_colorIsValid(false)
+ , m_width(0)
+ , m_style(BNONE)
+ , m_precedence(BOFF)
+ , m_transparent(false)
{
}
- // This copy constructor is for preventing GCC (x86) from creating an
- // unexpected one as written in <http://webkit.org/b/81502>.
- CollapsedBorderValue(const CollapsedBorderValue& other)
- : m_border(other.m_border)
- , m_borderColor(other.m_borderColor)
- , m_precedence(other.m_precedence)
+ CollapsedBorderValue(const BorderValue& border, const Color& color, EBorderPrecedence precedence)
+ : m_color(color.rgb())
+ , m_colorIsValid(color.isValid())
+ , m_width(border.nonZero() ? border.width() : 0)
+ , m_style(border.style())
+ , m_precedence(precedence)
+ , m_transparent(border.isTransparent())
{
}
- CollapsedBorderValue(const BorderValue& b, Color c, EBorderPrecedence p)
- : m_border(b)
- , m_borderColor(c)
- , m_precedence(p)
- {
- }
-
- int width() const { return m_border.nonZero() ? m_border.width() : 0; }
- EBorderStyle style() const { return m_border.style(); }
+ unsigned width() const { return m_width; }
+ EBorderStyle style() const { return static_cast<EBorderStyle>(m_style); }
bool exists() const { return m_precedence != BOFF; }
- const Color& color() const { return m_borderColor; }
- bool isTransparent() const { return m_border.isTransparent(); }
- EBorderPrecedence precedence() const { return m_precedence; }
+ Color color() const { return Color(m_color, m_colorIsValid); }
+ bool isTransparent() const { return m_transparent; }
+ EBorderPrecedence precedence() const { return static_cast<EBorderPrecedence>(m_precedence); }
bool isSameIgnoringColor(const CollapsedBorderValue& o) const
{
- return m_border.width() == o.m_border.width() && m_border.style() == o.m_border.style() && m_precedence == o.m_precedence;
+ return width() == o.width() && style() == o.style() && precedence() == o.precedence();
}
private:
- BorderValue m_border;
- Color m_borderColor;
- EBorderPrecedence m_precedence;
+ RGBA32 m_color;
+ unsigned m_colorIsValid : 1;
+ unsigned m_width : 23;
+ unsigned m_style : 4; // EBorderStyle
+ unsigned m_precedence : 3; // EBorderPrecedence
+ unsigned m_transparent : 1;
};
} // namespace WebCore
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes