| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 | 63 |
| 64 inline void registerDelayedMarkNoTracing(const void* objectPointer) | 64 inline void registerDelayedMarkNoTracing(const void* objectPointer) |
| 65 { | 65 { |
| 66 ASSERT(toDerived()->markingMode() != Visitor::WeakProcessing); | 66 ASSERT(toDerived()->markingMode() != Visitor::WeakProcessing); |
| 67 Heap::pushPostMarkingCallback(const_cast<void*>(objectPointer), &markNoT
racingCallback); | 67 Heap::pushPostMarkingCallback(const_cast<void*>(objectPointer), &markNoT
racingCallback); |
| 68 } | 68 } |
| 69 | 69 |
| 70 inline void registerWeakMembers(const void* closure, const void* objectPoint
er, WeakCallback callback) | 70 inline void registerWeakMembers(const void* closure, const void* objectPoint
er, WeakCallback callback) |
| 71 { | 71 { |
| 72 ASSERT(toDerived()->markingMode() != Visitor::WeakProcessing); | 72 ASSERT(toDerived()->markingMode() != Visitor::WeakProcessing); |
| 73 // We don't want to run weak processings when taking a snapshot. |
| 74 if (toDerived()->markingMode() == Visitor::SnapshotMarking) |
| 75 return; |
| 73 Heap::pushThreadLocalWeakCallback(const_cast<void*>(closure), const_cast
<void*>(objectPointer), callback); | 76 Heap::pushThreadLocalWeakCallback(const_cast<void*>(closure), const_cast
<void*>(objectPointer), callback); |
| 74 } | 77 } |
| 75 | 78 |
| 76 inline void registerWeakTable(const void* closure, EphemeronCallback iterati
onCallback, EphemeronCallback iterationDoneCallback) | 79 inline void registerWeakTable(const void* closure, EphemeronCallback iterati
onCallback, EphemeronCallback iterationDoneCallback) |
| 77 { | 80 { |
| 78 ASSERT(toDerived()->markingMode() != Visitor::WeakProcessing); | 81 ASSERT(toDerived()->markingMode() != Visitor::WeakProcessing); |
| 79 Heap::registerWeakTable(const_cast<void*>(closure), iterationCallback, i
terationDoneCallback); | 82 Heap::registerWeakTable(const_cast<void*>(closure), iterationCallback, i
terationDoneCallback); |
| 80 } | 83 } |
| 81 | 84 |
| 82 #if ENABLE(ASSERT) | 85 #if ENABLE(ASSERT) |
| (...skipping 27 matching lines...) Expand all Loading... |
| 110 | 113 |
| 111 Derived* toDerived() | 114 Derived* toDerived() |
| 112 { | 115 { |
| 113 return static_cast<Derived*>(this); | 116 return static_cast<Derived*>(this); |
| 114 } | 117 } |
| 115 | 118 |
| 116 protected: | 119 protected: |
| 117 inline void registerWeakCellWithCallback(void** cell, WeakCallback callback) | 120 inline void registerWeakCellWithCallback(void** cell, WeakCallback callback) |
| 118 { | 121 { |
| 119 ASSERT(toDerived()->markingMode() != Visitor::WeakProcessing); | 122 ASSERT(toDerived()->markingMode() != Visitor::WeakProcessing); |
| 123 // We don't want to run weak processings when taking a snapshot. |
| 124 if (toDerived()->markingMode() == Visitor::SnapshotMarking) |
| 125 return; |
| 120 Heap::pushGlobalWeakCallback(cell, callback); | 126 Heap::pushGlobalWeakCallback(cell, callback); |
| 121 } | 127 } |
| 122 | 128 |
| 123 private: | 129 private: |
| 124 static void markNoTracingCallback(Visitor* visitor, void* object) | 130 static void markNoTracingCallback(Visitor* visitor, void* object) |
| 125 { | 131 { |
| 126 visitor->markNoTracing(object); | 132 visitor->markNoTracing(object); |
| 127 } | 133 } |
| 128 }; | 134 }; |
| 129 | 135 |
| 130 } // namespace blink | 136 } // namespace blink |
| 131 | 137 |
| 132 #endif | 138 #endif |
| OLD | NEW |