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

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

Issue 2570483002: Revert of Simple BlinkGC heap compaction. (Closed)
Patch Set: 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->isGlobalMarking()) { 234 if (visitor->getMarkingMode() == Visitor::GlobalMarking) {
235 // Switch to inlined global marking dispatch. 235 // Switch to inlined global marking dispatch.
236 static_cast<T*>(self)->trace(InlinedGlobalMarkingVisitor( 236 static_cast<T*>(self)->trace(InlinedGlobalMarkingVisitor(visitor->state()));
237 visitor->state(), visitor->getMarkingMode()));
238 } else { 237 } else {
239 static_cast<T*>(self)->trace(visitor); 238 static_cast<T*>(self)->trace(visitor);
240 } 239 }
241 } 240 }
242 241
243 template <typename T> 242 template <typename T>
244 void TraceTrait<T>::trace(InlinedGlobalMarkingVisitor visitor, void* self) { 243 void TraceTrait<T>::trace(InlinedGlobalMarkingVisitor visitor, void* self) {
245 static_assert(WTF::IsTraceable<T>::value, "T should not be traced"); 244 static_assert(WTF::IsTraceable<T>::value, "T should not be traced");
246 static_cast<T*>(self)->trace(visitor); 245 static_cast<T*>(self)->trace(visitor);
247 } 246 }
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after
772 // since iterating over the hash table backing will find the whole 771 // since iterating over the hash table backing will find the whole
773 // chain. 772 // chain.
774 visitor->markNoTracing(node); 773 visitor->markNoTracing(node);
775 return false; 774 return false;
776 } 775 }
777 }; 776 };
778 777
779 } // namespace WTF 778 } // namespace WTF
780 779
781 #endif 780 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/heap/ThreadState.cpp ('k') | third_party/WebKit/Source/platform/heap/Visitor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698