| 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 { |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 return *static_cast<InlinedGlobalMarkingVisitor*>(helper); | 72 return *static_cast<InlinedGlobalMarkingVisitor*>(helper); |
| 73 } | 73 } |
| 74 | 74 |
| 75 #if ENABLE(ASSERT) | 75 #if ENABLE(ASSERT) |
| 76 inline void checkMarkingAllowed() { m_visitor->checkMarkingAllowed(); } | 76 inline void checkMarkingAllowed() { m_visitor->checkMarkingAllowed(); } |
| 77 #endif | 77 #endif |
| 78 | 78 |
| 79 Visitor* m_visitor; | 79 Visitor* m_visitor; |
| 80 }; | 80 }; |
| 81 | 81 |
| 82 template<typename T> | |
| 83 void TraceTrait<T>::trace(Visitor* visitor, void* self) | |
| 84 { | |
| 85 if (visitor->isGlobalMarkingVisitor()) { | |
| 86 // Switch to inlined global marking dispatch. | |
| 87 static_cast<T*>(self)->trace(InlinedGlobalMarkingVisitor(visitor)); | |
| 88 } else { | |
| 89 static_cast<T*>(self)->trace(visitor); | |
| 90 } | |
| 91 } | |
| 92 | |
| 93 template<typename T> | |
| 94 void TraceTrait<T>::trace(InlinedGlobalMarkingVisitor visitor, void* self) | |
| 95 { | |
| 96 static_cast<T*>(self)->trace(visitor); | |
| 97 } | |
| 98 | |
| 99 inline void GarbageCollectedMixin::trace(InlinedGlobalMarkingVisitor) | 82 inline void GarbageCollectedMixin::trace(InlinedGlobalMarkingVisitor) |
| 100 { | 83 { |
| 101 } | 84 } |
| 102 | 85 |
| 103 } // namespace blink | 86 } // namespace blink |
| 104 | 87 |
| 105 #endif | 88 #endif |
| OLD | NEW |