OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 20 matching lines...) Expand all Loading... |
31 #ifndef Visitor_h | 31 #ifndef Visitor_h |
32 #define Visitor_h | 32 #define Visitor_h |
33 | 33 |
34 #include "platform/PlatformExport.h" | 34 #include "platform/PlatformExport.h" |
35 #include "platform/heap/GarbageCollected.h" | 35 #include "platform/heap/GarbageCollected.h" |
36 #include "wtf/Allocator.h" | 36 #include "wtf/Allocator.h" |
37 #include "wtf/Assertions.h" | 37 #include "wtf/Assertions.h" |
38 #include "wtf/Forward.h" | 38 #include "wtf/Forward.h" |
39 #include "wtf/HashTraits.h" | 39 #include "wtf/HashTraits.h" |
40 #include "wtf/TypeTraits.h" | 40 #include "wtf/TypeTraits.h" |
| 41 #include <memory> |
41 | 42 |
42 namespace blink { | 43 namespace blink { |
43 | 44 |
44 template<typename T> class GarbageCollected; | 45 template<typename T> class GarbageCollected; |
45 class HeapObjectHeader; | 46 class HeapObjectHeader; |
46 class InlinedGlobalMarkingVisitor; | 47 class InlinedGlobalMarkingVisitor; |
47 template<typename T> class TraceTrait; | 48 template<typename T> class TraceTrait; |
48 template<typename T> class TraceEagerlyTrait; | 49 template<typename T> class TraceEagerlyTrait; |
49 class ThreadState; | 50 class ThreadState; |
50 class Visitor; | 51 class Visitor; |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 // GCing thread. This is used for GCType=ThreadTerminationGC. | 255 // GCing thread. This is used for GCType=ThreadTerminationGC. |
255 ThreadLocalMarking, | 256 ThreadLocalMarking, |
256 // This visitor just marks objects and ignores weak processing. | 257 // This visitor just marks objects and ignores weak processing. |
257 // This is used for GCType=TakeSnapshot. | 258 // This is used for GCType=TakeSnapshot. |
258 SnapshotMarking, | 259 SnapshotMarking, |
259 // This visitor is used to trace objects during weak processing. | 260 // This visitor is used to trace objects during weak processing. |
260 // This visitor is allowed to trace only already marked objects. | 261 // This visitor is allowed to trace only already marked objects. |
261 WeakProcessing, | 262 WeakProcessing, |
262 }; | 263 }; |
263 | 264 |
264 static PassOwnPtr<Visitor> create(ThreadState*, BlinkGC::GCType); | 265 static std::unique_ptr<Visitor> create(ThreadState*, BlinkGC::GCType); |
265 | 266 |
266 virtual ~Visitor(); | 267 virtual ~Visitor(); |
267 | 268 |
268 using VisitorHelper<Visitor>::mark; | 269 using VisitorHelper<Visitor>::mark; |
269 | 270 |
270 // This method marks an object and adds it to the set of objects | 271 // This method marks an object and adds it to the set of objects |
271 // that should have their trace method called. Since not all | 272 // that should have their trace method called. Since not all |
272 // objects have vtables we have to have the callback as an | 273 // objects have vtables we have to have the callback as an |
273 // explicit argument, but we can use the templated one-argument | 274 // explicit argument, but we can use the templated one-argument |
274 // mark method above to automatically provide the callback | 275 // mark method above to automatically provide the callback |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 private: | 328 private: |
328 static Visitor* fromHelper(VisitorHelper<Visitor>* helper) { return static_c
ast<Visitor*>(helper); } | 329 static Visitor* fromHelper(VisitorHelper<Visitor>* helper) { return static_c
ast<Visitor*>(helper); } |
329 | 330 |
330 ThreadState* m_state; | 331 ThreadState* m_state; |
331 const MarkingMode m_markingMode; | 332 const MarkingMode m_markingMode; |
332 }; | 333 }; |
333 | 334 |
334 } // namespace blink | 335 } // namespace blink |
335 | 336 |
336 #endif // Visitor_h | 337 #endif // Visitor_h |
OLD | NEW |