| 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/Allocator.h" | 9 #include "wtf/Allocator.h" |
| 10 #include "wtf/Assertions.h" | 10 #include "wtf/Assertions.h" |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 // encounter. | 179 // encounter. |
| 180 static const size_t maxIndex = 1 << 14; | 180 static const size_t maxIndex = 1 << 14; |
| 181 | 181 |
| 182 private: | 182 private: |
| 183 static void resize(); | 183 static void resize(); |
| 184 | 184 |
| 185 static int s_gcInfoIndex; | 185 static int s_gcInfoIndex; |
| 186 static size_t s_gcInfoTableSize; | 186 static size_t s_gcInfoTableSize; |
| 187 }; | 187 }; |
| 188 | 188 |
| 189 // GCInfotAtBaseType should be used when returning a unique 14 bit integer | 189 // GCInfoAtBaseType should be used when returning a unique 14 bit integer |
| 190 // for a given gcInfo. | 190 // for a given gcInfo. |
| 191 template <typename T> | 191 template <typename T> |
| 192 struct GCInfoAtBaseType { | 192 struct GCInfoAtBaseType { |
| 193 STATIC_ONLY(GCInfoAtBaseType); | 193 STATIC_ONLY(GCInfoAtBaseType); |
| 194 static size_t index() { | 194 static size_t index() { |
| 195 static_assert(sizeof(T), "T must be fully defined"); | 195 static_assert(sizeof(T), "T must be fully defined"); |
| 196 static const GCInfo gcInfo = { | 196 static const GCInfo gcInfo = { |
| 197 TraceTrait<T>::trace, FinalizerTrait<T>::finalize, | 197 TraceTrait<T>::trace, FinalizerTrait<T>::finalize, |
| 198 FinalizerTrait<T>::nonTrivialFinalizer, std::is_polymorphic<T>::value, | 198 FinalizerTrait<T>::nonTrivialFinalizer, std::is_polymorphic<T>::value, |
| 199 }; | 199 }; |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 template <typename T, size_t inlineCapacity> | 273 template <typename T, size_t inlineCapacity> |
| 274 struct GCInfoTrait<HeapDeque<T, inlineCapacity>> | 274 struct GCInfoTrait<HeapDeque<T, inlineCapacity>> |
| 275 : public GCInfoTrait<Deque<T, inlineCapacity, HeapAllocator>> {}; | 275 : public GCInfoTrait<Deque<T, inlineCapacity, HeapAllocator>> {}; |
| 276 template <typename T, typename U, typename V> | 276 template <typename T, typename U, typename V> |
| 277 struct GCInfoTrait<HeapHashCountedSet<T, U, V>> | 277 struct GCInfoTrait<HeapHashCountedSet<T, U, V>> |
| 278 : public GCInfoTrait<HashCountedSet<T, U, V, HeapAllocator>> {}; | 278 : public GCInfoTrait<HashCountedSet<T, U, V, HeapAllocator>> {}; |
| 279 | 279 |
| 280 } // namespace blink | 280 } // namespace blink |
| 281 | 281 |
| 282 #endif | 282 #endif |
| OLD | NEW |