Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(816)

Unified Diff: Source/core/dom/Node.h

Issue 1305163006: Oilpan: Decrease sizeof(Node) by 8 byte Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/core/dom/Node.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Node.h
diff --git a/Source/core/dom/Node.h b/Source/core/dom/Node.h
index dc0b0f822e42ab36d19932514ce099a62915f44f..12e86142295fef1993c0eff9c131e6c1288e32c5 100644
--- a/Source/core/dom/Node.h
+++ b/Source/core/dom/Node.h
@@ -101,6 +101,12 @@ enum StyleChangeType {
NeedsReattachStyleChange = 3 << nodeStyleChangeShift,
};
+#if ENABLE(OILPAN) && USE_4BYTE_HEADER_PADDING
+#define NODE_FLAGS reinterpret_cast<HeapObjectHeader*>(reinterpret_cast<uint8_t*>(static_cast<EventTarget*>(const_cast<Node*>(this))) - sizeof(HeapObjectHeader))->m_padding
+#else
+#define NODE_FLAGS m_nodeFlags
+#endif
+
class NodeRareDataBase {
public:
LayoutObject* layoutObject() const { return m_layoutObject; }
@@ -354,7 +360,7 @@ public:
bool needsAttach() const { return styleChangeType() == NeedsReattachStyleChange; }
bool needsStyleRecalc() const { return styleChangeType() != NoStyleChange; }
- StyleChangeType styleChangeType() const { return static_cast<StyleChangeType>(m_nodeFlags & StyleChangeMask); }
+ StyleChangeType styleChangeType() const { return static_cast<StyleChangeType>(NODE_FLAGS & StyleChangeMask); }
bool childNeedsStyleRecalc() const { return getFlag(ChildNeedsStyleRecalcFlag); }
bool isLink() const { return getFlag(IsLinkFlag); }
bool isEditingText() const { ASSERT(isTextNode()); return getFlag(HasNameOrIsEditingTextFlag); }
@@ -725,10 +731,10 @@ private:
// 3 bits remaining.
- bool getFlag(NodeFlags mask) const { return m_nodeFlags & mask; }
- void setFlag(bool f, NodeFlags mask) { m_nodeFlags = (m_nodeFlags & ~mask) | (-(int32_t)f & mask); }
- void setFlag(NodeFlags mask) { m_nodeFlags |= mask; }
- void clearFlag(NodeFlags mask) { m_nodeFlags &= ~mask; }
+ bool getFlag(NodeFlags mask) const { return NODE_FLAGS & mask; }
+ void setFlag(bool f, NodeFlags mask) { NODE_FLAGS = (NODE_FLAGS & ~mask) | (-(int32_t)f & mask); }
+ void setFlag(NodeFlags mask) { NODE_FLAGS |= mask; }
+ void clearFlag(NodeFlags mask) { NODE_FLAGS &= ~mask; }
protected:
enum ConstructionType {
@@ -810,7 +816,9 @@ private:
WillBeHeapVector<OwnPtrWillBeMember<MutationObserverRegistration>>* mutationObserverRegistry();
WillBeHeapHashSet<RawPtrWillBeMember<MutationObserverRegistration>>* transientMutationObserverRegistry();
+#if !(ENABLE(OILPAN) && USE_4BYTE_HEADER_PADDING)
uint32_t m_nodeFlags;
+#endif
RawPtrWillBeMember<ContainerNode> m_parentOrShadowHostNode;
RawPtrWillBeMember<TreeScope> m_treeScope;
RawPtrWillBeMember<Node> m_previous;
« no previous file with comments | « no previous file | Source/core/dom/Node.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698