OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "platform/heap/PersistentNode.h" | 5 #include "platform/heap/PersistentNode.h" |
6 | 6 |
7 #include "platform/heap/Handle.h" | 7 #include "platform/heap/Handle.h" |
8 | 8 |
9 namespace blink { | 9 namespace blink { |
10 | 10 |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 prevNext = &slots->m_next; | 117 prevNext = &slots->m_next; |
118 slots = slots->m_next; | 118 slots = slots->m_next; |
119 } | 119 } |
120 } | 120 } |
121 ASSERT(persistentCount == m_persistentCount); | 121 ASSERT(persistentCount == m_persistentCount); |
122 } | 122 } |
123 | 123 |
124 bool CrossThreadPersistentRegion::shouldTracePersistentNode(Visitor* visitor, Pe
rsistentNode* node) | 124 bool CrossThreadPersistentRegion::shouldTracePersistentNode(Visitor* visitor, Pe
rsistentNode* node) |
125 { | 125 { |
126 CrossThreadPersistent<DummyGCBase>* persistent = reinterpret_cast<CrossThrea
dPersistent<DummyGCBase>*>(node->self()); | 126 CrossThreadPersistent<DummyGCBase>* persistent = reinterpret_cast<CrossThrea
dPersistent<DummyGCBase>*>(node->self()); |
127 DCHECK(persistent); | 127 ASSERT(persistent); |
128 DCHECK(!persistent->isHashTableDeletedValue()); | |
129 Address rawObject = reinterpret_cast<Address>(persistent->get()); | 128 Address rawObject = reinterpret_cast<Address>(persistent->get()); |
130 if (!rawObject) | 129 if (!rawObject) |
131 return false; | 130 return false; |
132 return &visitor->heap() == &ThreadState::fromObject(rawObject)->heap(); | 131 return &visitor->heap() == &ThreadState::fromObject(rawObject)->heap(); |
133 } | 132 } |
134 | 133 |
135 void CrossThreadPersistentRegion::prepareForThreadStateTermination(ThreadState*
threadState) | 134 void CrossThreadPersistentRegion::prepareForThreadStateTermination(ThreadState*
threadState) |
136 { | 135 { |
137 // For heaps belonging to a thread that's detaching, any cross-thread persis
tents | 136 // For heaps belonging to a thread that's detaching, any cross-thread persis
tents |
138 // pointing into them needs to be disabled. Do that by clearing out the unde
rlying | 137 // pointing into them needs to be disabled. Do that by clearing out the unde
rlying |
(...skipping 24 matching lines...) Expand all Loading... |
163 if (page->arena()->getThreadState() == threadState) { | 162 if (page->arena()->getThreadState() == threadState) { |
164 persistent->clear(); | 163 persistent->clear(); |
165 ASSERT(slots->m_slot[i].isUnused()); | 164 ASSERT(slots->m_slot[i].isUnused()); |
166 } | 165 } |
167 } | 166 } |
168 slots = slots->m_next; | 167 slots = slots->m_next; |
169 } | 168 } |
170 } | 169 } |
171 | 170 |
172 } // namespace blink | 171 } // namespace blink |
OLD | NEW |