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

Side by Side Diff: third_party/WebKit/Source/platform/heap/MarkingVisitor.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 MarkingVisitor_h 5 #ifndef MarkingVisitor_h
6 #define MarkingVisitor_h 6 #define MarkingVisitor_h
7 7
8 #include "platform/heap/MarkingVisitorImpl.h" 8 #include "platform/heap/MarkingVisitorImpl.h"
9 9
10 namespace blink { 10 namespace blink {
(...skipping 30 matching lines...) Expand all
41 EphemeronCallback iterationDoneCallback) { 41 EphemeronCallback iterationDoneCallback) {
42 Impl::registerWeakTable(closure, iterationCallback, iterationDoneCallback); 42 Impl::registerWeakTable(closure, iterationCallback, iterationDoneCallback);
43 } 43 }
44 44
45 #if ENABLE(ASSERT) 45 #if ENABLE(ASSERT)
46 virtual bool weakTableRegistered(const void* closure) { 46 virtual bool weakTableRegistered(const void* closure) {
47 return Impl::weakTableRegistered(closure); 47 return Impl::weakTableRegistered(closure);
48 } 48 }
49 #endif 49 #endif
50 50
51 void registerMovingObjectReference(MovableReference* slot) override {
52 Impl::registerMovingObjectReference(slot);
53 }
54
55 void registerMovingObjectCallback(MovableReference backingStore,
56 MovingObjectCallback callback,
57 void* callbackData) override {
58 Impl::registerMovingObjectCallback(backingStore, callback, callbackData);
59 }
60
51 bool ensureMarked(const void* objectPointer) override { 61 bool ensureMarked(const void* objectPointer) override {
52 return Impl::ensureMarked(objectPointer); 62 return Impl::ensureMarked(objectPointer);
53 } 63 }
54 64
55 void registerWeakCellWithCallback(void** cell, 65 void registerWeakCellWithCallback(void** cell,
56 WeakCallback callback) override { 66 WeakCallback callback) override {
57 Impl::registerWeakCellWithCallback(cell, callback); 67 Impl::registerWeakCellWithCallback(cell, callback);
58 } 68 }
59 69
60 protected: 70 protected:
61 inline bool shouldMarkObject(const void* objectPointer) const { 71 inline bool shouldMarkObject(const void* objectPointer) const {
62 if (Mode != ThreadLocalMarking) 72 if (Mode != ThreadLocalMarking)
63 return true; 73 return true;
64 74
65 BasePage* page = pageFromObject(objectPointer); 75 BasePage* page = pageFromObject(objectPointer);
66 ASSERT(!page->orphaned()); 76 ASSERT(!page->orphaned());
67 // When doing a thread local GC, the marker checks if 77 // When doing a thread local GC, the marker checks if
68 // the object resides in another thread's heap. If it 78 // the object resides in another thread's heap. If it
69 // does, the object should not be marked & traced. 79 // does, the object should not be marked & traced.
70 return page->terminating(); 80 return page->terminating();
71 } 81 }
72 }; 82 };
73 83
74 } // namespace blink 84 } // namespace blink
75 85
76 #endif 86 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698