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

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

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, 12 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.h
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.h b/third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.h
index eaaeacdcac09812056add78fec2a9dcc13d47000..0937d1dc20a631fa22f979cbca1fbbbd0e37782a 100644
--- a/third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.h
+++ b/third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.h
@@ -132,9 +132,11 @@ class CORE_EXPORT ScriptWrappableVisitor : public v8::EmbedderHeapTracer,
// Otherwise, eagerly mark the wrapper header and put the object on the
// marking deque for further processing.
WrapperVisitor* const visitor = currentVisitor(threadState->isolate());
- TraceTrait<T>::markWrapperNoTracing(visitor, dstObject);
- visitor->pushToMarkingDeque(TraceTrait<T>::traceMarkedWrapper,
- TraceTrait<T>::heapObjectHeader, dstObject);
+ if (visitor->pushToMarkingDeque(TraceTrait<T>::traceMarkedWrapper,
+ TraceTrait<T>::heapObjectHeader,
+ dstObject)) {
+ TraceTrait<T>::markWrapperNoTracing(visitor, dstObject);
+ }
return;
}
@@ -169,10 +171,13 @@ class CORE_EXPORT ScriptWrappableVisitor : public v8::EmbedderHeapTracer,
void invalidateDeadObjectsInMarkingDeque();
- void pushToMarkingDeque(
+ bool pushToMarkingDeque(
void (*traceWrappersCallback)(const WrapperVisitor*, const void*),
HeapObjectHeader* (*heapObjectHeaderCallback)(const void*),
const void* object) const override {
+ if (!m_tracingInProgress)
+ return false;
+
m_markingDeque.append(WrapperMarkingData(traceWrappersCallback,
heapObjectHeaderCallback, object));
#if DCHECK_IS_ON()
@@ -181,6 +186,7 @@ class CORE_EXPORT ScriptWrappableVisitor : public v8::EmbedderHeapTracer,
traceWrappersCallback, heapObjectHeaderCallback, object));
}
#endif
+ return true;
}
bool markWrapperHeader(HeapObjectHeader*) const;
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698