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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 const_cast<void*>(closure), iterationCallback, iterationDoneCallback); | 80 const_cast<void*>(closure), iterationCallback, iterationDoneCallback); |
81 } | 81 } |
82 | 82 |
83 #if ENABLE(ASSERT) | 83 #if ENABLE(ASSERT) |
84 inline bool weakTableRegistered(const void* closure) { | 84 inline bool weakTableRegistered(const void* closure) { |
85 return toDerived()->heap().weakTableRegistered(closure); | 85 return toDerived()->heap().weakTableRegistered(closure); |
86 } | 86 } |
87 #endif | 87 #endif |
88 | 88 |
89 inline void registerMovingObjectReference(MovableReference* slot) { | 89 inline void registerMovingObjectReference(MovableReference* slot) { |
90 if (toDerived()->getMarkingMode() != | 90 DCHECK(toDerived()->getMarkingMode() == |
91 VisitorMarkingMode::GlobalMarkingWithCompaction) | 91 VisitorMarkingMode::GlobalMarkingWithCompaction); |
92 return; | |
93 toDerived()->heap().registerMovingObjectReference(slot); | 92 toDerived()->heap().registerMovingObjectReference(slot); |
94 } | 93 } |
95 | 94 |
96 inline void registerMovingObjectCallback(MovableReference reference, | 95 inline void registerMovingObjectCallback(MovableReference reference, |
97 MovingObjectCallback callback, | 96 MovingObjectCallback callback, |
98 void* callbackData) { | 97 void* callbackData) { |
99 if (toDerived()->getMarkingMode() != | 98 DCHECK(toDerived()->getMarkingMode() == |
100 VisitorMarkingMode::GlobalMarkingWithCompaction) | 99 VisitorMarkingMode::GlobalMarkingWithCompaction); |
101 return; | |
102 toDerived()->heap().registerMovingObjectCallback(reference, callback, | 100 toDerived()->heap().registerMovingObjectCallback(reference, callback, |
103 callbackData); | 101 callbackData); |
104 } | 102 } |
105 | 103 |
106 inline bool ensureMarked(const void* objectPointer) { | 104 inline bool ensureMarked(const void* objectPointer) { |
107 if (!objectPointer) | 105 if (!objectPointer) |
108 return false; | 106 return false; |
109 | 107 |
110 HeapObjectHeader* header = HeapObjectHeader::fromPayload(objectPointer); | 108 HeapObjectHeader* header = HeapObjectHeader::fromPayload(objectPointer); |
111 if (header->isMarked()) | 109 if (header->isMarked()) |
(...skipping 20 matching lines...) Expand all Loading... |
132 | 130 |
133 private: | 131 private: |
134 static void markNoTracingCallback(Visitor* visitor, void* object) { | 132 static void markNoTracingCallback(Visitor* visitor, void* object) { |
135 visitor->markNoTracing(object); | 133 visitor->markNoTracing(object); |
136 } | 134 } |
137 }; | 135 }; |
138 | 136 |
139 } // namespace blink | 137 } // namespace blink |
140 | 138 |
141 #endif | 139 #endif |
OLD | NEW |