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

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

Issue 2684633004: Remove orphaned pages from Oilpan (Closed)
Patch Set: temp Created 3 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
Index: third_party/WebKit/Source/platform/heap/ThreadState.cpp
diff --git a/third_party/WebKit/Source/platform/heap/ThreadState.cpp b/third_party/WebKit/Source/platform/heap/ThreadState.cpp
index a656dfecef2e02a9c2983e0263dc42c4602ed4d9..ad5a8fedd237291941a8934175e123986d0fdf3a 100644
--- a/third_party/WebKit/Source/platform/heap/ThreadState.cpp
+++ b/third_party/WebKit/Source/platform/heap/ThreadState.cpp
@@ -208,15 +208,15 @@ void ThreadState::attachCurrentThread() {
new ThreadState();
}
-void ThreadState::cleanupPages() {
+void ThreadState::removeAllPages() {
ASSERT(checkThread());
for (int i = 0; i < BlinkGC::NumberOfArenas; ++i)
- m_arenas[i]->cleanupPages();
+ m_arenas[i]->removeAllPages();
}
void ThreadState::runTerminationGC() {
if (isMainThread()) {
- cleanupPages();
+ removeAllPages();
return;
}
ASSERT(checkThread());
@@ -258,9 +258,7 @@ void ThreadState::runTerminationGC() {
ASSERT(m_orderedPreFinalizers.isEmpty());
RELEASE_ASSERT(gcState() == NoGCScheduled);
- // Add pages to the orphaned page pool to ensure any global GCs from this
- // point on will not trace objects on this thread's arenas.
- cleanupPages();
+ removeAllPages();
}
void ThreadState::cleanupMainThread() {
@@ -392,11 +390,6 @@ void ThreadState::pushThreadLocalWeakCallback(void* object,
bool ThreadState::popAndInvokeThreadLocalWeakCallback(Visitor* visitor) {
ASSERT(checkThread());
- // For weak processing we should never reach orphaned pages since orphaned
- // pages are not traced and thus objects on those pages are never be
- // registered as objects on orphaned pages. We cannot assert this here since
- // we might have an off-heap collection. We assert it in
- // ThreadHeap::pushThreadLocalWeakCallback.
if (CallbackStack::Item* item = m_threadLocalWeakCallbackStack->pop()) {
item->call(visitor);
return true;
@@ -1684,11 +1677,6 @@ void ThreadState::collectGarbage(BlinkGC::StackState stackState,
heap().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,
- // we should have crashed during marking before getting here.)
- heap().getOrphanedPagePool()->decommitOrphanedPages();
-
double markingTimeInMilliseconds = WTF::currentTimeMS() - startTime;
heap().heapStats().setEstimatedMarkingTimePerByte(
totalObjectSize ? (markingTimeInMilliseconds / 1000 / totalObjectSize)

Powered by Google App Engine
This is Rietveld 408576698