OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 HEAP_STUBS_H_ | 5 #ifndef HEAP_STUBS_H_ |
6 #define HEAP_STUBS_H_ | 6 #define HEAP_STUBS_H_ |
7 | 7 |
8 #include "stddef.h" | 8 #include "stddef.h" |
9 | 9 |
10 #define WTF_MAKE_FAST_ALLOCATED \ | 10 #define WTF_MAKE_FAST_ALLOCATED \ |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 public: \ | 154 public: \ |
155 void* operator new(size_t, void*); \ | 155 void* operator new(size_t, void*); \ |
156 private: \ | 156 private: \ |
157 void* operator new(size_t) = delete; | 157 void* operator new(size_t) = delete; |
158 | 158 |
159 #define GC_PLUGIN_IGNORE(bug) \ | 159 #define GC_PLUGIN_IGNORE(bug) \ |
160 __attribute__((annotate("blink_gc_plugin_ignore"))) | 160 __attribute__((annotate("blink_gc_plugin_ignore"))) |
161 | 161 |
162 #define USING_GARBAGE_COLLECTED_MIXIN(type) \ | 162 #define USING_GARBAGE_COLLECTED_MIXIN(type) \ |
163 public: \ | 163 public: \ |
164 virtual void adjustAndMark(Visitor*) const override { } \ | 164 virtual void AdjustAndMark(Visitor*) const override { } \ |
165 virtual bool isHeapObjectAlive(Visitor*) const override { return 0; } | 165 virtual bool IsHeapObjectAlive(Visitor*) const override { return 0; } |
166 | 166 |
167 #define EAGERLY_FINALIZED() typedef int IsEagerlyFinalizedMarker | 167 #define EAGERLY_FINALIZED() typedef int IsEagerlyFinalizedMarker |
168 | 168 |
169 template<typename T> class GarbageCollected { }; | 169 template<typename T> class GarbageCollected { }; |
170 | 170 |
171 template<typename T> | 171 template<typename T> |
172 class GarbageCollectedFinalized : public GarbageCollected<T> { }; | 172 class GarbageCollectedFinalized : public GarbageCollected<T> { }; |
173 | 173 |
174 template<typename T> | 174 template<typename T> |
175 class RefCountedGarbageCollected : public GarbageCollectedFinalized<T> { }; | 175 class RefCountedGarbageCollected : public GarbageCollectedFinalized<T> { }; |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 template<typename K, typename V> | 244 template<typename K, typename V> |
245 class HeapHashMap : public HashMap<K, V, void, void, void, HeapAllocator> { }; | 245 class HeapHashMap : public HashMap<K, V, void, void, void, HeapAllocator> { }; |
246 | 246 |
247 template<typename T> | 247 template<typename T> |
248 class PersistentHeapVector : public Vector<T, 0, HeapAllocator> { }; | 248 class PersistentHeapVector : public Vector<T, 0, HeapAllocator> { }; |
249 | 249 |
250 template <typename Derived> | 250 template <typename Derived> |
251 class VisitorHelper { | 251 class VisitorHelper { |
252 public: | 252 public: |
253 template<typename T> | 253 template<typename T> |
254 void trace(const T&); | 254 void Trace(const T&); |
255 }; | 255 }; |
256 | 256 |
257 class Visitor : public VisitorHelper<Visitor> { | 257 class Visitor : public VisitorHelper<Visitor> { |
258 public: | 258 public: |
259 template<typename T, void (T::*method)(Visitor*)> | 259 template<typename T, void (T::*method)(Visitor*)> |
260 void registerWeakMembers(const T* obj); | 260 void RegisterWeakMembers(const T* obj); |
261 }; | 261 }; |
262 | 262 |
263 class InlinedGlobalMarkingVisitor | 263 class InlinedGlobalMarkingVisitor |
264 : public VisitorHelper<InlinedGlobalMarkingVisitor> { | 264 : public VisitorHelper<InlinedGlobalMarkingVisitor> { |
265 public: | 265 public: |
266 InlinedGlobalMarkingVisitor* operator->() { return this; } | 266 InlinedGlobalMarkingVisitor* operator->() { return this; } |
267 | 267 |
268 template<typename T, void (T::*method)(Visitor*)> | 268 template<typename T, void (T::*method)(Visitor*)> |
269 void registerWeakMembers(const T* obj); | 269 void RegisterWeakMembers(const T* obj); |
270 }; | 270 }; |
271 | 271 |
272 class GarbageCollectedMixin { | 272 class GarbageCollectedMixin { |
273 public: | 273 public: |
274 virtual void adjustAndMark(Visitor*) const = 0; | 274 virtual void AdjustAndMark(Visitor*) const = 0; |
275 virtual bool isHeapObjectAlive(Visitor*) const = 0; | 275 virtual bool IsHeapObjectAlive(Visitor*) const = 0; |
276 virtual void trace(Visitor*) { } | 276 virtual void Trace(Visitor*) { } |
277 }; | 277 }; |
278 | 278 |
279 template<typename T> | 279 template<typename T> |
280 struct TraceIfNeeded { | 280 struct TraceIfNeeded { |
281 static void trace(Visitor*, T*); | 281 static void Trace(Visitor*, T*); |
282 }; | 282 }; |
283 | 283 |
284 } | 284 } |
285 | 285 |
286 namespace WTF { | 286 namespace WTF { |
287 | 287 |
288 template<typename T> | 288 template<typename T> |
289 struct VectorTraits<blink::Member<T> > { | 289 struct VectorTraits<blink::Member<T> > { |
290 static const bool needsDestruction = false; | 290 static const bool needsDestruction = false; |
291 }; | 291 }; |
292 | 292 |
293 } | 293 } |
294 | 294 |
295 #endif | 295 #endif |
OLD | NEW |