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

Side by Side Diff: Source/core/dom/NodeRareData.cpp

Issue 423093002: Oilpan: Prepare to move RenderObject and RenderObjectChildList to Oilpan heap. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add more trace Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 15 matching lines...) Expand all
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #include "config.h" 31 #include "config.h"
32 #include "core/dom/NodeRareData.h" 32 #include "core/dom/NodeRareData.h"
33 #include "core/dom/Element.h" 33 #include "core/dom/Element.h"
34 #include "core/dom/ElementRareData.h" 34 #include "core/dom/ElementRareData.h"
35 #include "core/page/Page.h" 35 #include "core/page/Page.h"
36 #include "core/rendering/RenderObject.h"
36 #include "platform/heap/Handle.h" 37 #include "platform/heap/Handle.h"
37 38
38 namespace blink { 39 namespace blink {
39 40
40 struct SameSizeAsNodeRareData { 41 struct SameSizeAsNodeRareData {
41 void* m_pointer[2]; 42 void* m_pointer[2];
42 OwnPtrWillBeMember<NodeMutationObserverData> m_mutationObserverData; 43 OwnPtrWillBeMember<NodeMutationObserverData> m_mutationObserverData;
43 unsigned m_bitfields; 44 unsigned m_bitfields;
44 }; 45 };
45 46
46 COMPILE_ASSERT(sizeof(NodeRareData) == sizeof(SameSizeAsNodeRareData), NodeRareD ataShouldStaySmall); 47 COMPILE_ASSERT(sizeof(NodeRareData) == sizeof(SameSizeAsNodeRareData), NodeRareD ataShouldStaySmall);
47 48
48 void NodeRareData::traceAfterDispatch(Visitor* visitor) 49 void NodeRareData::traceAfterDispatch(Visitor* visitor)
49 { 50 {
51 #if ENABLE(OILPAN)
52 visitor->trace(m_renderer);
53 #endif
50 visitor->trace(m_mutationObserverData); 54 visitor->trace(m_mutationObserverData);
51 // Do not keep empty NodeListsNodeData objects around. 55 // Do not keep empty NodeListsNodeData objects around.
52 if (m_nodeLists && m_nodeLists->isEmpty()) 56 if (m_nodeLists && m_nodeLists->isEmpty())
53 m_nodeLists.clear(); 57 m_nodeLists.clear();
54 else 58 else
55 visitor->trace(m_nodeLists); 59 visitor->trace(m_nodeLists);
56 } 60 }
57 61
58 void NodeRareData::trace(Visitor* visitor) 62 void NodeRareData::trace(Visitor* visitor)
59 { 63 {
60 if (m_isElementRareData) 64 if (m_isElementRareData)
61 static_cast<ElementRareData*>(this)->traceAfterDispatch(visitor); 65 static_cast<ElementRareData*>(this)->traceAfterDispatch(visitor);
62 else 66 else
63 traceAfterDispatch(visitor); 67 traceAfterDispatch(visitor);
64 } 68 }
65 69
66 void NodeRareData::finalizeGarbageCollectedObject() 70 void NodeRareData::finalizeGarbageCollectedObject()
67 { 71 {
68 RELEASE_ASSERT(!renderer()); 72 RELEASE_ASSERT(!renderer());
69 if (m_isElementRareData) 73 if (m_isElementRareData)
70 static_cast<ElementRareData*>(this)->~ElementRareData(); 74 static_cast<ElementRareData*>(this)->~ElementRareData();
71 else 75 else
72 this->~NodeRareData(); 76 this->~NodeRareData();
73 } 77 }
74 78
75 // Ensure the 10 bits reserved for the m_connectedFrameCount cannot overflow 79 // Ensure the 10 bits reserved for the m_connectedFrameCount cannot overflow
76 COMPILE_ASSERT(Page::maxNumberOfFrames < (1 << NodeRareData::ConnectedFrameCount Bits), Frame_limit_should_fit_in_rare_data_count); 80 COMPILE_ASSERT(Page::maxNumberOfFrames < (1 << NodeRareData::ConnectedFrameCount Bits), Frame_limit_should_fit_in_rare_data_count);
77 81
78 } // namespace blink 82 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698