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

Unified Diff: third_party/WebKit/Source/platform/heap/Visitor.cpp

Issue 1909803002: Add per thread heap enabled MarkingVisitorImpl Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 | « third_party/WebKit/Source/platform/heap/Visitor.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/heap/Visitor.cpp
diff --git a/third_party/WebKit/Source/platform/heap/Visitor.cpp b/third_party/WebKit/Source/platform/heap/Visitor.cpp
index 6f5d00fbaf3f812f5692f202b3d57277f2a446e4..4cf3995e7fff9c1672781d061ea9e4928d03b3ef 100644
--- a/third_party/WebKit/Source/platform/heap/Visitor.cpp
+++ b/third_party/WebKit/Source/platform/heap/Visitor.cpp
@@ -12,18 +12,36 @@ namespace blink {
PassOwnPtr<Visitor> Visitor::create(ThreadState* state, BlinkGC::GCType gcType)
{
- switch (gcType) {
- case BlinkGC::GCWithSweep:
- case BlinkGC::GCWithoutSweep:
- return adoptPtr(new MarkingVisitor<Visitor::GlobalMarking>(state));
- case BlinkGC::TakeSnapshot:
- return adoptPtr(new MarkingVisitor<Visitor::SnapshotMarking>(state));
- case BlinkGC::ThreadTerminationGC:
- return adoptPtr(new MarkingVisitor<Visitor::ThreadLocalMarking>(state));
- case BlinkGC::ThreadLocalWeakProcessing:
- return adoptPtr(new MarkingVisitor<Visitor::WeakProcessing>(state));
- default:
- ASSERT_NOT_REACHED();
+ bool perThreadHeapEnabled = false;
+ if (perThreadHeapEnabled) {
+ switch (gcType) {
+ case BlinkGC::GCWithSweep:
+ case BlinkGC::GCWithoutSweep:
+ // InlinedGlobalMarkingVisitor does not support per thread heap disabled heaps.
+ return adoptPtr(new MarkingVisitor<Visitor::ThreadLocalMarking, true>(state));
+ case BlinkGC::TakeSnapshot:
+ return adoptPtr(new MarkingVisitor<Visitor::SnapshotMarking, true>(state));
+ case BlinkGC::ThreadTerminationGC:
+ return adoptPtr(new MarkingVisitor<Visitor::ThreadTerminationMarking, true>(state));
+ case BlinkGC::ThreadLocalWeakProcessing:
+ return adoptPtr(new MarkingVisitor<Visitor::WeakProcessing, true>(state));
+ default:
+ ASSERT_NOT_REACHED();
+ }
+ } else {
+ switch (gcType) {
+ case BlinkGC::GCWithSweep:
+ case BlinkGC::GCWithoutSweep:
+ return adoptPtr(new MarkingVisitor<Visitor::GlobalMarking, false>(state));
+ case BlinkGC::TakeSnapshot:
+ return adoptPtr(new MarkingVisitor<Visitor::SnapshotMarking, false>(state));
+ case BlinkGC::ThreadTerminationGC:
+ return adoptPtr(new MarkingVisitor<Visitor::ThreadTerminationMarking, false>(state));
+ case BlinkGC::ThreadLocalWeakProcessing:
+ return adoptPtr(new MarkingVisitor<Visitor::WeakProcessing, false>(state));
+ default:
+ ASSERT_NOT_REACHED();
+ }
}
return nullptr;
}
« no previous file with comments | « third_party/WebKit/Source/platform/heap/Visitor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698