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

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

Issue 2585433003: [wrapper-tracing] Reduce marking overhead: Tri-color marking without 3 colors (Closed)
Patch Set: Fix test case 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 | third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitorTest.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 4387453a1a95c286f4861558a09be8e9fc4ce926..eaaeacdcac09812056add78fec2a9dcc13d47000 100644
--- a/third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.h
+++ b/third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.h
@@ -126,12 +126,23 @@ class CORE_EXPORT ScriptWrappableVisitor : public v8::EmbedderHeapTracer,
// objects or if we are outside of object construction.
if (!IsGarbageCollectedMixin<T>::value ||
!threadState->isMixinInConstruction()) {
+ // If the wrapper is already marked we can bail out here.
if (TraceTrait<T>::heapObjectHeader(dstObject)->isWrapperHeaderMarked())
return;
+ // 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);
+ return;
}
+ // We cannot eagerly mark the wrapper header because of mixin
+ // construction. Delay further processing until AdvanceMarking, which has to
+ // be in a non-construction state. This path may result in duplicates.
currentVisitor(threadState->isolate())
- ->pushToMarkingDeque(TraceTrait<T>::markWrapper,
+ ->pushToMarkingDeque(TraceTrait<T>::markAndTraceWrapper,
TraceTrait<T>::heapObjectHeader, dstObject);
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitorTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698