Title: [96693] trunk/Source/WebCore
- Revision
- 96693
- Author
- [email protected]
- Date
- 2011-10-05 04:38:51 -0700 (Wed, 05 Oct 2011)
Log Message
REGRESSION(r82611) InlineBox has 33 bits of bitset, causing alignment issues and extra memory use.
https://bugs.webkit.org/show_bug.cgi?id=64914
Reviewed by Antti Koivisto.
Remove InlineBox::prevOnLineExists() and its two accompanying bitfields
since nobody is using them anymore. nextOnLineExists() is still used by
GTK+ accessibility code.
Also added a compile-time assertion to guard against future bloating of
the InlineBox class.
* rendering/InlineBox.cpp:
(WebCore::SameSizeAsInlineBox::~SameSizeAsInlineBox):
* rendering/InlineBox.h:
(WebCore::InlineBox::InlineBox):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (96692 => 96693)
--- trunk/Source/WebCore/ChangeLog 2011-10-05 11:24:20 UTC (rev 96692)
+++ trunk/Source/WebCore/ChangeLog 2011-10-05 11:38:51 UTC (rev 96693)
@@ -1,3 +1,22 @@
+2011-10-03 Andreas Kling <[email protected]>
+
+ REGRESSION(r82611) InlineBox has 33 bits of bitset, causing alignment issues and extra memory use.
+ https://bugs.webkit.org/show_bug.cgi?id=64914
+
+ Reviewed by Antti Koivisto.
+
+ Remove InlineBox::prevOnLineExists() and its two accompanying bitfields
+ since nobody is using them anymore. nextOnLineExists() is still used by
+ GTK+ accessibility code.
+
+ Also added a compile-time assertion to guard against future bloating of
+ the InlineBox class.
+
+ * rendering/InlineBox.cpp:
+ (WebCore::SameSizeAsInlineBox::~SameSizeAsInlineBox):
+ * rendering/InlineBox.h:
+ (WebCore::InlineBox::InlineBox):
+
2011-10-05 Andreas Kling <[email protected]>
Shrink FontFallbackList.
Modified: trunk/Source/WebCore/rendering/InlineBox.cpp (96692 => 96693)
--- trunk/Source/WebCore/rendering/InlineBox.cpp 2011-10-05 11:24:20 UTC (rev 96692)
+++ trunk/Source/WebCore/rendering/InlineBox.cpp 2011-10-05 11:38:51 UTC (rev 96693)
@@ -34,8 +34,25 @@
using namespace std;
namespace WebCore {
-
+
+#if !COMPILER(MSVC)
+// FIXME: Figure out why this doesn't work on MSVC.
+class SameSizeAsInlineBox {
+ virtual ~SameSizeAsInlineBox() { }
+ void* a[4];
+ FloatPoint b;
+ float c;
+ uint32_t d : 31;
+ bool e : 1;
#ifndef NDEBUG
+ bool f;
+#endif
+};
+
+COMPILE_ASSERT(sizeof(InlineBox) == sizeof(SameSizeAsInlineBox), InlineBox_size_guard);
+#endif
+
+#ifndef NDEBUG
static bool inInlineBoxDetach;
#endif
@@ -258,21 +275,6 @@
return m_nextOnLineExists;
}
-bool InlineBox::prevOnLineExists() const
-{
- if (!m_determinedIfPrevOnLineExists) {
- m_determinedIfPrevOnLineExists = true;
-
- if (!parent())
- m_prevOnLineExists = false;
- else if (prevOnLine())
- m_prevOnLineExists = true;
- else
- m_prevOnLineExists = parent()->prevOnLineExists();
- }
- return m_prevOnLineExists;
-}
-
InlineBox* InlineBox::nextLeafChild() const
{
InlineBox* leaf = 0;
Modified: trunk/Source/WebCore/rendering/InlineBox.h (96692 => 96693)
--- trunk/Source/WebCore/rendering/InlineBox.h 2011-10-05 11:24:20 UTC (rev 96692)
+++ trunk/Source/WebCore/rendering/InlineBox.h 2011-10-05 11:38:51 UTC (rev 96693)
@@ -56,9 +56,7 @@
, m_dirOverride(false)
, m_isText(false)
, m_determinedIfNextOnLineExists(false)
- , m_determinedIfPrevOnLineExists(false)
, m_nextOnLineExists(false)
- , m_prevOnLineExists(false)
, m_expansion(0)
#ifndef NDEBUG
, m_hasBadParent(false)
@@ -90,9 +88,7 @@
, m_dirOverride(false)
, m_isText(false)
, m_determinedIfNextOnLineExists(false)
- , m_determinedIfPrevOnLineExists(false)
, m_nextOnLineExists(false)
- , m_prevOnLineExists(false)
, m_expansion(0)
#ifndef NDEBUG
, m_hasBadParent(false)
@@ -203,7 +199,6 @@
m_prev = prev;
}
bool nextOnLineExists() const;
- bool prevOnLineExists() const;
virtual bool isLeaf() const { return true; }
@@ -364,9 +359,7 @@
bool m_isText : 1; // Whether or not this object represents text with a non-zero height. Includes non-image list markers, text boxes.
protected:
mutable bool m_determinedIfNextOnLineExists : 1;
- mutable bool m_determinedIfPrevOnLineExists : 1;
mutable bool m_nextOnLineExists : 1;
- mutable bool m_prevOnLineExists : 1;
signed m_expansion : 11; // for justified text
#ifndef NDEBUG
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes