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 InlinedGlobalMarkingVisitor_h | 5 #ifndef InlinedGlobalMarkingVisitor_h |
6 #define InlinedGlobalMarkingVisitor_h | 6 #define InlinedGlobalMarkingVisitor_h |
7 | 7 |
8 #include "platform/heap/MarkingVisitorImpl.h" | 8 #include "platform/heap/MarkingVisitorImpl.h" |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
11 | 11 |
12 class InlinedGlobalMarkingVisitor final | 12 class InlinedGlobalMarkingVisitor final |
13 : public VisitorHelper<InlinedGlobalMarkingVisitor>, | 13 : public VisitorHelper<InlinedGlobalMarkingVisitor>, |
14 public MarkingVisitorImpl<InlinedGlobalMarkingVisitor> { | 14 public MarkingVisitorImpl<InlinedGlobalMarkingVisitor> { |
15 public: | 15 public: |
16 friend class VisitorHelper<InlinedGlobalMarkingVisitor>; | 16 friend class VisitorHelper<InlinedGlobalMarkingVisitor>; |
17 using Helper = VisitorHelper<InlinedGlobalMarkingVisitor>; | 17 using Helper = VisitorHelper<InlinedGlobalMarkingVisitor>; |
18 friend class MarkingVisitorImpl<InlinedGlobalMarkingVisitor>; | 18 friend class MarkingVisitorImpl<InlinedGlobalMarkingVisitor>; |
19 using Impl = MarkingVisitorImpl<InlinedGlobalMarkingVisitor>; | 19 using Impl = MarkingVisitorImpl<InlinedGlobalMarkingVisitor>; |
20 | 20 |
21 explicit InlinedGlobalMarkingVisitor(ThreadState* state) | 21 explicit InlinedGlobalMarkingVisitor(ThreadState* state) |
22 : VisitorHelper(state) {} | 22 : VisitorHelper(state) {} |
23 | 23 |
24 // Hack to unify interface to visitor->trace(). | 24 // Hack to unify interface to visitor->trace(). |
25 // Without this hack, we need to use visitor.trace() for | 25 // Without this hack, we need to use visitor.trace() for |
26 // trace(InlinedGlobalMarkingVisitor) and visitor->trace() for trace(Visitor*)
. | 26 // trace(InlinedGlobalMarkingVisitor) and visitor->trace() for |
| 27 // trace(Visitor*). |
27 InlinedGlobalMarkingVisitor* operator->() { return this; } | 28 InlinedGlobalMarkingVisitor* operator->() { return this; } |
28 | 29 |
29 using Impl::mark; | 30 using Impl::mark; |
30 using Impl::ensureMarked; | 31 using Impl::ensureMarked; |
31 using Impl::registerDelayedMarkNoTracing; | 32 using Impl::registerDelayedMarkNoTracing; |
32 using Impl::registerWeakTable; | 33 using Impl::registerWeakTable; |
33 using Impl::registerWeakMembers; | 34 using Impl::registerWeakMembers; |
34 #if ENABLE(ASSERT) | 35 #if ENABLE(ASSERT) |
35 using Impl::weakTableRegistered; | 36 using Impl::weakTableRegistered; |
36 #endif | 37 #endif |
(...skipping 24 matching lines...) Expand all Loading... |
61 static InlinedGlobalMarkingVisitor fromHelper(Helper* helper) { | 62 static InlinedGlobalMarkingVisitor fromHelper(Helper* helper) { |
62 return *static_cast<InlinedGlobalMarkingVisitor*>(helper); | 63 return *static_cast<InlinedGlobalMarkingVisitor*>(helper); |
63 } | 64 } |
64 }; | 65 }; |
65 | 66 |
66 inline void GarbageCollectedMixin::trace(InlinedGlobalMarkingVisitor) {} | 67 inline void GarbageCollectedMixin::trace(InlinedGlobalMarkingVisitor) {} |
67 | 68 |
68 } // namespace blink | 69 } // namespace blink |
69 | 70 |
70 #endif | 71 #endif |
OLD | NEW |