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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 template <typename T, bool = NeedsAdjustAndMark<T>::value> | 42 template <typename T, bool = NeedsAdjustAndMark<T>::value> |
43 class AdjustAndMarkTrait; | 43 class AdjustAndMarkTrait; |
44 | 44 |
45 template <typename T> | 45 template <typename T> |
46 class AdjustAndMarkTrait<T, false> { | 46 class AdjustAndMarkTrait<T, false> { |
47 STATIC_ONLY(AdjustAndMarkTrait); | 47 STATIC_ONLY(AdjustAndMarkTrait); |
48 | 48 |
49 public: | 49 public: |
50 template <typename VisitorDispatcher> | 50 template <typename VisitorDispatcher> |
51 static void mark(VisitorDispatcher visitor, const T* t) { | 51 static void mark(VisitorDispatcher visitor, const T* t) { |
52 #if ENABLE(ASSERT) | 52 #if DCHECK_IS_ON() |
53 assertObjectHasGCInfo(const_cast<T*>(t), GCInfoTrait<T>::index()); | 53 assertObjectHasGCInfo(const_cast<T*>(t), GCInfoTrait<T>::index()); |
54 #endif | 54 #endif |
55 // Default mark method of the trait just calls the two-argument mark | 55 // Default mark method of the trait just calls the two-argument mark |
56 // method on the visitor. The second argument is the static trace method | 56 // method on the visitor. The second argument is the static trace method |
57 // of the trait, which by default calls the instance method | 57 // of the trait, which by default calls the instance method |
58 // trace(Visitor*) on the object. | 58 // trace(Visitor*) on the object. |
59 // | 59 // |
60 // If the trait allows it, invoke the trace callback right here on the | 60 // If the trait allows it, invoke the trace callback right here on the |
61 // not-yet-marked object. | 61 // not-yet-marked object. |
62 if (TraceEagerlyTrait<T>::value) { | 62 if (TraceEagerlyTrait<T>::value) { |
(...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
791 // since iterating over the hash table backing will find the whole | 791 // since iterating over the hash table backing will find the whole |
792 // chain. | 792 // chain. |
793 visitor->markNoTracing(node); | 793 visitor->markNoTracing(node); |
794 return false; | 794 return false; |
795 } | 795 } |
796 }; | 796 }; |
797 | 797 |
798 } // namespace WTF | 798 } // namespace WTF |
799 | 799 |
800 #endif | 800 #endif |
OLD | NEW |