| 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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 }; | 184 }; |
| 185 | 185 |
| 186 template<typename T> class TraceTrait<const T> : public TraceTrait<T> { }; | 186 template<typename T> class TraceTrait<const T> : public TraceTrait<T> { }; |
| 187 | 187 |
| 188 template<typename T> | 188 template<typename T> |
| 189 void TraceTrait<T>::trace(Visitor* visitor, void* self) | 189 void TraceTrait<T>::trace(Visitor* visitor, void* self) |
| 190 { | 190 { |
| 191 static_assert(WTF::NeedsTracing<T>::value || WTF::IsWeak<T>::value, "T shoul
d be traced"); | 191 static_assert(WTF::NeedsTracing<T>::value || WTF::IsWeak<T>::value, "T shoul
d be traced"); |
| 192 if (visitor->getMarkingMode() == Visitor::GlobalMarking) { | 192 if (visitor->getMarkingMode() == Visitor::GlobalMarking) { |
| 193 // Switch to inlined global marking dispatch. | 193 // Switch to inlined global marking dispatch. |
| 194 static_cast<T*>(self)->trace(InlinedGlobalMarkingVisitor()); | 194 static_cast<T*>(self)->trace(InlinedGlobalMarkingVisitor(visitor->state(
))); |
| 195 } else { | 195 } else { |
| 196 static_cast<T*>(self)->trace(visitor); | 196 static_cast<T*>(self)->trace(visitor); |
| 197 } | 197 } |
| 198 } | 198 } |
| 199 | 199 |
| 200 template<typename T> | 200 template<typename T> |
| 201 void TraceTrait<T>::trace(InlinedGlobalMarkingVisitor visitor, void* self) | 201 void TraceTrait<T>::trace(InlinedGlobalMarkingVisitor visitor, void* self) |
| 202 { | 202 { |
| 203 static_assert(WTF::NeedsTracing<T>::value || WTF::IsWeak<T>::value, "T shoul
d be traced"); | 203 static_assert(WTF::NeedsTracing<T>::value || WTF::IsWeak<T>::value, "T shoul
d be traced"); |
| 204 static_cast<T*>(self)->trace(visitor); | 204 static_cast<T*>(self)->trace(visitor); |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 603 // since iterating over the hash table backing will find the whole | 603 // since iterating over the hash table backing will find the whole |
| 604 // chain. | 604 // chain. |
| 605 visitor->markNoTracing(node); | 605 visitor->markNoTracing(node); |
| 606 return false; | 606 return false; |
| 607 } | 607 } |
| 608 }; | 608 }; |
| 609 | 609 |
| 610 } // namespace WTF | 610 } // namespace WTF |
| 611 | 611 |
| 612 #endif | 612 #endif |
| OLD | NEW |