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

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

Issue 2759243002: [wrapper-tracing] Emite write barrier upon associating a wrapper (Closed)
Patch Set: Unconditionally mark during tracing without checking backpointer for SW Created 3 years, 9 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 8582768bcd90d4a6267ed15cc8e1bbd68faa232d..1b3c3b56f8cc82d0d92b2be028323e30c24dfce2 100644
--- a/third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.cpp
@@ -7,6 +7,7 @@
#include "bindings/core/v8/ActiveScriptWrappable.h"
#include "bindings/core/v8/DOMWrapperWorld.h"
#include "bindings/core/v8/ScopedPersistent.h"
+#include "bindings/core/v8/ScriptWrappable.h"
#include "bindings/core/v8/ScriptWrappableVisitorVerifier.h"
#include "bindings/core/v8/V8AbstractEventListener.h"
#include "bindings/core/v8/WrapperTypeInfo.h"
@@ -237,6 +238,15 @@ void ScriptWrappableVisitor::writeBarrier(
&(const_cast<TraceWrapperV8Reference<v8::Value>*>(dstObject)->get()));
}
+void ScriptWrappableVisitor::writeBarrier(
+ const v8::Persistent<v8::Object>* dstObject) {
+ if (!dstObject || dstObject->IsEmpty()) {
+ return;
+ }
+ currentVisitor(ThreadState::current()->isolate())
+ ->markWrapper(&(dstObject->As<v8::Value>()));
+}
+
void ScriptWrappableVisitor::traceWrappers(
const TraceWrapperV8Reference<v8::Value>& tracedWrapper) const {
markWrapper(
@@ -246,7 +256,8 @@ 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.
+ // delayed. Bail out in this case. We also allow unconditional marking which
+ // requires us to bail out here when tracing is not in progress.
if (!m_tracingInProgress)
return;
handle->RegisterExternalReference(m_isolate);

Powered by Google App Engine
This is Rietveld 408576698