| 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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 AdjustAndMarkTrait<T>::mark(visitor, t); | 163 AdjustAndMarkTrait<T>::mark(visitor, t); |
| 164 } | 164 } |
| 165 }; | 165 }; |
| 166 | 166 |
| 167 template<typename T> class TraceTrait<const T> : public TraceTrait<T> { }; | 167 template<typename T> class TraceTrait<const T> : public TraceTrait<T> { }; |
| 168 | 168 |
| 169 template<typename T> | 169 template<typename T> |
| 170 void TraceTrait<T>::trace(Visitor* visitor, void* self) | 170 void TraceTrait<T>::trace(Visitor* visitor, void* self) |
| 171 { | 171 { |
| 172 static_assert(WTF::NeedsTracing<T>::value || WTF::IsWeak<T>::value, "T shoul
d be traced"); | 172 static_assert(WTF::NeedsTracing<T>::value || WTF::IsWeak<T>::value, "T shoul
d be traced"); |
| 173 if (visitor->markingMode() == Visitor::GlobalMarking) { | 173 if (visitor->getMarkingMode() == Visitor::GlobalMarking) { |
| 174 // Switch to inlined global marking dispatch. | 174 // Switch to inlined global marking dispatch. |
| 175 static_cast<T*>(self)->trace(InlinedGlobalMarkingVisitor(visitor)); | 175 static_cast<T*>(self)->trace(InlinedGlobalMarkingVisitor(visitor)); |
| 176 } else { | 176 } else { |
| 177 static_cast<T*>(self)->trace(visitor); | 177 static_cast<T*>(self)->trace(visitor); |
| 178 } | 178 } |
| 179 } | 179 } |
| 180 | 180 |
| 181 template<typename T> | 181 template<typename T> |
| 182 void TraceTrait<T>::trace(InlinedGlobalMarkingVisitor visitor, void* self) | 182 void TraceTrait<T>::trace(InlinedGlobalMarkingVisitor visitor, void* self) |
| 183 { | 183 { |
| (...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 585 // since iterating over the hash table backing will find the whole | 585 // since iterating over the hash table backing will find the whole |
| 586 // chain. | 586 // chain. |
| 587 visitor->markNoTracing(node); | 587 visitor->markNoTracing(node); |
| 588 return false; | 588 return false; |
| 589 } | 589 } |
| 590 }; | 590 }; |
| 591 | 591 |
| 592 } // namespace WTF | 592 } // namespace WTF |
| 593 | 593 |
| 594 #endif | 594 #endif |
| OLD | NEW |