Chromium Code Reviews| 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 22 matching lines...) Expand all Loading... | |
| 33 // Release builds don't have the ASSERT, but it is OK because | 33 // Release builds don't have the ASSERT, but it is OK because |
| 34 // release builds will crash in the following header->isMarked() | 34 // release builds will crash in the following header->isMarked() |
| 35 // because all the entries of the orphaned arenas are zapped. | 35 // because all the entries of the orphaned arenas are zapped. |
| 36 ASSERT(!pageFromObject(objectPointer)->orphaned()); | 36 ASSERT(!pageFromObject(objectPointer)->orphaned()); |
| 37 | 37 |
| 38 if (header->isMarked()) | 38 if (header->isMarked()) |
| 39 return; | 39 return; |
| 40 | 40 |
| 41 ASSERT(ThreadState::current()->isInGC()); | 41 ASSERT(ThreadState::current()->isInGC()); |
| 42 ASSERT(toDerived()->getMarkingMode() != Visitor::WeakProcessing); | 42 ASSERT(toDerived()->getMarkingMode() != Visitor::WeakProcessing); |
| 43 DCHECK(&pageFromObject(objectPointer)->arena()->getThreadState()->heap() == &toDerived()->heap()); | |
|
haraken
2016/05/24 16:15:28
Add a comment about what this DCHECK is checking.
keishi
2016/05/25 13:07:45
Done.
| |
| 43 | 44 |
| 44 header->mark(); | 45 header->mark(); |
| 45 | 46 |
| 46 if (callback) | 47 if (callback) |
| 47 toDerived()->heap().pushTraceCallback(const_cast<void*>(objectPointe r), callback); | 48 toDerived()->heap().pushTraceCallback(const_cast<void*>(objectPointe r), callback); |
| 48 } | 49 } |
| 49 | 50 |
| 50 inline void mark(const void* objectPointer, TraceCallback callback) | 51 inline void mark(const void* objectPointer, TraceCallback callback) |
| 51 { | 52 { |
| 52 if (!objectPointer) | 53 if (!objectPointer) |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 123 private: | 124 private: |
| 124 static void markNoTracingCallback(Visitor* visitor, void* object) | 125 static void markNoTracingCallback(Visitor* visitor, void* object) |
| 125 { | 126 { |
| 126 visitor->markNoTracing(object); | 127 visitor->markNoTracing(object); |
| 127 } | 128 } |
| 128 }; | 129 }; |
| 129 | 130 |
| 130 } // namespace blink | 131 } // namespace blink |
| 131 | 132 |
| 132 #endif | 133 #endif |
| OLD | NEW |