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

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

Issue 2645873002: Adjust placement of non-compaction checks. (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/heap/Visitor.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 const_cast<void*>(closure), iterationCallback, iterationDoneCallback); 80 const_cast<void*>(closure), iterationCallback, iterationDoneCallback);
81 } 81 }
82 82
83 #if ENABLE(ASSERT) 83 #if ENABLE(ASSERT)
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) { 89 inline void registerMovingObjectReference(MovableReference* slot) {
90 if (toDerived()->getMarkingMode() != 90 DCHECK(toDerived()->getMarkingMode() ==
91 VisitorMarkingMode::GlobalMarkingWithCompaction) 91 VisitorMarkingMode::GlobalMarkingWithCompaction);
92 return;
93 toDerived()->heap().registerMovingObjectReference(slot); 92 toDerived()->heap().registerMovingObjectReference(slot);
94 } 93 }
95 94
96 inline void registerMovingObjectCallback(MovableReference reference, 95 inline void registerMovingObjectCallback(MovableReference reference,
97 MovingObjectCallback callback, 96 MovingObjectCallback callback,
98 void* callbackData) { 97 void* callbackData) {
99 if (toDerived()->getMarkingMode() != 98 DCHECK(toDerived()->getMarkingMode() ==
100 VisitorMarkingMode::GlobalMarkingWithCompaction) 99 VisitorMarkingMode::GlobalMarkingWithCompaction);
101 return;
102 toDerived()->heap().registerMovingObjectCallback(reference, callback, 100 toDerived()->heap().registerMovingObjectCallback(reference, callback,
103 callbackData); 101 callbackData);
104 } 102 }
105 103
106 inline bool ensureMarked(const void* objectPointer) { 104 inline bool ensureMarked(const void* objectPointer) {
107 if (!objectPointer) 105 if (!objectPointer)
108 return false; 106 return false;
109 107
110 HeapObjectHeader* header = HeapObjectHeader::fromPayload(objectPointer); 108 HeapObjectHeader* header = HeapObjectHeader::fromPayload(objectPointer);
111 if (header->isMarked()) 109 if (header->isMarked())
(...skipping 20 matching lines...) Expand all
132 130
133 private: 131 private:
134 static void markNoTracingCallback(Visitor* visitor, void* object) { 132 static void markNoTracingCallback(Visitor* visitor, void* object) {
135 visitor->markNoTracing(object); 133 visitor->markNoTracing(object);
136 } 134 }
137 }; 135 };
138 136
139 } // namespace blink 137 } // namespace blink
140 138
141 #endif 139 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/heap/Visitor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698