OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 MarkingVisitorImpl_h | 5 #ifndef MarkingVisitorImpl_h |
6 #define MarkingVisitorImpl_h | 6 #define MarkingVisitorImpl_h |
7 | 7 |
8 #include "platform/heap/Heap.h" | 8 #include "platform/heap/Heap.h" |
9 #include "platform/heap/ThreadState.h" | 9 #include "platform/heap/ThreadState.h" |
10 #include "platform/heap/Visitor.h" | 10 #include "platform/heap/Visitor.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 toDerived()->heap().registerWeakTable( | 81 toDerived()->heap().registerWeakTable( |
82 const_cast<void*>(closure), iterationCallback, iterationDoneCallback); | 82 const_cast<void*>(closure), iterationCallback, iterationDoneCallback); |
83 } | 83 } |
84 | 84 |
85 #if ENABLE(ASSERT) | 85 #if ENABLE(ASSERT) |
86 inline bool weakTableRegistered(const void* closure) { | 86 inline bool weakTableRegistered(const void* closure) { |
87 return toDerived()->heap().weakTableRegistered(closure); | 87 return toDerived()->heap().weakTableRegistered(closure); |
88 } | 88 } |
89 #endif | 89 #endif |
90 | 90 |
91 inline void registerMovingObjectReference(MovableReference* slot) { | |
92 if (toDerived()->getMarkingMode() != Visitor::GlobalMarkingWithCompaction) | |
93 return; | |
94 toDerived()->heap().registerMovingObjectReference(slot); | |
95 } | |
96 | |
97 inline void registerMovingObjectCallback(MovableReference reference, | |
98 MovingObjectCallback callback, | |
99 void* callbackData) { | |
100 if (toDerived()->getMarkingMode() != Visitor::GlobalMarkingWithCompaction) | |
101 return; | |
102 toDerived()->heap().registerMovingObjectCallback(reference, callback, | |
103 callbackData); | |
104 } | |
105 | |
106 inline bool ensureMarked(const void* objectPointer) { | 91 inline bool ensureMarked(const void* objectPointer) { |
107 if (!objectPointer) | 92 if (!objectPointer) |
108 return false; | 93 return false; |
109 if (!toDerived()->shouldMarkObject(objectPointer)) | 94 if (!toDerived()->shouldMarkObject(objectPointer)) |
110 return false; | 95 return false; |
111 #if ENABLE(ASSERT) | 96 #if ENABLE(ASSERT) |
112 if (HeapObjectHeader::fromPayload(objectPointer)->isMarked()) | 97 if (HeapObjectHeader::fromPayload(objectPointer)->isMarked()) |
113 return false; | 98 return false; |
114 | 99 |
115 toDerived()->markNoTracing(objectPointer); | 100 toDerived()->markNoTracing(objectPointer); |
(...skipping 20 matching lines...) Expand all Loading... |
136 | 121 |
137 private: | 122 private: |
138 static void markNoTracingCallback(Visitor* visitor, void* object) { | 123 static void markNoTracingCallback(Visitor* visitor, void* object) { |
139 visitor->markNoTracing(object); | 124 visitor->markNoTracing(object); |
140 } | 125 } |
141 }; | 126 }; |
142 | 127 |
143 } // namespace blink | 128 } // namespace blink |
144 | 129 |
145 #endif | 130 #endif |
OLD | NEW |