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

Unified Diff: Source/heap/ThreadState.cpp

Issue 187483002: Oilpan: We need to collect all garbage before shutting down the worker thread (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 | « Source/heap/ThreadState.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/heap/ThreadState.cpp
diff --git a/Source/heap/ThreadState.cpp b/Source/heap/ThreadState.cpp
index 233a979afe7ea6e39a9d325529717307e42d90a9..58735a1bf4dd93a325bc49d13003e306ae05f926 100644
--- a/Source/heap/ThreadState.cpp
+++ b/Source/heap/ThreadState.cpp
@@ -296,13 +296,7 @@ void ThreadState::cleanup()
// After this GC we expect heap to be empty because
// preCleanup tasks should have cleared all persistent
// handles that were externally owned.
- // FIXME: oilpan: we should perform a single GC and everything
- // should die. Unfortunately it is not the case for all objects
- // because the hierarchy was not completely moved to the heap and
- // some heap allocated objects own objects that contain persistents
- // pointing to other heap allocated objects.
- Heap::collectGarbage(ThreadState::NoHeapPointersOnStack);
- Heap::collectGarbage(ThreadState::NoHeapPointersOnStack);
+ Heap::collectAllGarbage(ThreadState::NoHeapPointersOnStack);
// Verify that all heaps are empty now.
for (int i = 0; i < NumberOfHeaps; i++)
@@ -317,6 +311,8 @@ void ThreadState::cleanup()
void ThreadState::detach()
{
ThreadState* state = current();
+ state->cleanup();
+
// Enter safe point before trying to acquire threadAttachMutex
// to avoid dead lock if another thread is preparing for GC, has acquired
// threadAttachMutex and waiting for other threads to pause or reach a
« no previous file with comments | « Source/heap/ThreadState.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698