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

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

Issue 2531973002: Simple BlinkGC heap compaction. (Closed)
Patch Set: synchronize on compaction finish 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 TraceTraits_h 5 #ifndef TraceTraits_h
6 #define TraceTraits_h 6 #define TraceTraits_h
7 7
8 #include "platform/heap/GCInfo.h" 8 #include "platform/heap/GCInfo.h"
9 #include "platform/heap/Heap.h" 9 #include "platform/heap/Heap.h"
10 #include "platform/heap/InlinedGlobalMarkingVisitor.h" 10 #include "platform/heap/InlinedGlobalMarkingVisitor.h"
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 AdjustAndMarkTrait<T>::mark(visitor, t); 213 AdjustAndMarkTrait<T>::mark(visitor, t);
214 } 214 }
215 }; 215 };
216 216
217 template <typename T> 217 template <typename T>
218 class TraceTrait<const T> : public TraceTrait<T> {}; 218 class TraceTrait<const T> : public TraceTrait<T> {};
219 219
220 template <typename T> 220 template <typename T>
221 void TraceTrait<T>::trace(Visitor* visitor, void* self) { 221 void TraceTrait<T>::trace(Visitor* visitor, void* self) {
222 static_assert(WTF::IsTraceable<T>::value, "T should not be traced"); 222 static_assert(WTF::IsTraceable<T>::value, "T should not be traced");
223 if (visitor->getMarkingMode() == Visitor::GlobalMarking) { 223 if (visitor->isGlobalMarking()) {
224 // Switch to inlined global marking dispatch. 224 // Switch to inlined global marking dispatch.
225 static_cast<T*>(self)->trace(InlinedGlobalMarkingVisitor(visitor->state())); 225 static_cast<T*>(self)->trace(InlinedGlobalMarkingVisitor(
226 visitor->state(), visitor->getMarkingMode()));
226 } else { 227 } else {
227 static_cast<T*>(self)->trace(visitor); 228 static_cast<T*>(self)->trace(visitor);
228 } 229 }
229 } 230 }
230 231
231 template <typename T> 232 template <typename T>
232 void TraceTrait<T>::trace(InlinedGlobalMarkingVisitor visitor, void* self) { 233 void TraceTrait<T>::trace(InlinedGlobalMarkingVisitor visitor, void* self) {
233 static_assert(WTF::IsTraceable<T>::value, "T should not be traced"); 234 static_assert(WTF::IsTraceable<T>::value, "T should not be traced");
234 static_cast<T*>(self)->trace(visitor); 235 static_cast<T*>(self)->trace(visitor);
235 } 236 }
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after
760 // since iterating over the hash table backing will find the whole 761 // since iterating over the hash table backing will find the whole
761 // chain. 762 // chain.
762 visitor->markNoTracing(node); 763 visitor->markNoTracing(node);
763 return false; 764 return false;
764 } 765 }
765 }; 766 };
766 767
767 } // namespace WTF 768 } // namespace WTF
768 769
769 #endif 770 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698