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

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

Issue 1159003003: Revert of Oilpan: Implement a GC to take a heap snapshot (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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 | « Source/platform/heap/Heap.h ('k') | Source/platform/heap/HeapTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/heap/Heap.cpp
diff --git a/Source/platform/heap/Heap.cpp b/Source/platform/heap/Heap.cpp
index da86dc9910321051af139a72fb216daa19533166..d1f421585fb0f096e10c0b5788c4f529fdfcdc4b 100644
--- a/Source/platform/heap/Heap.cpp
+++ b/Source/platform/heap/Heap.cpp
@@ -271,15 +271,10 @@
}
#endif
-void BaseHeap::makeConsistentForSweeping(ThreadState::GCType gcType)
-{
- // We don't want to clear free lists when taking a snapshot.
- // This is fine because we don't sweep anything when taking a snapshot.
- if (gcType != ThreadState::TakeSnapshot) {
- clearFreeLists();
- ASSERT(isConsistentForSweeping());
- }
-
+void BaseHeap::makeConsistentForSweeping()
+{
+ clearFreeLists();
+ ASSERT(isConsistentForSweeping());
for (BasePage* page = m_firstPage; page; page = page->next())
page->markAsUnswept();
@@ -325,7 +320,7 @@
void BaseHeap::prepareForSweep()
{
- ASSERT(threadState()->isInGC());
+ ASSERT(!threadState()->isInGC());
ASSERT(!m_firstUnsweptPage);
// Move all pages to a list of unswept pages.
@@ -1846,11 +1841,11 @@
}
#endif
-void Heap::preGC(ThreadState::GCType gcType)
+void Heap::preGC()
{
ASSERT(!ThreadState::current()->isInGC());
for (ThreadState* state : ThreadState::attachedThreads())
- state->preGC(gcType);
+ state->preGC();
}
void Heap::postGC(ThreadState::GCType gcType)
@@ -1909,7 +1904,7 @@
// finalization that happens when the gcScope is torn down).
ThreadState::NoAllocationScope noAllocationScope(state);
- preGC(gcType);
+ preGC();
StackFrameDepthScope stackDepthScope;
@@ -1970,7 +1965,7 @@
MarkingVisitor<Visitor::ThreadLocalMarking> markingVisitor;
ThreadState::NoAllocationScope noAllocationScope(state);
- state->preGC(ThreadState::GCWithSweep);
+ state->preGC();
StackFrameDepthScope stackDepthScope;
// 1. Trace the thread local persistent roots. For thread local GCs we
@@ -2105,7 +2100,7 @@
size_t objectPayloadSize = 0;
for (ThreadState* state : ThreadState::attachedThreads()) {
state->setGCState(ThreadState::GCRunning);
- state->makeConsistentForSweeping(ThreadState::GCWithSweep);
+ state->makeConsistentForSweeping();
objectPayloadSize += state->objectPayloadSizeForTesting();
state->setGCState(ThreadState::EagerSweepScheduled);
state->setGCState(ThreadState::Sweeping);
« no previous file with comments | « Source/platform/heap/Heap.h ('k') | Source/platform/heap/HeapTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698