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 #ifndef MarkingVisitor_h | 5 #ifndef MarkingVisitor_h |
6 #define MarkingVisitor_h | 6 #define MarkingVisitor_h |
7 | 7 |
8 #include "platform/heap/MarkingVisitorImpl.h" | 8 #include "platform/heap/MarkingVisitorImpl.h" |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
(...skipping 23 matching lines...) Expand all Loading... |
34 virtual void mark(const void* objectPointer, TraceCallback callback) overrid
e | 34 virtual void mark(const void* objectPointer, TraceCallback callback) overrid
e |
35 { | 35 { |
36 Impl::mark(objectPointer, callback); | 36 Impl::mark(objectPointer, callback); |
37 } | 37 } |
38 | 38 |
39 virtual void registerDelayedMarkNoTracing(const void* object) override | 39 virtual void registerDelayedMarkNoTracing(const void* object) override |
40 { | 40 { |
41 Impl::registerDelayedMarkNoTracing(object); | 41 Impl::registerDelayedMarkNoTracing(object); |
42 } | 42 } |
43 | 43 |
44 virtual void registerWeakMembers(const void* closure, const void* objectPoin
ter, WeakPointerCallback callback) override | 44 virtual void registerWeakMembers(const void* closure, const void* objectPoin
ter, WeakCallback callback) override |
45 { | 45 { |
46 Impl::registerWeakMembers(closure, objectPointer, callback); | 46 Impl::registerWeakMembers(closure, objectPointer, callback); |
47 } | 47 } |
48 | 48 |
49 virtual void registerWeakTable(const void* closure, EphemeronCallback iterat
ionCallback, EphemeronCallback iterationDoneCallback) | 49 virtual void registerWeakTable(const void* closure, EphemeronCallback iterat
ionCallback, EphemeronCallback iterationDoneCallback) |
50 { | 50 { |
51 Impl::registerWeakTable(closure, iterationCallback, iterationDoneCallbac
k); | 51 Impl::registerWeakTable(closure, iterationCallback, iterationDoneCallbac
k); |
52 } | 52 } |
53 | 53 |
54 #if ENABLE(ASSERT) | 54 #if ENABLE(ASSERT) |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 } | 171 } |
172 | 172 |
173 static HashSet<uintptr_t>& objectsToFindPath() | 173 static HashSet<uintptr_t>& objectsToFindPath() |
174 { | 174 { |
175 DEFINE_STATIC_LOCAL(HashSet<uintptr_t>, set, ()); | 175 DEFINE_STATIC_LOCAL(HashSet<uintptr_t>, set, ()); |
176 return set; | 176 return set; |
177 } | 177 } |
178 #endif | 178 #endif |
179 | 179 |
180 protected: | 180 protected: |
181 virtual void registerWeakCellWithCallback(void** cell, WeakPointerCallback c
allback) override | 181 virtual void registerWeakCellWithCallback(void** cell, WeakCallback callback
) override |
182 { | 182 { |
183 Impl::registerWeakCellWithCallback(cell, callback); | 183 Impl::registerWeakCellWithCallback(cell, callback); |
184 } | 184 } |
185 | 185 |
186 inline bool shouldMarkObject(const void* objectPointer) | 186 inline bool shouldMarkObject(const void* objectPointer) |
187 { | 187 { |
188 if (Mode != ThreadLocalMarking) | 188 if (Mode != ThreadLocalMarking) |
189 return true; | 189 return true; |
190 | 190 |
191 BasePage* page = pageFromObject(objectPointer); | 191 BasePage* page = pageFromObject(objectPointer); |
192 ASSERT(!page->orphaned()); | 192 ASSERT(!page->orphaned()); |
193 // When doing a thread local GC, the marker checks if | 193 // When doing a thread local GC, the marker checks if |
194 // the object resides in another thread's heap. If it | 194 // the object resides in another thread's heap. If it |
195 // does, the object should not be marked & traced. | 195 // does, the object should not be marked & traced. |
196 return page->terminating(); | 196 return page->terminating(); |
197 } | 197 } |
198 | 198 |
199 #if ENABLE(ASSERT) | 199 #if ENABLE(ASSERT) |
200 virtual void checkMarkingAllowed() override | 200 virtual void checkMarkingAllowed() override |
201 { | 201 { |
202 ASSERT(ThreadState::current()->isInGC()); | 202 ASSERT(ThreadState::current()->isInGC()); |
203 } | 203 } |
204 #endif | 204 #endif |
205 }; | 205 }; |
206 | 206 |
207 } // namespace blink | 207 } // namespace blink |
208 | 208 |
209 #endif | 209 #endif |
OLD | NEW |