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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/TraceWrapperMember.h

Issue 2564153002: [wrapper-tracing] Remove unnecessary barrier (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/bindings/core/v8/TraceWrapperMember.h
diff --git a/third_party/WebKit/Source/bindings/core/v8/TraceWrapperMember.h b/third_party/WebKit/Source/bindings/core/v8/TraceWrapperMember.h
index 660f519ec316dd4b30305c503dfd0c28af7381d2..eb68310da5a219c165d454c83a5f1c66ab9e6686 100644
--- a/third_party/WebKit/Source/bindings/core/v8/TraceWrapperMember.h
+++ b/third_party/WebKit/Source/bindings/core/v8/TraceWrapperMember.h
@@ -28,7 +28,15 @@ class TraceWrapperMember : public Member<T> {
#if DCHECK_IS_ON()
DCHECK(!m_parent || HeapObjectHeader::fromPayload(m_parent)->checkHeader());
#endif
- ScriptWrappableVisitor::writeBarrier(m_parent, raw);
+ // We don't require a write barrier here as TraceWrapperMember is used for
+ // the following scenarios:
+ // - Initial initialization: The write barrier will not fire as the parent
+ // is initially white.
haraken 2016/12/12 01:02:07 To guarantee this fact, you need to guarantee that
Michael Lippautz 2016/12/12 08:18:57 We (still) cannot handle this case :) We cannot ma
+ // - Wrapping when inserting into a container: The write barrier will fire
+ // upon establishing the move into the container.
+ // - Assignment to a field: The regular assignment operator will fire the
+ // write barrier.
+ // Note that support for black allocation would require a barrier here.
haraken 2016/12/12 08:44:13 Can we add a dcheck to check if m_parent is a whit
Michael Lippautz 2016/12/12 11:42:27 Unfortunately not, as we use this type also as a w
}
TraceWrapperMember(WTF::HashTableDeletedValueType x)
: Member<T>(x), m_parent(nullptr) {}
« 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