| Index: Source/platform/heap/Visitor.h
|
| diff --git a/Source/platform/heap/Visitor.h b/Source/platform/heap/Visitor.h
|
| index 3e9d21891861c322483c6dd58d7a454152b75d2e..dce9d8f9acecbd26be562597e4b731c828376206 100644
|
| --- a/Source/platform/heap/Visitor.h
|
| +++ b/Source/platform/heap/Visitor.h
|
| @@ -63,8 +63,37 @@ class HeapObjectHeader;
|
| class InlinedGlobalMarkingVisitor;
|
| template<typename T> class Member;
|
| template<typename T> class WeakMember;
|
| +template<typename ValueArg, size_t inlineCapacity> struct HeapListHashSetAllocator;
|
| class Visitor;
|
|
|
| +} // namespace blink
|
| +
|
| +namespace WTF {
|
| +
|
| +template<typename ValueArg, typename Allocator> class ListHashSetNode;
|
| +
|
| +template<typename T>
|
| +struct NeedsTracing<blink::Member<T>> {
|
| + static const bool value = true;
|
| +};
|
| +
|
| +template<typename T>
|
| +struct IsWeak<blink::WeakMember<T>> {
|
| + static const bool value = true;
|
| +};
|
| +
|
| +template<typename T, size_t inlineCapacity>
|
| +struct NeedsTracing<ListHashSetNode<T, blink::HeapListHashSetAllocator<T, inlineCapacity>> *> {
|
| + // All heap allocated node pointers need visiting to keep the nodes alive,
|
| + // regardless of whether they contain pointers to other heap allocated
|
| + // objects.
|
| + static const bool value = true;
|
| +};
|
| +
|
| +} // namespace WTF
|
| +
|
| +namespace blink {
|
| +
|
| template <typename T> struct IsGarbageCollectedType;
|
| #define STATIC_ASSERT_IS_GARBAGE_COLLECTED(T, ErrorMessage) \
|
| static_assert(IsGarbageCollectedType<T>::value, ErrorMessage)
|
| @@ -180,7 +209,7 @@ public:
|
| static const bool value = true;
|
| };
|
|
|
| -template <typename T, bool = HasInlinedTraceMethod<T>::value>
|
| +template <typename T, bool needsTracing, bool = HasInlinedTraceMethod<T>::value>
|
| struct TraceCompatibilityAdaptor;
|
|
|
| // The TraceTrait is used to specify how to mark an object pointer and
|
| @@ -196,13 +225,14 @@ struct TraceCompatibilityAdaptor;
|
| // that case the pointer has to be adjusted before marking.
|
| template<typename T>
|
| class TraceTrait {
|
| + static const bool needsTracing = WTF::NeedsTracing<T>::value || WTF::IsWeak<T>::value;
|
| public:
|
| // Default implementation of TraceTrait<T>::trace just statically
|
| // dispatches to the trace method of the class T.
|
| template<typename VisitorDispatcher>
|
| static void trace(VisitorDispatcher visitor, void* self)
|
| {
|
| - TraceCompatibilityAdaptor<T>::trace(visitor, static_cast<T*>(self));
|
| + TraceCompatibilityAdaptor<T, needsTracing>::trace(visitor, static_cast<T*>(self));
|
| }
|
|
|
| template<typename VisitorDispatcher>
|
|
|