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

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

Issue 1753623002: Merge VisitorScope to Visitor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added explicit Created 4 years, 10 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/platform/heap/HeapTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/heap/Heap.cpp
diff --git a/third_party/WebKit/Source/platform/heap/Heap.cpp b/third_party/WebKit/Source/platform/heap/Heap.cpp
index 62e4f91db267be1281a3fb97dca1db2cade1a3ff..ff08684bc2db5539671665e9aa239b02f3bb9211 100644
--- a/third_party/WebKit/Source/platform/heap/Heap.cpp
+++ b/third_party/WebKit/Source/platform/heap/Heap.cpp
@@ -357,7 +357,7 @@ void Heap::collectGarbage(BlinkGC::StackState stackState, BlinkGC::GCType gcType
RELEASE_ASSERT(!state->isGCForbidden());
state->completeSweep();
- VisitorScope visitorScope(state, gcType);
+ OwnPtr<Visitor> visitor = Visitor::create(state, gcType);
SafePointScope safePointScope(stackState, state);
@@ -392,17 +392,17 @@ void Heap::collectGarbage(BlinkGC::StackState stackState, BlinkGC::GCType gcType
Heap::resetHeapCounters();
// 1. Trace persistent roots.
- ThreadState::visitPersistentRoots(visitorScope.visitor());
+ ThreadState::visitPersistentRoots(visitor.get());
// 2. Trace objects reachable from the stack. We do this independent of the
// given stackState since other threads might have a different stack state.
- ThreadState::visitStackRoots(visitorScope.visitor());
+ ThreadState::visitStackRoots(visitor.get());
// 3. Transitive closure to trace objects including ephemerons.
- processMarkingStack(visitorScope.visitor());
+ processMarkingStack(visitor.get());
- postMarkingProcessing(visitorScope.visitor());
- globalWeakProcessing(visitorScope.visitor());
+ postMarkingProcessing(visitor.get());
+ globalWeakProcessing(visitor.get());
// Now we can delete all orphaned pages because there are no dangling
// pointers to the orphaned pages. (If we have such dangling pointers,
@@ -446,7 +446,7 @@ void Heap::collectGarbageForTerminatingThread(ThreadState* state)
// ahead while it is running, hence the termination GC does not enter a
// safepoint. VisitorScope will not enter also a safepoint scope for
// ThreadTerminationGC.
- VisitorScope visitorScope(state, BlinkGC::ThreadTerminationGC);
+ OwnPtr<Visitor> visitor = Visitor::create(state, BlinkGC::ThreadTerminationGC);
ThreadState::NoAllocationScope noAllocationScope(state);
@@ -462,14 +462,14 @@ void Heap::collectGarbageForTerminatingThread(ThreadState* state)
// global GC finds a "pointer" on the stack or due to a programming
// error where an object has a dangling cross-thread pointer to an
// object on this heap.
- state->visitPersistents(visitorScope.visitor());
+ state->visitPersistents(visitor.get());
// 2. Trace objects reachable from the thread's persistent roots
// including ephemerons.
- processMarkingStack(visitorScope.visitor());
+ processMarkingStack(visitor.get());
- postMarkingProcessing(visitorScope.visitor());
- globalWeakProcessing(visitorScope.visitor());
+ postMarkingProcessing(visitor.get());
+ globalWeakProcessing(visitor.get());
state->postGC(BlinkGC::GCWithSweep);
Heap::decommitCallbackStacks();
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/heap/HeapTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698