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

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: 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..d5f791a1388f053fe41f55b8adfeb631bc1bcc30 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,19 @@ void ScriptWrappableVisitor::writeBarrier(
&(const_cast<TraceWrapperV8Reference<v8::Value>*>(dstObject)->get()));
}
+void ScriptWrappableVisitor::writeBarrier(
+ const void* srcObject,
+ const v8::Persistent<v8::Object>* dstObject) {
+ if (!srcObject || !dstObject || dstObject->IsEmpty()) {
+ return;
+ }
+ if (!HeapObjectHeader::fromPayload(srcObject)->isWrapperHeaderMarked()) {
+ return;
+ }
+ currentVisitor(ThreadState::current()->isolate())
+ ->markWrapper(&(dstObject->As<v8::Value>()));
+}
+
void ScriptWrappableVisitor::traceWrappers(
const TraceWrapperV8Reference<v8::Value>& tracedWrapper) const {
markWrapper(

Powered by Google App Engine
This is Rietveld 408576698