Index: Source/platform/heap/ThreadState.cpp |
diff --git a/Source/platform/heap/ThreadState.cpp b/Source/platform/heap/ThreadState.cpp |
index b3f0aa7aef5d34aff5c7c8f16fcf1377c92ee7d5..70a2ca016ea320e778995f7431f196d1e368d668 100644 |
--- a/Source/platform/heap/ThreadState.cpp |
+++ b/Source/platform/heap/ThreadState.cpp |
@@ -853,6 +853,13 @@ void ThreadState::makeConsistentForGC() |
m_heaps[i]->makeConsistentForGC(); |
} |
+void ThreadState::makeConsistentForMutator() |
+{ |
+ ASSERT(isInGC()); |
+ for (int i = 0; i < NumberOfHeaps; ++i) |
+ m_heaps[i]->makeConsistentForMutator(); |
+} |
+ |
void ThreadState::preGC() |
{ |
ASSERT(!isInGC()); |
@@ -885,9 +892,23 @@ void ThreadState::postGC(GCType gcType) |
} |
#endif |
- setGCState(gcType == GCWithSweep ? EagerSweepScheduled : LazySweepScheduled); |
for (int i = 0; i < NumberOfHeaps; i++) |
m_heaps[i]->prepareForSweep(); |
+ |
+ if (gcType == GCWithSweep) { |
+ setGCState(EagerSweepScheduled); |
+ } else if (gcType == GCWithoutSweep) { |
+ setGCState(LazySweepScheduled); |
+ } else { |
+ takeSnapshot(); |
+ |
+ // This unmarks all marked objects and marks all unmarked objects dead. |
+ makeConsistentForMutator(); |
+ |
+ // Force setting NoGCScheduled to circumvent checkThread() |
+ // in setGCState(). |
+ m_gcState = NoGCScheduled; |
+ } |
} |
void ThreadState::preSweep() |
@@ -1297,6 +1318,12 @@ void ThreadState::promptlyFreed(size_t gcInfoIndex) |
m_likelyToBePromptlyFreed[entryIndex] += 3; |
} |
+void ThreadState::takeSnapshot() |
+{ |
+ ASSERT(isInGC()); |
+ // TODO(ssid): Implement this. |
+} |
+ |
#if ENABLE(GC_PROFILING) |
const GCInfo* ThreadState::findGCInfoFromAllThreads(Address address) |
{ |