| OLD | NEW |
| 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" |
| 11 #include "platform/heap/Visitor.h" | 11 #include "platform/heap/Visitor.h" |
| 12 #include "wtf/Assertions.h" | 12 #include "wtf/Assertions.h" |
| 13 #include "wtf/Deque.h" | 13 #include "wtf/Deque.h" |
| 14 #include "wtf/HashCountedSet.h" | 14 #include "wtf/HashCountedSet.h" |
| 15 #include "wtf/HashMap.h" | 15 #include "wtf/HashMap.h" |
| 16 #include "wtf/HashSet.h" | 16 #include "wtf/HashSet.h" |
| 17 #include "wtf/HashTable.h" | 17 #include "wtf/HashTable.h" |
| 18 #include "wtf/LinkedHashSet.h" | 18 #include "wtf/LinkedHashSet.h" |
| 19 #include "wtf/ListHashSet.h" | 19 #include "wtf/ListHashSet.h" |
| 20 #include "wtf/TypeTraits.h" | 20 #include "wtf/TypeTraits.h" |
| 21 #include "wtf/Vector.h" | 21 #include "wtf/Vector.h" |
| 22 | 22 |
| 23 namespace blink { | 23 namespace blink { |
| 24 | 24 |
| 25 template<typename T> class CrossThreadPersistent; | 25 template<typename T> class CrossThreadPersistent; |
| 26 template<typename T> class CrossThreadWeakPersistent; |
| 26 template<typename T> struct GCInfoTrait; | 27 template<typename T> struct GCInfoTrait; |
| 27 class HeapObjectHeader; | 28 class HeapObjectHeader; |
| 28 template<typename T> class Member; | 29 template<typename T> class Member; |
| 29 template<typename T> class TraceTrait; | 30 template<typename T> class TraceTrait; |
| 30 template<typename T> class WeakMember; | 31 template<typename T> class WeakMember; |
| 32 template<typename T> class WeakPersistent; |
| 31 | 33 |
| 32 template<typename T, bool = NeedsAdjustAndMark<T>::value> class AdjustAndMarkTra
it; | 34 template<typename T, bool = NeedsAdjustAndMark<T>::value> class AdjustAndMarkTra
it; |
| 33 | 35 |
| 34 template<typename T> | 36 template<typename T> |
| 35 class AdjustAndMarkTrait<T, false> { | 37 class AdjustAndMarkTrait<T, false> { |
| 36 public: | 38 public: |
| 37 template<typename VisitorDispatcher> | 39 template<typename VisitorDispatcher> |
| 38 static void mark(VisitorDispatcher visitor, const T* t) | 40 static void mark(VisitorDispatcher visitor, const T* t) |
| 39 { | 41 { |
| 40 #if ENABLE(ASSERT) | 42 #if ENABLE(ASSERT) |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 static const bool value = TraceEagerlyTrait<T>::value; | 281 static const bool value = TraceEagerlyTrait<T>::value; |
| 280 }; | 282 }; |
| 281 | 283 |
| 282 template<typename T> | 284 template<typename T> |
| 283 class TraceEagerlyTrait<Persistent<T>> { | 285 class TraceEagerlyTrait<Persistent<T>> { |
| 284 public: | 286 public: |
| 285 static const bool value = TraceEagerlyTrait<T>::value; | 287 static const bool value = TraceEagerlyTrait<T>::value; |
| 286 }; | 288 }; |
| 287 | 289 |
| 288 template<typename T> | 290 template<typename T> |
| 291 class TraceEagerlyTrait<WeakPersistent<T>> { |
| 292 public: |
| 293 static const bool value = TraceEagerlyTrait<T>::value; |
| 294 }; |
| 295 |
| 296 template<typename T> |
| 289 class TraceEagerlyTrait<CrossThreadPersistent<T>> { | 297 class TraceEagerlyTrait<CrossThreadPersistent<T>> { |
| 290 public: | 298 public: |
| 291 static const bool value = TraceEagerlyTrait<T>::value; | 299 static const bool value = TraceEagerlyTrait<T>::value; |
| 292 }; | 300 }; |
| 293 | 301 |
| 302 template<typename T> |
| 303 class TraceEagerlyTrait<CrossThreadWeakPersistent<T>> { |
| 304 public: |
| 305 static const bool value = TraceEagerlyTrait<T>::value; |
| 306 }; |
| 307 |
| 294 template<typename ValueArg, size_t inlineCapacity> class HeapListHashSetAllocato
r; | 308 template<typename ValueArg, size_t inlineCapacity> class HeapListHashSetAllocato
r; |
| 295 template<typename T, size_t inlineCapacity> | 309 template<typename T, size_t inlineCapacity> |
| 296 class TraceEagerlyTrait<WTF::ListHashSetNode<T, HeapListHashSetAllocator<T, inli
neCapacity>>> { | 310 class TraceEagerlyTrait<WTF::ListHashSetNode<T, HeapListHashSetAllocator<T, inli
neCapacity>>> { |
| 297 public: | 311 public: |
| 298 static const bool value = false; | 312 static const bool value = false; |
| 299 }; | 313 }; |
| 300 | 314 |
| 301 template <typename T> struct RemoveHeapPointerWrapperTypes { | 315 template <typename T> struct RemoveHeapPointerWrapperTypes { |
| 302 using Type = typename WTF::RemoveTemplate<typename WTF::RemoveTemplate<typen
ame WTF::RemoveTemplate<T, Member>::Type, WeakMember>::Type, RawPtr>::Type; | 316 using Type = typename WTF::RemoveTemplate<typename WTF::RemoveTemplate<typen
ame WTF::RemoveTemplate<T, Member>::Type, WeakMember>::Type, RawPtr>::Type; |
| 303 }; | 317 }; |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 541 // since iterating over the hash table backing will find the whole | 555 // since iterating over the hash table backing will find the whole |
| 542 // chain. | 556 // chain. |
| 543 visitor->markNoTracing(node); | 557 visitor->markNoTracing(node); |
| 544 return false; | 558 return false; |
| 545 } | 559 } |
| 546 }; | 560 }; |
| 547 | 561 |
| 548 } // namespace WTF | 562 } // namespace WTF |
| 549 | 563 |
| 550 #endif | 564 #endif |
| OLD | NEW |