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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.cpp

Issue 2839023004: Revert of Revert "[wrapper-tracing] Bail out tracing for empty handles" (Closed)
Patch Set: Created 3 years, 8 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 #include "bindings/core/v8/ScriptWrappableVisitor.h" 5 #include "bindings/core/v8/ScriptWrappableVisitor.h"
6 6
7 #include "bindings/core/v8/ActiveScriptWrappable.h" 7 #include "bindings/core/v8/ActiveScriptWrappable.h"
8 #include "bindings/core/v8/DOMWrapperWorld.h" 8 #include "bindings/core/v8/DOMWrapperWorld.h"
9 #include "bindings/core/v8/ScopedPersistent.h" 9 #include "bindings/core/v8/ScopedPersistent.h"
10 #include "bindings/core/v8/ScriptWrappable.h" 10 #include "bindings/core/v8/ScriptWrappable.h"
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 251
252 void ScriptWrappableVisitor::TraceWrappers( 252 void ScriptWrappableVisitor::TraceWrappers(
253 const TraceWrapperV8Reference<v8::Value>& traced_wrapper) const { 253 const TraceWrapperV8Reference<v8::Value>& traced_wrapper) const {
254 MarkWrapper( 254 MarkWrapper(
255 &(const_cast<TraceWrapperV8Reference<v8::Value>&>(traced_wrapper).Get())); 255 &(const_cast<TraceWrapperV8Reference<v8::Value>&>(traced_wrapper).Get()));
256 } 256 }
257 257
258 void ScriptWrappableVisitor::MarkWrapper( 258 void ScriptWrappableVisitor::MarkWrapper(
259 const v8::PersistentBase<v8::Value>* handle) const { 259 const v8::PersistentBase<v8::Value>* handle) const {
260 // The write barrier may try to mark a wrapper because cleanup is still 260 // The write barrier may try to mark a wrapper because cleanup is still
261 // delayed. Bail out in this case. 261 // delayed. Bail out in this case. We also allow unconditional marking which
262 if (!m_tracingInProgress) 262 // requires us to bail out here when tracing is not in progress.
263 if (!tracing_in_progress_ || handle->IsEmpty())
263 return; 264 return;
264 handle->RegisterExternalReference(isolate_); 265 handle->RegisterExternalReference(isolate_);
265 } 266 }
266 267
267 void ScriptWrappableVisitor::DispatchTraceWrappers( 268 void ScriptWrappableVisitor::DispatchTraceWrappers(
268 const TraceWrapperBase* wrapper_base) const { 269 const TraceWrapperBase* wrapper_base) const {
269 wrapper_base->TraceWrappers(this); 270 wrapper_base->TraceWrappers(this);
270 } 271 }
271 272
272 void ScriptWrappableVisitor::InvalidateDeadObjectsInMarkingDeque() { 273 void ScriptWrappableVisitor::InvalidateDeadObjectsInMarkingDeque() {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 V8PerIsolateData::From(isolate)->GetScriptWrappableVisitor(); 305 V8PerIsolateData::From(isolate)->GetScriptWrappableVisitor();
305 if (script_wrappable_visitor) 306 if (script_wrappable_visitor)
306 script_wrappable_visitor->PerformCleanup(); 307 script_wrappable_visitor->PerformCleanup();
307 } 308 }
308 309
309 WrapperVisitor* ScriptWrappableVisitor::CurrentVisitor(v8::Isolate* isolate) { 310 WrapperVisitor* ScriptWrappableVisitor::CurrentVisitor(v8::Isolate* isolate) {
310 return V8PerIsolateData::From(isolate)->GetScriptWrappableVisitor(); 311 return V8PerIsolateData::From(isolate)->GetScriptWrappableVisitor();
311 } 312 }
312 313
313 } // namespace blink 314 } // namespace blink
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