| 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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 AdjustAndMarkTrait<T>::mark(visitor, t); | 224 AdjustAndMarkTrait<T>::mark(visitor, t); |
| 225 } | 225 } |
| 226 }; | 226 }; |
| 227 | 227 |
| 228 template <typename T> | 228 template <typename T> |
| 229 class TraceTrait<const T> : public TraceTrait<T> {}; | 229 class TraceTrait<const T> : public TraceTrait<T> {}; |
| 230 | 230 |
| 231 template <typename T> | 231 template <typename T> |
| 232 void TraceTrait<T>::trace(Visitor* visitor, void* self) { | 232 void TraceTrait<T>::trace(Visitor* visitor, void* self) { |
| 233 static_assert(WTF::IsTraceable<T>::value, "T should not be traced"); | 233 static_assert(WTF::IsTraceable<T>::value, "T should not be traced"); |
| 234 if (visitor->isGlobalMarking()) { | 234 if (visitor->getMarkingMode() == Visitor::GlobalMarking) { |
| 235 // Switch to inlined global marking dispatch. | 235 // Switch to inlined global marking dispatch. |
| 236 static_cast<T*>(self)->trace(InlinedGlobalMarkingVisitor( | 236 static_cast<T*>(self)->trace(InlinedGlobalMarkingVisitor(visitor->state())); |
| 237 visitor->state(), visitor->getMarkingMode())); | |
| 238 } else { | 237 } else { |
| 239 static_cast<T*>(self)->trace(visitor); | 238 static_cast<T*>(self)->trace(visitor); |
| 240 } | 239 } |
| 241 } | 240 } |
| 242 | 241 |
| 243 template <typename T> | 242 template <typename T> |
| 244 void TraceTrait<T>::trace(InlinedGlobalMarkingVisitor visitor, void* self) { | 243 void TraceTrait<T>::trace(InlinedGlobalMarkingVisitor visitor, void* self) { |
| 245 static_assert(WTF::IsTraceable<T>::value, "T should not be traced"); | 244 static_assert(WTF::IsTraceable<T>::value, "T should not be traced"); |
| 246 static_cast<T*>(self)->trace(visitor); | 245 static_cast<T*>(self)->trace(visitor); |
| 247 } | 246 } |
| (...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 772 // since iterating over the hash table backing will find the whole | 771 // since iterating over the hash table backing will find the whole |
| 773 // chain. | 772 // chain. |
| 774 visitor->markNoTracing(node); | 773 visitor->markNoTracing(node); |
| 775 return false; | 774 return false; |
| 776 } | 775 } |
| 777 }; | 776 }; |
| 778 | 777 |
| 779 } // namespace WTF | 778 } // namespace WTF |
| 780 | 779 |
| 781 #endif | 780 #endif |
| OLD | NEW |