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 24 matching lines...) Expand all Loading... |
35 WeakCallback callback) override { | 35 WeakCallback callback) override { |
36 Impl::registerWeakMembers(closure, objectPointer, callback); | 36 Impl::registerWeakMembers(closure, objectPointer, callback); |
37 } | 37 } |
38 | 38 |
39 virtual void registerWeakTable(const void* closure, | 39 virtual void registerWeakTable(const void* closure, |
40 EphemeronCallback iterationCallback, | 40 EphemeronCallback iterationCallback, |
41 EphemeronCallback iterationDoneCallback) { | 41 EphemeronCallback iterationDoneCallback) { |
42 Impl::registerWeakTable(closure, iterationCallback, iterationDoneCallback); | 42 Impl::registerWeakTable(closure, iterationCallback, iterationDoneCallback); |
43 } | 43 } |
44 | 44 |
45 #if ENABLE(ASSERT) | 45 #if DCHECK_IS_ON() |
46 virtual bool weakTableRegistered(const void* closure) { | 46 virtual bool weakTableRegistered(const void* closure) { |
47 return Impl::weakTableRegistered(closure); | 47 return Impl::weakTableRegistered(closure); |
48 } | 48 } |
49 #endif | 49 #endif |
50 | 50 |
51 void registerMovingObjectReference(MovableReference* slot) override { | 51 void registerMovingObjectReference(MovableReference* slot) override { |
52 Impl::registerMovingObjectReference(slot); | 52 Impl::registerMovingObjectReference(slot); |
53 } | 53 } |
54 | 54 |
55 void registerMovingObjectCallback(MovableReference backingStore, | 55 void registerMovingObjectCallback(MovableReference backingStore, |
(...skipping 10 matching lines...) Expand all Loading... |
66 WeakCallback callback) override { | 66 WeakCallback callback) override { |
67 Impl::registerWeakCellWithCallback(cell, callback); | 67 Impl::registerWeakCellWithCallback(cell, callback); |
68 } | 68 } |
69 | 69 |
70 protected: | 70 protected: |
71 inline bool shouldMarkObject(const void* objectPointer) const { | 71 inline bool shouldMarkObject(const void* objectPointer) const { |
72 if (getMarkingMode() != ThreadLocalMarking) | 72 if (getMarkingMode() != ThreadLocalMarking) |
73 return true; | 73 return true; |
74 | 74 |
75 BasePage* page = pageFromObject(objectPointer); | 75 BasePage* page = pageFromObject(objectPointer); |
76 ASSERT(!page->orphaned()); | 76 DCHECK(!page->orphaned()); |
77 // When doing a thread local GC, the marker checks if | 77 // When doing a thread local GC, the marker checks if |
78 // the object resides in another thread's heap. If it | 78 // the object resides in another thread's heap. If it |
79 // does, the object should not be marked & traced. | 79 // does, the object should not be marked & traced. |
80 return page->terminating(); | 80 return page->terminating(); |
81 } | 81 } |
82 }; | 82 }; |
83 | 83 |
84 } // namespace blink | 84 } // namespace blink |
85 | 85 |
86 #endif | 86 #endif |
OLD | NEW |