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

Side by Side Diff: third_party/WebKit/Source/platform/heap/WrapperVisitor.h

Issue 2640033002: [wrapper-tracing] Force inlining of marking deque helper (Closed)
Patch Set: Created 3 years, 11 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 WrapperVisitor_h 5 #ifndef WrapperVisitor_h
6 #define WrapperVisitor_h 6 #define WrapperVisitor_h
7 7
8 #include "platform/PlatformExport.h" 8 #include "platform/PlatformExport.h"
9 #include "wtf/Allocator.h" 9 #include "wtf/Allocator.h"
10 10
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 #define DEFINE_INLINE_TRACE_WRAPPERS() DECLARE_TRACE_WRAPPERS() 84 #define DEFINE_INLINE_TRACE_WRAPPERS() DECLARE_TRACE_WRAPPERS()
85 #define DEFINE_INLINE_VIRTUAL_TRACE_WRAPPERS() DECLARE_VIRTUAL_TRACE_WRAPPERS() 85 #define DEFINE_INLINE_VIRTUAL_TRACE_WRAPPERS() DECLARE_VIRTUAL_TRACE_WRAPPERS()
86 86
87 // ########################################################################### 87 // ###########################################################################
88 // TODO(hlopko): Get rid of virtual calls using CRTP 88 // TODO(hlopko): Get rid of virtual calls using CRTP
89 class PLATFORM_EXPORT WrapperVisitor { 89 class PLATFORM_EXPORT WrapperVisitor {
90 USING_FAST_MALLOC(WrapperVisitor); 90 USING_FAST_MALLOC(WrapperVisitor);
91 91
92 public: 92 public:
93 template <typename T> 93 template <typename T>
94 static NEVER_INLINE void missedWriteBarrier() { 94 static NOINLINE void missedWriteBarrier() {
Michael Lippautz 2017/01/18 13:47:40 https://cs.chromium.org/chromium/src/third_party/W
95 NOTREACHED(); 95 NOTREACHED();
96 } 96 }
97 97
98 template <typename T> 98 template <typename T>
99 void traceWrappers(const T* traceable) const { 99 void traceWrappers(const T* traceable) const {
100 static_assert(sizeof(T), "T must be fully defined"); 100 static_assert(sizeof(T), "T must be fully defined");
101 static_assert(CanTraceWrappers<T>::value, 101 static_assert(CanTraceWrappers<T>::value,
102 "T should be able to trace wrappers. See " 102 "T should be able to trace wrappers. See "
103 "dispatchTraceWrappers in WrapperVisitor.h"); 103 "dispatchTraceWrappers in WrapperVisitor.h");
104 104
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 virtual bool markWrapperHeader(HeapObjectHeader*) const = 0; 160 virtual bool markWrapperHeader(HeapObjectHeader*) const = 0;
161 161
162 virtual void markWrappersInAllWorlds(const ScriptWrappable*) const = 0; 162 virtual void markWrappersInAllWorlds(const ScriptWrappable*) const = 0;
163 163
164 void markWrappersInAllWorlds(const void*) const { 164 void markWrappersInAllWorlds(const void*) const {
165 // Empty handler used for WRAPPER_VISITOR_SPECIAL_CLASSES. These types 165 // Empty handler used for WRAPPER_VISITOR_SPECIAL_CLASSES. These types
166 // don't require marking wrappers in all worlds, so just nop on those. 166 // don't require marking wrappers in all worlds, so just nop on those.
167 } 167 }
168 168
169 template <typename T> 169 template <typename T>
170 void markAndPushToMarkingDeque(const T* traceable) const { 170 ALWAYS_INLINE void markAndPushToMarkingDeque(const T* traceable) const {
Michael Lippautz 2017/01/18 13:47:40 The only difference in the CL responsible for the
171 if (pushToMarkingDeque(TraceTrait<T>::traceMarkedWrapper, 171 if (pushToMarkingDeque(TraceTrait<T>::traceMarkedWrapper,
172 TraceTrait<T>::heapObjectHeader, 172 TraceTrait<T>::heapObjectHeader,
173 WrapperVisitor::missedWriteBarrier<T>, traceable)) { 173 WrapperVisitor::missedWriteBarrier<T>, traceable)) {
174 TraceTrait<T>::markWrapperNoTracing(this, traceable); 174 TraceTrait<T>::markWrapperNoTracing(this, traceable);
175 } 175 }
176 } 176 }
177 177
178 protected: 178 protected:
179 // Returns true if pushing to the marking deque was successful. 179 // Returns true if pushing to the marking deque was successful.
180 virtual bool pushToMarkingDeque( 180 virtual bool pushToMarkingDeque(
(...skipping 10 matching lines...) Expand all
191 static const bool value = true; \ 191 static const bool value = true; \
192 }; 192 };
193 193
194 WRAPPER_VISITOR_SPECIAL_CLASSES(SPECIALIZE_WRAPPER_TRACING_MARK_TRAIT) 194 WRAPPER_VISITOR_SPECIAL_CLASSES(SPECIALIZE_WRAPPER_TRACING_MARK_TRAIT)
195 195
196 #undef SPECIALIZE_WRAPPER_TRACING_MARK_TRAIT 196 #undef SPECIALIZE_WRAPPER_TRACING_MARK_TRAIT
197 197
198 } // namespace blink 198 } // namespace blink
199 199
200 #endif // WrapperVisitor_h 200 #endif // WrapperVisitor_h
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698