Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1215)

Side by Side Diff: Source/platform/heap/InlinedGlobalMarkingVisitor.h

Issue 799453003: Oilpan: fix Windows build after r187674. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add needsTracing argument to TraceCompatibilityAdaptor<> Created 5 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/platform/heap/Handle.h ('k') | Source/platform/heap/Visitor.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 InlinedGlobalMarkingVisitor_h 5 #ifndef InlinedGlobalMarkingVisitor_h
6 #define InlinedGlobalMarkingVisitor_h 6 #define InlinedGlobalMarkingVisitor_h
7 7
8 #include "platform/heap/MarkingVisitorImpl.h" 8 #include "platform/heap/MarkingVisitorImpl.h"
9 9
10 namespace blink { 10 namespace blink {
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 inline void recordObjectGraphEdge(const void* objectPointer) 68 inline void recordObjectGraphEdge(const void* objectPointer)
69 { 69 {
70 m_visitor->recordObjectGraphEdge(objectPointer); 70 m_visitor->recordObjectGraphEdge(objectPointer);
71 } 71 }
72 #endif 72 #endif
73 73
74 private: 74 private:
75 Visitor* m_visitor; 75 Visitor* m_visitor;
76 }; 76 };
77 77
78 // If T does not support trace().
79 template <typename T>
80 struct TraceCompatibilityAdaptor<T, false, false> {
81 inline static void trace(blink::Visitor*, T*)
82 {
83 }
84
85 inline static void trace(InlinedGlobalMarkingVisitor, T*)
86 {
87 }
88 };
89
78 // If T does not support trace(InlinedGlobalMarkingVisitor). 90 // If T does not support trace(InlinedGlobalMarkingVisitor).
79 template <typename T> 91 template <typename T>
80 struct TraceCompatibilityAdaptor<T, false> { 92 struct TraceCompatibilityAdaptor<T, true, false> {
81 inline static void trace(blink::Visitor* visitor, T* self) 93 inline static void trace(blink::Visitor* visitor, T* self)
82 { 94 {
83 self->trace(visitor); 95 self->trace(visitor);
84 } 96 }
85 97
86 inline static void trace(InlinedGlobalMarkingVisitor visitor, T* self) 98 inline static void trace(InlinedGlobalMarkingVisitor visitor, T* self)
87 { 99 {
88 // We revert to dynamic trace(Visitor*) for tracing T. 100 // We revert to dynamic trace(Visitor*) for tracing T.
89 self->trace(visitor.getUninlined()); 101 self->trace(visitor.getUninlined());
90 } 102 }
91 }; 103 };
92 104
93 // If T supports trace(InlinedGlobalMarkingVisitor). 105 // If T supports trace(InlinedGlobalMarkingVisitor).
94 template <typename T> 106 template <typename T>
95 struct TraceCompatibilityAdaptor<T, true> { 107 struct TraceCompatibilityAdaptor<T, true, true> {
96 inline static void trace(blink::Visitor* visitor, T* self) 108 inline static void trace(blink::Visitor* visitor, T* self)
97 { 109 {
98 if (visitor->isGlobalMarkingVisitor()) { 110 if (visitor->isGlobalMarkingVisitor()) {
99 // Switch to inlined global marking dispatch. 111 // Switch to inlined global marking dispatch.
100 self->trace(InlinedGlobalMarkingVisitor(visitor)); 112 self->trace(InlinedGlobalMarkingVisitor(visitor));
101 } else { 113 } else {
102 self->trace(visitor); 114 self->trace(visitor);
103 } 115 }
104 } 116 }
105 117
106 inline static void trace(InlinedGlobalMarkingVisitor visitor, T* self) 118 inline static void trace(InlinedGlobalMarkingVisitor visitor, T* self)
107 { 119 {
108 self->trace(visitor); 120 self->trace(visitor);
109 } 121 }
110 }; 122 };
111 123
112 } // namespace blink 124 } // namespace blink
113 125
114 #endif 126 #endif
OLDNEW
« no previous file with comments | « Source/platform/heap/Handle.h ('k') | Source/platform/heap/Visitor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698