| 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 21 matching lines...) Expand all Loading... |
| 32 // the dangling pointer. | 32 // the dangling pointer. |
| 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 heaps are zapped. | 35 // because all the entries of the orphaned heaps 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 #if ENABLE(ASSERT) | 41 #if ENABLE(ASSERT) |
| 42 toDerived()->checkMarkingAllowed(); | 42 ASSERT(ThreadState::current()->isInGC()); |
| 43 ASSERT(Heap::findPageFromAddress(header)); | 43 ASSERT(Heap::findPageFromAddress(header)); |
| 44 #endif | 44 #endif |
| 45 header->mark(); | 45 header->mark(); |
| 46 | 46 |
| 47 #if ENABLE(GC_PROFILING) | 47 #if ENABLE(GC_PROFILING) |
| 48 toDerived()->recordObjectGraphEdge(objectPointer); | 48 toDerived()->recordObjectGraphEdge(objectPointer); |
| 49 #endif | 49 #endif |
| 50 | 50 |
| 51 if (callback) | 51 if (callback) |
| 52 Heap::pushTraceCallback(const_cast<void*>(objectPointer), callback); | 52 Heap::pushTraceCallback(const_cast<void*>(objectPointer), callback); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 private: | 118 private: |
| 119 static void markNoTracingCallback(Visitor* visitor, void* object) | 119 static void markNoTracingCallback(Visitor* visitor, void* object) |
| 120 { | 120 { |
| 121 visitor->markNoTracing(object); | 121 visitor->markNoTracing(object); |
| 122 } | 122 } |
| 123 }; | 123 }; |
| 124 | 124 |
| 125 } // namespace blink | 125 } // namespace blink |
| 126 | 126 |
| 127 #endif | 127 #endif |
| OLD | NEW |