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

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

Issue 2531973002: Simple BlinkGC heap compaction. (Closed)
Patch Set: Clear unused pages before decommitting Created 4 years 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 toDerived()->heap().registerWeakTable( 81 toDerived()->heap().registerWeakTable(
82 const_cast<void*>(closure), iterationCallback, iterationDoneCallback); 82 const_cast<void*>(closure), iterationCallback, iterationDoneCallback);
83 } 83 }
84 84
85 #if ENABLE(ASSERT) 85 #if ENABLE(ASSERT)
86 inline bool weakTableRegistered(const void* closure) { 86 inline bool weakTableRegistered(const void* closure) {
87 return toDerived()->heap().weakTableRegistered(closure); 87 return toDerived()->heap().weakTableRegistered(closure);
88 } 88 }
89 #endif 89 #endif
90 90
91 inline void registerMovingObjectReference(MovableReference* slot) {
92 if (toDerived()->getMarkingMode() != Visitor::GlobalMarkingWithCompaction)
93 return;
94 toDerived()->heap().registerMovingObjectReference(slot);
95 }
96
97 inline void registerMovingObjectCallback(MovableReference reference,
98 MovingObjectCallback callback,
99 void* callbackData) {
100 if (toDerived()->getMarkingMode() != Visitor::GlobalMarkingWithCompaction)
101 return;
102 toDerived()->heap().registerMovingObjectCallback(reference, callback,
103 callbackData);
104 }
105
91 inline bool ensureMarked(const void* objectPointer) { 106 inline bool ensureMarked(const void* objectPointer) {
92 if (!objectPointer) 107 if (!objectPointer)
93 return false; 108 return false;
94 if (!toDerived()->shouldMarkObject(objectPointer)) 109 if (!toDerived()->shouldMarkObject(objectPointer))
95 return false; 110 return false;
96 #if ENABLE(ASSERT) 111 #if ENABLE(ASSERT)
97 if (HeapObjectHeader::fromPayload(objectPointer)->isMarked()) 112 if (HeapObjectHeader::fromPayload(objectPointer)->isMarked())
98 return false; 113 return false;
99 114
100 toDerived()->markNoTracing(objectPointer); 115 toDerived()->markNoTracing(objectPointer);
(...skipping 20 matching lines...) Expand all
121 136
122 private: 137 private:
123 static void markNoTracingCallback(Visitor* visitor, void* object) { 138 static void markNoTracingCallback(Visitor* visitor, void* object) {
124 visitor->markNoTracing(object); 139 visitor->markNoTracing(object);
125 } 140 }
126 }; 141 };
127 142
128 } // namespace blink 143 } // namespace blink
129 144
130 #endif 145 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698