Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(174)

Side by Side Diff: third_party/WebKit/Source/platform/heap/MarkingVisitorImpl.h

Issue 2642933005: Have VisitorHelper<> handle moving object registration. (Closed)
Patch Set: msvc compile fix Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 toDerived()->heap().registerWeakTable( 79 toDerived()->heap().registerWeakTable(
80 const_cast<void*>(closure), iterationCallback, iterationDoneCallback); 80 const_cast<void*>(closure), iterationCallback, iterationDoneCallback);
81 } 81 }
82 82
83 #if DCHECK_IS_ON() 83 #if DCHECK_IS_ON()
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) {
90 DCHECK(toDerived()->getMarkingMode() ==
91 VisitorMarkingMode::GlobalMarkingWithCompaction);
92 toDerived()->heap().registerMovingObjectReference(slot);
93 }
94
95 inline void registerMovingObjectCallback(MovableReference reference,
96 MovingObjectCallback callback,
97 void* callbackData) {
98 DCHECK(toDerived()->getMarkingMode() ==
99 VisitorMarkingMode::GlobalMarkingWithCompaction);
100 toDerived()->heap().registerMovingObjectCallback(reference, callback,
101 callbackData);
102 }
103
104 inline bool ensureMarked(const void* objectPointer) { 89 inline bool ensureMarked(const void* objectPointer) {
105 if (!objectPointer) 90 if (!objectPointer)
106 return false; 91 return false;
107 92
108 HeapObjectHeader* header = HeapObjectHeader::fromPayload(objectPointer); 93 HeapObjectHeader* header = HeapObjectHeader::fromPayload(objectPointer);
109 if (header->isMarked()) 94 if (header->isMarked())
110 return false; 95 return false;
111 #if DCHECK_IS_ON() 96 #if DCHECK_IS_ON()
112 toDerived()->markNoTracing(objectPointer); 97 toDerived()->markNoTracing(objectPointer);
113 #else 98 #else
(...skipping 16 matching lines...) Expand all
130 115
131 private: 116 private:
132 static void markNoTracingCallback(Visitor* visitor, void* object) { 117 static void markNoTracingCallback(Visitor* visitor, void* object) {
133 visitor->markNoTracing(object); 118 visitor->markNoTracing(object);
134 } 119 }
135 }; 120 };
136 121
137 } // namespace blink 122 } // namespace blink
138 123
139 #endif 124 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/heap/MarkingVisitor.h ('k') | third_party/WebKit/Source/platform/heap/SparseHeapBitmap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698