| 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 27 matching lines...) Expand all Loading... |
| 38 if (header->isMarked()) | 38 if (header->isMarked()) |
| 39 return; | 39 return; |
| 40 | 40 |
| 41 #if ENABLE(ASSERT) | 41 #if ENABLE(ASSERT) |
| 42 ASSERT(ThreadState::current()->isInGC()); | 42 ASSERT(ThreadState::current()->isInGC()); |
| 43 ASSERT(Heap::findPageFromAddress(header)); | 43 ASSERT(Heap::findPageFromAddress(header)); |
| 44 ASSERT(toDerived()->markingMode() != Visitor::WeakProcessing); | 44 ASSERT(toDerived()->markingMode() != Visitor::WeakProcessing); |
| 45 #endif | 45 #endif |
| 46 header->mark(); | 46 header->mark(); |
| 47 | 47 |
| 48 #if ENABLE(GC_PROFILING) | |
| 49 toDerived()->recordObjectGraphEdge(objectPointer); | |
| 50 #endif | |
| 51 | |
| 52 if (callback) | 48 if (callback) |
| 53 Heap::pushTraceCallback(const_cast<void*>(objectPointer), callback); | 49 Heap::pushTraceCallback(const_cast<void*>(objectPointer), callback); |
| 54 } | 50 } |
| 55 | 51 |
| 56 inline void mark(const void* objectPointer, TraceCallback callback) | 52 inline void mark(const void* objectPointer, TraceCallback callback) |
| 57 { | 53 { |
| 58 if (!objectPointer) | 54 if (!objectPointer) |
| 59 return; | 55 return; |
| 60 HeapObjectHeader* header = HeapObjectHeader::fromPayload(objectPointer); | 56 HeapObjectHeader* header = HeapObjectHeader::fromPayload(objectPointer); |
| 61 markHeader(header, header->payload(), callback); | 57 markHeader(header, header->payload(), callback); |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 private: | 125 private: |
| 130 static void markNoTracingCallback(Visitor* visitor, void* object) | 126 static void markNoTracingCallback(Visitor* visitor, void* object) |
| 131 { | 127 { |
| 132 visitor->markNoTracing(object); | 128 visitor->markNoTracing(object); |
| 133 } | 129 } |
| 134 }; | 130 }; |
| 135 | 131 |
| 136 } // namespace blink | 132 } // namespace blink |
| 137 | 133 |
| 138 #endif | 134 #endif |
| OLD | NEW |