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

Side by Side Diff: Source/platform/heap/Handle.h

Issue 260713004: Add HeapHashCountedSet (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix nit Created 6 years, 7 months 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/platform/heap/Heap.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2014 Google Inc. All rights reserved. 2 * Copyright (C) 2014 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 #define COMPILE_ASSERT_IS_GARBAGE_COLLECTED(T, ErrorMessage) \ 71 #define COMPILE_ASSERT_IS_GARBAGE_COLLECTED(T, ErrorMessage) \
72 do { \ 72 do { \
73 typedef typename WTF::RemoveConst<T>::Type NonConstType; \ 73 typedef typename WTF::RemoveConst<T>::Type NonConstType; \
74 typedef WTF::IsSubclassOfTemplate<NonConstType, GarbageCollected> Garbag eCollectedSubclass; \ 74 typedef WTF::IsSubclassOfTemplate<NonConstType, GarbageCollected> Garbag eCollectedSubclass; \
75 typedef IsGarbageCollectedMixin<NonConstType> GarbageCollectedMixinSubcl ass; \ 75 typedef IsGarbageCollectedMixin<NonConstType> GarbageCollectedMixinSubcl ass; \
76 typedef WTF::IsSubclassOfTemplate3<NonConstType, HeapHashSet> HeapHashSe tSubclass; \ 76 typedef WTF::IsSubclassOfTemplate3<NonConstType, HeapHashSet> HeapHashSe tSubclass; \
77 typedef WTF::IsSubclassOfTemplate3<NonConstType, HeapLinkedHashSet> Heap LinkedHashSetSubclass; \ 77 typedef WTF::IsSubclassOfTemplate3<NonConstType, HeapLinkedHashSet> Heap LinkedHashSetSubclass; \
78 typedef WTF::IsSubclassOfTemplate5<NonConstType, HeapHashMap> HeapHashMa pSubclass; \ 78 typedef WTF::IsSubclassOfTemplate5<NonConstType, HeapHashMap> HeapHashMa pSubclass; \
79 typedef WTF::IsSubclassOfTemplateTypenameSize<NonConstType, HeapVector> HeapVectorSubclass; \ 79 typedef WTF::IsSubclassOfTemplateTypenameSize<NonConstType, HeapVector> HeapVectorSubclass; \
80 typedef WTF::IsSubclassOfTemplateTypenameSize<NonConstType, HeapDeque> H eapDequeSubclass; \ 80 typedef WTF::IsSubclassOfTemplateTypenameSize<NonConstType, HeapDeque> H eapDequeSubclass; \
81 typedef WTF::IsSubclassOfTemplate3<NonConstType, HeapHashCountedSet> Hea pHashCountedSetSubclass; \
81 typedef WTF::IsSubclassOfTemplate<NonConstType, HeapTerminatedArray> Hea pTerminatedArraySubclass; \ 82 typedef WTF::IsSubclassOfTemplate<NonConstType, HeapTerminatedArray> Hea pTerminatedArraySubclass; \
82 COMPILE_ASSERT(GarbageCollectedSubclass::value || \ 83 COMPILE_ASSERT(GarbageCollectedSubclass::value || \
83 GarbageCollectedMixinSubclass::value || \ 84 GarbageCollectedMixinSubclass::value || \
84 HeapHashSetSubclass::value || \ 85 HeapHashSetSubclass::value || \
85 HeapLinkedHashSetSubclass::value || \ 86 HeapLinkedHashSetSubclass::value || \
86 HeapHashMapSubclass::value || \ 87 HeapHashMapSubclass::value || \
87 HeapVectorSubclass::value || \ 88 HeapVectorSubclass::value || \
88 HeapDequeSubclass::value || \ 89 HeapDequeSubclass::value || \
90 HeapHashCountedSetSubclass::value || \
89 HeapTerminatedArraySubclass::value, \ 91 HeapTerminatedArraySubclass::value, \
90 ErrorMessage); \ 92 ErrorMessage); \
91 } while (0) 93 } while (0)
92 94
93 template<typename T> class Member; 95 template<typename T> class Member;
94 96
95 class PersistentNode { 97 class PersistentNode {
96 public: 98 public:
97 explicit PersistentNode(TraceCallback trace) 99 explicit PersistentNode(TraceCallback trace)
98 : m_trace(trace) 100 : m_trace(trace)
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 typename HashArg = typename DefaultHash<ValueArg>::Hash, 435 typename HashArg = typename DefaultHash<ValueArg>::Hash,
434 typename TraitsArg = HashTraits<ValueArg> > 436 typename TraitsArg = HashTraits<ValueArg> >
435 class PersistentHeapHashSet : public PersistentHeapCollectionBase<HeapHashSet<Va lueArg, HashArg, TraitsArg> > { }; 437 class PersistentHeapHashSet : public PersistentHeapCollectionBase<HeapHashSet<Va lueArg, HashArg, TraitsArg> > { };
436 438
437 template< 439 template<
438 typename ValueArg, 440 typename ValueArg,
439 typename HashArg = typename DefaultHash<ValueArg>::Hash, 441 typename HashArg = typename DefaultHash<ValueArg>::Hash,
440 typename TraitsArg = HashTraits<ValueArg> > 442 typename TraitsArg = HashTraits<ValueArg> >
441 class PersistentHeapLinkedHashSet : public PersistentHeapCollectionBase<HeapLink edHashSet<ValueArg, HashArg, TraitsArg> > { }; 443 class PersistentHeapLinkedHashSet : public PersistentHeapCollectionBase<HeapLink edHashSet<ValueArg, HashArg, TraitsArg> > { };
442 444
445 template<typename T, typename U, typename V>
446 class PersistentHeapHashCountedSet : public PersistentHeapCollectionBase<HeapHas hCountedSet<T, U, V> > { };
447
443 template<typename T, size_t inlineCapacity = 0> 448 template<typename T, size_t inlineCapacity = 0>
444 class PersistentHeapVector : public PersistentHeapCollectionBase<HeapVector<T, i nlineCapacity> > { 449 class PersistentHeapVector : public PersistentHeapCollectionBase<HeapVector<T, i nlineCapacity> > {
445 public: 450 public:
446 PersistentHeapVector() { } 451 PersistentHeapVector() { }
447 452
448 template<size_t otherCapacity> 453 template<size_t otherCapacity>
449 PersistentHeapVector(const HeapVector<T, otherCapacity>& other) 454 PersistentHeapVector(const HeapVector<T, otherCapacity>& other)
450 : PersistentHeapCollectionBase<HeapVector<T, inlineCapacity> >(other) 455 : PersistentHeapCollectionBase<HeapVector<T, inlineCapacity> >(other)
451 { 456 {
452 } 457 }
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
760 #define WillBeHeapHashMap WebCore::HeapHashMap 765 #define WillBeHeapHashMap WebCore::HeapHashMap
761 #define WillBePersistentHeapHashMap WebCore::PersistentHeapHashMap 766 #define WillBePersistentHeapHashMap WebCore::PersistentHeapHashMap
762 #define WillBeHeapHashSet WebCore::HeapHashSet 767 #define WillBeHeapHashSet WebCore::HeapHashSet
763 #define WillBePersistentHeapHashSet WebCore::PersistentHeapHashSet 768 #define WillBePersistentHeapHashSet WebCore::PersistentHeapHashSet
764 #define WillBeHeapLinkedHashSet WebCore::HeapLinkedHashSet 769 #define WillBeHeapLinkedHashSet WebCore::HeapLinkedHashSet
765 #define WillBePersistentHeapLinkedHashSet WebCore::PersistentHeapLinkedHashSet 770 #define WillBePersistentHeapLinkedHashSet WebCore::PersistentHeapLinkedHashSet
766 #define WillBeHeapVector WebCore::HeapVector 771 #define WillBeHeapVector WebCore::HeapVector
767 #define WillBePersistentHeapVector WebCore::PersistentHeapVector 772 #define WillBePersistentHeapVector WebCore::PersistentHeapVector
768 #define WillBeHeapDeque WebCore::HeapDeque 773 #define WillBeHeapDeque WebCore::HeapDeque
769 #define WillBePersistentHeapDeque WebCore::PersistentHeapDeque 774 #define WillBePersistentHeapDeque WebCore::PersistentHeapDeque
775 #define WillBeHeapHashCountedSet WebCore::HeapHashCountedSet
776 #define WillBePersistentHeapHashCountedSet WebCore::PersistentHeapHashCountedSet
770 #define WillBeGarbageCollectedMixin WebCore::GarbageCollectedMixin 777 #define WillBeGarbageCollectedMixin WebCore::GarbageCollectedMixin
771 #define WillBeHeapSupplement WebCore::HeapSupplement 778 #define WillBeHeapSupplement WebCore::HeapSupplement
772 #define WillBeHeapSupplementable WebCore::HeapSupplementable 779 #define WillBeHeapSupplementable WebCore::HeapSupplementable
773 #define WillBeHeapTerminatedArray WebCore::HeapTerminatedArray 780 #define WillBeHeapTerminatedArray WebCore::HeapTerminatedArray
774 #define WillBeHeapTerminatedArrayBuilder WebCore::HeapTerminatedArrayBuilder 781 #define WillBeHeapTerminatedArrayBuilder WebCore::HeapTerminatedArrayBuilder
775 #define WillBeHeapLinkedStack WebCore::HeapLinkedStack 782 #define WillBeHeapLinkedStack WebCore::HeapLinkedStack
776 783
777 template<typename T> PassRefPtrWillBeRawPtr<T> adoptRefWillBeNoop(T* ptr) 784 template<typename T> PassRefPtrWillBeRawPtr<T> adoptRefWillBeNoop(T* ptr)
778 { 785 {
779 static const bool notRefCountedGarbageCollected = !WTF::IsSubclassOfTemplate <T, RefCountedGarbageCollected>::value; 786 static const bool notRefCountedGarbageCollected = !WTF::IsSubclassOfTemplate <T, RefCountedGarbageCollected>::value;
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
838 #define WillBeHeapHashMap WTF::HashMap 845 #define WillBeHeapHashMap WTF::HashMap
839 #define WillBePersistentHeapHashMap WTF::HashMap 846 #define WillBePersistentHeapHashMap WTF::HashMap
840 #define WillBeHeapHashSet WTF::HashSet 847 #define WillBeHeapHashSet WTF::HashSet
841 #define WillBePersistentHeapHashSet WTF::HashSet 848 #define WillBePersistentHeapHashSet WTF::HashSet
842 #define WillBeHeapLinkedHashSet WTF::LinkedHashSet 849 #define WillBeHeapLinkedHashSet WTF::LinkedHashSet
843 #define WillBePersistentLinkedHeapHashSet WTF::LinkedHashSet 850 #define WillBePersistentLinkedHeapHashSet WTF::LinkedHashSet
844 #define WillBeHeapVector WTF::Vector 851 #define WillBeHeapVector WTF::Vector
845 #define WillBePersistentHeapVector WTF::Vector 852 #define WillBePersistentHeapVector WTF::Vector
846 #define WillBeHeapDeque WTF::Deque 853 #define WillBeHeapDeque WTF::Deque
847 #define WillBePersistentHeapDeque WTF::Deque 854 #define WillBePersistentHeapDeque WTF::Deque
855 #define WillBeHeapHeapCountedSet WTF::HeapCountedSet
856 #define WillBePersistentHeapHeapCountedSet WTF::HeapCountedSet
848 #define WillBeGarbageCollectedMixin WebCore::DummyBase<void> 857 #define WillBeGarbageCollectedMixin WebCore::DummyBase<void>
849 #define WillBeHeapSupplement WebCore::Supplement 858 #define WillBeHeapSupplement WebCore::Supplement
850 #define WillBeHeapSupplementable WebCore::Supplementable 859 #define WillBeHeapSupplementable WebCore::Supplementable
851 #define WillBeHeapTerminatedArray WTF::TerminatedArray 860 #define WillBeHeapTerminatedArray WTF::TerminatedArray
852 #define WillBeHeapTerminatedArrayBuilder WTF::TerminatedArrayBuilder 861 #define WillBeHeapTerminatedArrayBuilder WTF::TerminatedArrayBuilder
853 #define WillBeHeapLinkedStack WTF::LinkedStack 862 #define WillBeHeapLinkedStack WTF::LinkedStack
854 863
855 template<typename T> PassRefPtrWillBeRawPtr<T> adoptRefWillBeNoop(T* ptr) { retu rn adoptRef(ptr); } 864 template<typename T> PassRefPtrWillBeRawPtr<T> adoptRefWillBeNoop(T* ptr) { retu rn adoptRef(ptr); }
856 template<typename T> PassRefPtrWillBeRawPtr<T> adoptRefWillBeRefCountedGarbageCo llected(T* ptr) { return adoptRef(ptr); } 865 template<typename T> PassRefPtrWillBeRawPtr<T> adoptRefWillBeRefCountedGarbageCo llected(T* ptr) { return adoptRef(ptr); }
857 template<typename T> PassOwnPtrWillBeRawPtr<T> adoptPtrWillBeNoop(T* ptr) { retu rn adoptPtr(ptr); } 866 template<typename T> PassOwnPtrWillBeRawPtr<T> adoptPtrWillBeNoop(T* ptr) { retu rn adoptPtr(ptr); }
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
1035 struct NeedsTracing<Vector<T, N> > { 1044 struct NeedsTracing<Vector<T, N> > {
1036 static const bool value = false; 1045 static const bool value = false;
1037 }; 1046 };
1038 1047
1039 template<typename T, size_t N> 1048 template<typename T, size_t N>
1040 struct NeedsTracing<Deque<T, N> > { 1049 struct NeedsTracing<Deque<T, N> > {
1041 static const bool value = false; 1050 static const bool value = false;
1042 }; 1051 };
1043 1052
1044 template<typename T, typename U, typename V> 1053 template<typename T, typename U, typename V>
1054 struct NeedsTracing<HashCountedSet<T, U, V> > {
1055 static const bool value = false;
1056 };
1057
1058 template<typename T, typename U, typename V>
1045 struct NeedsTracing<HashSet<T, U, V> > { 1059 struct NeedsTracing<HashSet<T, U, V> > {
1046 static const bool value = false; 1060 static const bool value = false;
1047 }; 1061 };
1048 1062
1049 template<typename T, size_t U, typename V> 1063 template<typename T, size_t U, typename V>
1050 struct NeedsTracing<ListHashSet<T, U, V> > { 1064 struct NeedsTracing<ListHashSet<T, U, V> > {
1051 static const bool value = false; 1065 static const bool value = false;
1052 }; 1066 };
1053 1067
1054 template<typename T, typename U, typename V> 1068 template<typename T, typename U, typename V>
1055 struct NeedsTracing<LinkedHashSet<T, U, V> > { 1069 struct NeedsTracing<LinkedHashSet<T, U, V> > {
1056 static const bool value = false; 1070 static const bool value = false;
1057 }; 1071 };
1058 1072
1059 template<typename T, typename U, typename V, typename W, typename X> 1073 template<typename T, typename U, typename V, typename W, typename X>
1060 struct NeedsTracing<HashMap<T, U, V, W, X> > { 1074 struct NeedsTracing<HashMap<T, U, V, W, X> > {
1061 static const bool value = false; 1075 static const bool value = false;
1062 }; 1076 };
1063 1077
1064 } // namespace WTF 1078 } // namespace WTF
1065 1079
1066 #endif 1080 #endif
OLDNEW
« no previous file with comments | « no previous file | Source/platform/heap/Heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698