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

Side by Side Diff: third_party/WebKit/Source/platform/heap/TraceTraits.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 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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 AdjustAndMarkTrait<T>::mark(visitor, t); 224 AdjustAndMarkTrait<T>::mark(visitor, t);
225 } 225 }
226 }; 226 };
227 227
228 template <typename T> 228 template <typename T>
229 class TraceTrait<const T> : public TraceTrait<T> {}; 229 class TraceTrait<const T> : public TraceTrait<T> {};
230 230
231 template <typename T> 231 template <typename T>
232 void TraceTrait<T>::trace(Visitor* visitor, void* self) { 232 void TraceTrait<T>::trace(Visitor* visitor, void* self) {
233 static_assert(WTF::IsTraceable<T>::value, "T should not be traced"); 233 static_assert(WTF::IsTraceable<T>::value, "T should not be traced");
234 if (visitor->getMarkingMode() == Visitor::GlobalMarking) { 234 if (visitor->isGlobalMarking()) {
235 // Switch to inlined global marking dispatch. 235 // Switch to inlined global marking dispatch.
236 static_cast<T*>(self)->trace(InlinedGlobalMarkingVisitor(visitor->state())); 236 static_cast<T*>(self)->trace(InlinedGlobalMarkingVisitor(
237 visitor->state(), visitor->getMarkingMode()));
237 } else { 238 } else {
238 static_cast<T*>(self)->trace(visitor); 239 static_cast<T*>(self)->trace(visitor);
239 } 240 }
240 } 241 }
241 242
242 template <typename T> 243 template <typename T>
243 void TraceTrait<T>::trace(InlinedGlobalMarkingVisitor visitor, void* self) { 244 void TraceTrait<T>::trace(InlinedGlobalMarkingVisitor visitor, void* self) {
244 static_assert(WTF::IsTraceable<T>::value, "T should not be traced"); 245 static_assert(WTF::IsTraceable<T>::value, "T should not be traced");
245 static_cast<T*>(self)->trace(visitor); 246 static_cast<T*>(self)->trace(visitor);
246 } 247 }
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after
771 // since iterating over the hash table backing will find the whole 772 // since iterating over the hash table backing will find the whole
772 // chain. 773 // chain.
773 visitor->markNoTracing(node); 774 visitor->markNoTracing(node);
774 return false; 775 return false;
775 } 776 }
776 }; 777 };
777 778
778 } // namespace WTF 779 } // namespace WTF
779 780
780 #endif 781 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698