OLD | NEW |
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 ScriptWrappableVisitor_h | 5 #ifndef ScriptWrappableVisitor_h |
6 #define ScriptWrappableVisitor_h | 6 #define ScriptWrappableVisitor_h |
7 | 7 |
8 #include "bindings/core/v8/ScopedPersistent.h" | 8 #include "bindings/core/v8/ScopedPersistent.h" |
9 #include "bindings/core/v8/ScriptWrappable.h" | 9 #include "bindings/core/v8/ScriptWrappable.h" |
10 #include "core/CoreExport.h" | 10 #include "core/CoreExport.h" |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 */ | 148 */ |
149 bool m_tracingInProgress = false; | 149 bool m_tracingInProgress = false; |
150 /** | 150 /** |
151 * Is AdvanceTracing currently running? If not, we know that all calls of | 151 * Is AdvanceTracing currently running? If not, we know that all calls of |
152 * pushToMarkingDeque are from V8 or new wrapper associations. And this | 152 * pushToMarkingDeque are from V8 or new wrapper associations. And this |
153 * information is used by the verifier feature. | 153 * information is used by the verifier feature. |
154 */ | 154 */ |
155 bool m_advancingTracing = false; | 155 bool m_advancingTracing = false; |
156 | 156 |
157 /** | 157 /** |
158 * Indicates whether an idle task for a lazy cleanup has already been schedu
led. | 158 * Indicates whether an idle task for a lazy cleanup has already been |
159 * The flag is used to avoid scheduling multiple idle tasks for cleaning up. | 159 * scheduled. The flag is used to avoid scheduling multiple idle tasks for |
| 160 * cleaning up. |
160 */ | 161 */ |
161 bool m_idleCleanupTaskScheduled = false; | 162 bool m_idleCleanupTaskScheduled = false; |
162 | 163 |
163 /** | 164 /** |
164 * Indicates whether cleanup should currently happen. | 165 * Indicates whether cleanup should currently happen. |
165 * The flag is used to avoid cleaning up in the next GC cycle. | 166 * The flag is used to avoid cleaning up in the next GC cycle. |
166 */ | 167 */ |
167 bool m_shouldCleanup = false; | 168 bool m_shouldCleanup = false; |
168 | 169 |
169 /** | 170 /** |
170 * Immediately cleans up all wrappers. | 171 * Immediately cleans up all wrappers. |
171 */ | 172 */ |
172 void performCleanup(); | 173 void performCleanup(); |
173 | 174 |
174 /** | 175 /** |
175 * Schedule an idle task to perform a lazy (incremental) clean up of wrapper
s. | 176 * Schedule an idle task to perform a lazy (incremental) clean up of |
| 177 * wrappers. |
176 */ | 178 */ |
177 void scheduleIdleLazyCleanup(); | 179 void scheduleIdleLazyCleanup(); |
178 void performLazyCleanup(double deadlineSeconds); | 180 void performLazyCleanup(double deadlineSeconds); |
179 | 181 |
180 /** | 182 /** |
181 * Collection of objects we need to trace from. We assume it is safe to hold | 183 * Collection of objects we need to trace from. We assume it is safe to hold |
182 * on to the raw pointers because: | 184 * on to the raw pointers because: |
183 * * oilpan object cannot move | 185 * * oilpan object cannot move |
184 * * oilpan gc will call invalidateDeadObjectsInMarkingDeque to delete | 186 * * oilpan gc will call invalidateDeadObjectsInMarkingDeque to delete |
185 * all obsolete objects | 187 * all obsolete objects |
186 */ | 188 */ |
187 mutable WTF::Deque<WrapperMarkingData> m_markingDeque; | 189 mutable WTF::Deque<WrapperMarkingData> m_markingDeque; |
188 /** | 190 /** |
189 * Collection of objects we started tracing from. We assume it is safe to ho
ld | 191 * Collection of objects we started tracing from. We assume it is safe to |
190 * on to the raw pointers because: | 192 * hold on to the raw pointers because: |
191 * * oilpan object cannot move | 193 * * oilpan object cannot move |
192 * * oilpan gc will call invalidateDeadObjectsInMarkingDeque to delete | 194 * * oilpan gc will call invalidateDeadObjectsInMarkingDeque to delete |
193 * all obsolete objects | 195 * all obsolete objects |
194 * | 196 * |
195 * These objects are used when TraceWrappablesVerifier feature is enabled to | 197 * These objects are used when TraceWrappablesVerifier feature is enabled to |
196 * verify that all objects reachable in the atomic pause were marked | 198 * verify that all objects reachable in the atomic pause were marked |
197 * incrementally. If not, there is one or multiple write barriers missing. | 199 * incrementally. If not, there is one or multiple write barriers missing. |
198 */ | 200 */ |
199 mutable WTF::Deque<WrapperMarkingData> m_verifierDeque; | 201 mutable WTF::Deque<WrapperMarkingData> m_verifierDeque; |
200 /** | 202 /** |
201 * Collection of headers we need to unmark after the tracing finished. We | 203 * Collection of headers we need to unmark after the tracing finished. We |
202 * assume it is safe to hold on to the headers because: | 204 * assume it is safe to hold on to the headers because: |
203 * * oilpan objects cannot move | 205 * * oilpan objects cannot move |
204 * * objects this headers belong to are invalidated by the oilpan | 206 * * objects this headers belong to are invalidated by the oilpan |
205 * gc in invalidateDeadObjectsInMarkingDeque. | 207 * gc in invalidateDeadObjectsInMarkingDeque. |
206 */ | 208 */ |
207 mutable WTF::Vector<HeapObjectHeader*> m_headersToUnmark; | 209 mutable WTF::Vector<HeapObjectHeader*> m_headersToUnmark; |
208 v8::Isolate* m_isolate; | 210 v8::Isolate* m_isolate; |
209 | 211 |
210 /** | 212 /** |
211 * A reporter instance set in TracePrologue and cleared in TraceEpilogue, | 213 * A reporter instance set in TracePrologue and cleared in TraceEpilogue, |
212 * which is used to report all reachable references back to v8. | 214 * which is used to report all reachable references back to v8. |
213 */ | 215 */ |
214 v8::EmbedderReachableReferenceReporter* m_reporter = nullptr; | 216 v8::EmbedderReachableReferenceReporter* m_reporter = nullptr; |
215 }; | 217 }; |
216 } | 218 } |
217 #endif | 219 #endif |
OLD | NEW |