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

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

Issue 2609883003: [wrapper-tracing] Avoid firing the write barrier after TraceEpilogue (Closed)
Patch Set: Fix tests: Wrap testing code with TracePrologue and AbortTracing 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.cpp
index 25ae942719ebeed3fb1296ff937731fcd802c129..83eaff908273c2b21d79a2bde39995a859a1043f 100644
--- a/third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.cpp
@@ -60,12 +60,14 @@ void ScriptWrappableVisitor::TraceEpilogue() {
#endif
m_shouldCleanup = true;
+ m_tracingInProgress = false;
scheduleIdleLazyCleanup();
}
void ScriptWrappableVisitor::AbortTracing() {
CHECK(ThreadState::current());
m_shouldCleanup = true;
+ m_tracingInProgress = false;
performCleanup();
}
@@ -90,7 +92,6 @@ void ScriptWrappableVisitor::performCleanup() {
m_markingDeque.clear();
m_verifierDeque.clear();
m_shouldCleanup = false;
- m_tracingInProgress = false;
}
void ScriptWrappableVisitor::scheduleIdleLazyCleanup() {
@@ -145,7 +146,6 @@ void ScriptWrappableVisitor::performLazyCleanup(double deadlineSeconds) {
m_markingDeque.clear();
m_verifierDeque.clear();
m_shouldCleanup = false;
- m_tracingInProgress = false;
}
void ScriptWrappableVisitor::RegisterV8Reference(
@@ -247,6 +247,10 @@ void ScriptWrappableVisitor::traceWrappers(
void ScriptWrappableVisitor::markWrapper(
const v8::PersistentBase<v8::Value>* handle) const {
+ // The write barrier may try to mark a wrapper because cleanup is still
+ // delayed. Bail out in this case.
+ if (!m_tracingInProgress)
+ return;
handle->RegisterExternalReference(m_isolate);
}

Powered by Google App Engine
This is Rietveld 408576698