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 GCInfo_h | 5 #ifndef GCInfo_h |
6 #define GCInfo_h | 6 #define GCInfo_h |
7 | 7 |
8 #include "platform/heap/Visitor.h" | 8 #include "platform/heap/Visitor.h" |
9 #include "platform/wtf/Allocator.h" | 9 #include "platform/wtf/Allocator.h" |
10 #include "platform/wtf/Assertions.h" | 10 #include "platform/wtf/Assertions.h" |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 struct GCInfoAtBaseType { | 191 struct GCInfoAtBaseType { |
192 STATIC_ONLY(GCInfoAtBaseType); | 192 STATIC_ONLY(GCInfoAtBaseType); |
193 static size_t Index() { | 193 static size_t Index() { |
194 static_assert(sizeof(T), "T must be fully defined"); | 194 static_assert(sizeof(T), "T must be fully defined"); |
195 static const GCInfo kGcInfo = { | 195 static const GCInfo kGcInfo = { |
196 TraceTrait<T>::Trace, FinalizerTrait<T>::Finalize, | 196 TraceTrait<T>::Trace, FinalizerTrait<T>::Finalize, |
197 FinalizerTrait<T>::kNonTrivialFinalizer, std::is_polymorphic<T>::value, | 197 FinalizerTrait<T>::kNonTrivialFinalizer, std::is_polymorphic<T>::value, |
198 }; | 198 }; |
199 | 199 |
200 static size_t gc_info_index = 0; | 200 static size_t gc_info_index = 0; |
201 ASSERT(g_gc_info_table); | 201 DCHECK(g_gc_info_table); |
202 if (!AcquireLoad(&gc_info_index)) | 202 if (!AcquireLoad(&gc_info_index)) |
203 GCInfoTable::EnsureGCInfoIndex(&kGcInfo, &gc_info_index); | 203 GCInfoTable::EnsureGCInfoIndex(&kGcInfo, &gc_info_index); |
204 ASSERT(gc_info_index >= 1); | 204 DCHECK_GE(gc_info_index, 1u); |
205 ASSERT(gc_info_index < GCInfoTable::kMaxIndex); | 205 DCHECK(gc_info_index < GCInfoTable::kMaxIndex); |
206 return gc_info_index; | 206 return gc_info_index; |
207 } | 207 } |
208 }; | 208 }; |
209 | 209 |
210 template <typename T, | 210 template <typename T, |
211 bool = WTF::IsSubclassOfTemplate<typename std::remove_const<T>::type, | 211 bool = WTF::IsSubclassOfTemplate<typename std::remove_const<T>::type, |
212 GarbageCollected>::value> | 212 GarbageCollected>::value> |
213 struct GetGarbageCollectedType; | 213 struct GetGarbageCollectedType; |
214 | 214 |
215 template <typename T> | 215 template <typename T> |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 template <typename T, size_t inlineCapacity> | 272 template <typename T, size_t inlineCapacity> |
273 struct GCInfoTrait<HeapDeque<T, inlineCapacity>> | 273 struct GCInfoTrait<HeapDeque<T, inlineCapacity>> |
274 : public GCInfoTrait<Deque<T, inlineCapacity, HeapAllocator>> {}; | 274 : public GCInfoTrait<Deque<T, inlineCapacity, HeapAllocator>> {}; |
275 template <typename T, typename U, typename V> | 275 template <typename T, typename U, typename V> |
276 struct GCInfoTrait<HeapHashCountedSet<T, U, V>> | 276 struct GCInfoTrait<HeapHashCountedSet<T, U, V>> |
277 : public GCInfoTrait<HashCountedSet<T, U, V, HeapAllocator>> {}; | 277 : public GCInfoTrait<HashCountedSet<T, U, V, HeapAllocator>> {}; |
278 | 278 |
279 } // namespace blink | 279 } // namespace blink |
280 | 280 |
281 #endif | 281 #endif |
OLD | NEW |