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

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

Issue 280123002: Oilpan: move LiveNodeList collections to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Have NodeRareData clear out NodeListsNodeData instead. Created 6 years, 7 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
« no previous file with comments | « Source/core/dom/NodeRareData.h ('k') | Source/core/dom/ParentNode.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 it->value->invalidateCacheForAttribute(attrName); 51 it->value->invalidateCacheForAttribute(attrName);
52 52
53 if (attrName) 53 if (attrName)
54 return; 54 return;
55 55
56 TagCollectionCacheNS::iterator tagCacheEnd = m_tagCollectionCacheNS.end(); 56 TagCollectionCacheNS::iterator tagCacheEnd = m_tagCollectionCacheNS.end();
57 for (TagCollectionCacheNS::iterator it = m_tagCollectionCacheNS.begin(); it != tagCacheEnd; ++it) 57 for (TagCollectionCacheNS::iterator it = m_tagCollectionCacheNS.begin(); it != tagCacheEnd; ++it)
58 it->value->invalidateCache(); 58 it->value->invalidateCache();
59 } 59 }
60 60
61 void NodeListsNodeData::trace(Visitor* visitor)
62 {
63 visitor->trace(m_childNodeList);
64 visitor->trace(m_atomicNameCaches);
65 visitor->trace(m_tagCollectionCacheNS);
66 }
67
61 void NodeRareData::traceAfterDispatch(Visitor* visitor) 68 void NodeRareData::traceAfterDispatch(Visitor* visitor)
62 { 69 {
63 visitor->trace(m_mutationObserverData); 70 visitor->trace(m_mutationObserverData);
71 // Do not keep empty NodeListsNodeData objects around.
72 if (m_nodeLists && m_nodeLists->isEmpty())
73 m_nodeLists.clear();
74 else
75 visitor->trace(m_nodeLists);
64 } 76 }
65 77
66 void NodeRareData::trace(Visitor* visitor) 78 void NodeRareData::trace(Visitor* visitor)
67 { 79 {
68 if (m_isElementRareData) 80 if (m_isElementRareData)
69 static_cast<ElementRareData*>(this)->traceAfterDispatch(visitor); 81 static_cast<ElementRareData*>(this)->traceAfterDispatch(visitor);
70 else 82 else
71 traceAfterDispatch(visitor); 83 traceAfterDispatch(visitor);
72 } 84 }
73 85
74 void NodeRareData::finalizeGarbageCollectedObject() 86 void NodeRareData::finalizeGarbageCollectedObject()
75 { 87 {
76 RELEASE_ASSERT(!renderer()); 88 RELEASE_ASSERT(!renderer());
77 if (m_isElementRareData) 89 if (m_isElementRareData)
78 static_cast<ElementRareData*>(this)->~ElementRareData(); 90 static_cast<ElementRareData*>(this)->~ElementRareData();
79 else 91 else
80 this->~NodeRareData(); 92 this->~NodeRareData();
81 } 93 }
82 94
83 // Ensure the 10 bits reserved for the m_connectedFrameCount cannot overflow 95 // Ensure the 10 bits reserved for the m_connectedFrameCount cannot overflow
84 COMPILE_ASSERT(Page::maxNumberOfFrames < (1 << NodeRareData::ConnectedFrameCount Bits), Frame_limit_should_fit_in_rare_data_count); 96 COMPILE_ASSERT(Page::maxNumberOfFrames < (1 << NodeRareData::ConnectedFrameCount Bits), Frame_limit_should_fit_in_rare_data_count);
85 97
86 } // namespace WebCore 98 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/NodeRareData.h ('k') | Source/core/dom/ParentNode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698