| 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 TraceTraits_h | 5 #ifndef TraceTraits_h |
| 6 #define TraceTraits_h | 6 #define TraceTraits_h |
| 7 | 7 |
| 8 #include "platform/heap/GCInfo.h" | 8 #include "platform/heap/GCInfo.h" |
| 9 #include "platform/heap/Heap.h" | 9 #include "platform/heap/Heap.h" |
| 10 #include "platform/heap/InlinedGlobalMarkingVisitor.h" | 10 #include "platform/heap/InlinedGlobalMarkingVisitor.h" |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 { | 150 { |
| 151 AdjustAndMarkTrait<T>::mark(visitor, t); | 151 AdjustAndMarkTrait<T>::mark(visitor, t); |
| 152 } | 152 } |
| 153 }; | 153 }; |
| 154 | 154 |
| 155 template<typename T> class TraceTrait<const T> : public TraceTrait<T> { }; | 155 template<typename T> class TraceTrait<const T> : public TraceTrait<T> { }; |
| 156 | 156 |
| 157 template<typename T> | 157 template<typename T> |
| 158 void TraceTrait<T>::trace(Visitor* visitor, void* self) | 158 void TraceTrait<T>::trace(Visitor* visitor, void* self) |
| 159 { | 159 { |
| 160 if (visitor->isGlobalMarkingVisitor()) { | 160 if (visitor->markingMode() == Visitor::GlobalMarking) { |
| 161 // Switch to inlined global marking dispatch. | 161 // Switch to inlined global marking dispatch. |
| 162 static_cast<T*>(self)->trace(InlinedGlobalMarkingVisitor(visitor)); | 162 static_cast<T*>(self)->trace(InlinedGlobalMarkingVisitor(visitor)); |
| 163 } else { | 163 } else { |
| 164 static_cast<T*>(self)->trace(visitor); | 164 static_cast<T*>(self)->trace(visitor); |
| 165 } | 165 } |
| 166 } | 166 } |
| 167 | 167 |
| 168 template<typename T> | 168 template<typename T> |
| 169 void TraceTrait<T>::trace(InlinedGlobalMarkingVisitor visitor, void* self) | 169 void TraceTrait<T>::trace(InlinedGlobalMarkingVisitor visitor, void* self) |
| 170 { | 170 { |
| (...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 541 // since iterating over the hash table backing will find the whole | 541 // since iterating over the hash table backing will find the whole |
| 542 // chain. | 542 // chain. |
| 543 visitor->markNoTracing(node); | 543 visitor->markNoTracing(node); |
| 544 return false; | 544 return false; |
| 545 } | 545 } |
| 546 }; | 546 }; |
| 547 | 547 |
| 548 } // namespace WTF | 548 } // namespace WTF |
| 549 | 549 |
| 550 #endif | 550 #endif |
| OLD | NEW |