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 ASSERT(persistent); | 127 DCHECK(persistent); |
| 128 DCHECK(!persistent->isHashTableDeletedValue()); |
128 Address rawObject = reinterpret_cast<Address>(persistent->get()); | 129 Address rawObject = reinterpret_cast<Address>(persistent->get()); |
129 if (!rawObject) | 130 if (!rawObject) |
130 return false; | 131 return false; |
131 return &visitor->heap() == &ThreadState::fromObject(rawObject)->heap(); | 132 return &visitor->heap() == &ThreadState::fromObject(rawObject)->heap(); |
132 } | 133 } |
133 | 134 |
134 void CrossThreadPersistentRegion::prepareForThreadStateTermination(ThreadState*
threadState) | 135 void CrossThreadPersistentRegion::prepareForThreadStateTermination(ThreadState*
threadState) |
135 { | 136 { |
136 // For heaps belonging to a thread that's detaching, any cross-thread persis
tents | 137 // For heaps belonging to a thread that's detaching, any cross-thread persis
tents |
137 // pointing into them needs to be disabled. Do that by clearing out the unde
rlying | 138 // pointing into them needs to be disabled. Do that by clearing out the unde
rlying |
(...skipping 24 matching lines...) Expand all Loading... |
162 if (page->arena()->getThreadState() == threadState) { | 163 if (page->arena()->getThreadState() == threadState) { |
163 persistent->clear(); | 164 persistent->clear(); |
164 ASSERT(slots->m_slot[i].isUnused()); | 165 ASSERT(slots->m_slot[i].isUnused()); |
165 } | 166 } |
166 } | 167 } |
167 slots = slots->m_next; | 168 slots = slots->m_next; |
168 } | 169 } |
169 } | 170 } |
170 | 171 |
171 } // namespace blink | 172 } // namespace blink |
OLD | NEW |