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 "config.h" | 5 #include "config.h" |
6 #include "platform/heap/PersistentNode.h" | 6 #include "platform/heap/PersistentNode.h" |
7 | 7 |
8 #include "platform/heap/Handle.h" | 8 #include "platform/heap/Handle.h" |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
112 continue; | 112 continue; |
113 | 113 |
114 // 'self' is in use, containing the cross-thread persistent wrapper object. | 114 // 'self' is in use, containing the cross-thread persistent wrapper object. |
115 CrossThreadPersistent<GCObject>* persistent = reinterpret_cast<Cross ThreadPersistent<GCObject>*>(slots->m_slot[i].self()); | 115 CrossThreadPersistent<GCObject>* persistent = reinterpret_cast<Cross ThreadPersistent<GCObject>*>(slots->m_slot[i].self()); |
116 ASSERT(persistent); | 116 ASSERT(persistent); |
117 void* rawObject = persistent->get(); | 117 void* rawObject = persistent->get(); |
118 if (!rawObject) | 118 if (!rawObject) |
119 continue; | 119 continue; |
120 BasePage* page = pageFromObject(rawObject); | 120 BasePage* page = pageFromObject(rawObject); |
121 ASSERT(page); | 121 ASSERT(page); |
122 // The main thread will upon detach just mark its heap pages as orph aned, | |
123 // but not invalidate its CrossThreadPersistent<>s. | |
124 if (page->orphaned()) | |
125 continue; | |
122 if (page->heap()->threadState() == threadState) | 126 if (page->heap()->threadState() == threadState) |
haraken
2015/08/05 14:22:33
ah, page->heap() should be null for already orphan
| |
123 persistent->clear(); | 127 persistent->clear(); |
124 } | 128 } |
125 slots = slots->m_next; | 129 slots = slots->m_next; |
126 } | 130 } |
127 } | 131 } |
128 | 132 |
129 } // namespace blink | 133 } // namespace blink |
OLD | NEW |