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 30 matching lines...) Expand all Loading... |
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 ENABLE(ASSERT) |
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 { | |
52 Impl::registerMovingObjectReference(slot); | |
53 } | |
54 | |
55 void registerMovingObjectCallback(MovableReference backingStore, | |
56 MovingObjectCallback callback, | |
57 void* callbackData) override { | |
58 Impl::registerMovingObjectCallback(backingStore, callback, callbackData); | |
59 } | |
60 | |
61 bool ensureMarked(const void* objectPointer) override { | 51 bool ensureMarked(const void* objectPointer) override { |
62 return Impl::ensureMarked(objectPointer); | 52 return Impl::ensureMarked(objectPointer); |
63 } | 53 } |
64 | 54 |
65 void registerWeakCellWithCallback(void** cell, | 55 void registerWeakCellWithCallback(void** cell, |
66 WeakCallback callback) override { | 56 WeakCallback callback) override { |
67 Impl::registerWeakCellWithCallback(cell, callback); | 57 Impl::registerWeakCellWithCallback(cell, callback); |
68 } | 58 } |
69 | 59 |
70 protected: | 60 protected: |
71 inline bool shouldMarkObject(const void* objectPointer) const { | 61 inline bool shouldMarkObject(const void* objectPointer) const { |
72 if (Mode != ThreadLocalMarking) | 62 if (Mode != ThreadLocalMarking) |
73 return true; | 63 return true; |
74 | 64 |
75 BasePage* page = pageFromObject(objectPointer); | 65 BasePage* page = pageFromObject(objectPointer); |
76 ASSERT(!page->orphaned()); | 66 ASSERT(!page->orphaned()); |
77 // When doing a thread local GC, the marker checks if | 67 // When doing a thread local GC, the marker checks if |
78 // the object resides in another thread's heap. If it | 68 // the object resides in another thread's heap. If it |
79 // does, the object should not be marked & traced. | 69 // does, the object should not be marked & traced. |
80 return page->terminating(); | 70 return page->terminating(); |
81 } | 71 } |
82 }; | 72 }; |
83 | 73 |
84 } // namespace blink | 74 } // namespace blink |
85 | 75 |
86 #endif | 76 #endif |
OLD | NEW |