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 "wtf/Assertions.h" | 9 #include "wtf/Assertions.h" |
10 #include "wtf/Atomics.h" | 10 #include "wtf/Atomics.h" |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 // for a given gcInfo. | 157 // for a given gcInfo. |
158 template<typename T> | 158 template<typename T> |
159 struct GCInfoAtBaseType { | 159 struct GCInfoAtBaseType { |
160 static size_t index() | 160 static size_t index() |
161 { | 161 { |
162 static_assert(sizeof(T), "T must be fully defined"); | 162 static_assert(sizeof(T), "T must be fully defined"); |
163 static const GCInfo gcInfo = { | 163 static const GCInfo gcInfo = { |
164 TraceTrait<T>::trace, | 164 TraceTrait<T>::trace, |
165 FinalizerTrait<T>::finalize, | 165 FinalizerTrait<T>::finalize, |
166 FinalizerTrait<T>::nonTrivialFinalizer, | 166 FinalizerTrait<T>::nonTrivialFinalizer, |
167 WTF::IsPolymorphic<T>::value, | 167 std::is_polymorphic<T>::value, |
168 #if ENABLE(DETAILED_MEMORY_INFRA) | 168 #if ENABLE(DETAILED_MEMORY_INFRA) |
169 TypenameStringTrait<T>::get | 169 TypenameStringTrait<T>::get |
170 #endif | 170 #endif |
171 }; | 171 }; |
172 | 172 |
173 static size_t gcInfoIndex = 0; | 173 static size_t gcInfoIndex = 0; |
174 ASSERT(s_gcInfoTable); | 174 ASSERT(s_gcInfoTable); |
175 if (!acquireLoad(&gcInfoIndex)) | 175 if (!acquireLoad(&gcInfoIndex)) |
176 GCInfoTable::ensureGCInfoIndex(&gcInfo, &gcInfoIndex); | 176 GCInfoTable::ensureGCInfoIndex(&gcInfo, &gcInfoIndex); |
177 ASSERT(gcInfoIndex >= 1); | 177 ASSERT(gcInfoIndex >= 1); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 template<typename T, size_t inlineCapacity> | 221 template<typename T, size_t inlineCapacity> |
222 struct GCInfoTrait<HeapVector<T, inlineCapacity>> : public GCInfoTrait<Vector<T,
inlineCapacity, HeapAllocator>> { }; | 222 struct GCInfoTrait<HeapVector<T, inlineCapacity>> : public GCInfoTrait<Vector<T,
inlineCapacity, HeapAllocator>> { }; |
223 template<typename T, size_t inlineCapacity> | 223 template<typename T, size_t inlineCapacity> |
224 struct GCInfoTrait<HeapDeque<T, inlineCapacity>> : public GCInfoTrait<Deque<T, i
nlineCapacity, HeapAllocator>> { }; | 224 struct GCInfoTrait<HeapDeque<T, inlineCapacity>> : public GCInfoTrait<Deque<T, i
nlineCapacity, HeapAllocator>> { }; |
225 template<typename T, typename U, typename V> | 225 template<typename T, typename U, typename V> |
226 struct GCInfoTrait<HeapHashCountedSet<T, U, V>> : public GCInfoTrait<HashCounted
Set<T, U, V, HeapAllocator>> { }; | 226 struct GCInfoTrait<HeapHashCountedSet<T, U, V>> : public GCInfoTrait<HashCounted
Set<T, U, V, HeapAllocator>> { }; |
227 | 227 |
228 } // namespace blink | 228 } // namespace blink |
229 | 229 |
230 #endif | 230 #endif |
OLD | NEW |