Chromium Code Reviews| Index: Source/platform/heap/ThreadState.cpp |
| diff --git a/Source/platform/heap/ThreadState.cpp b/Source/platform/heap/ThreadState.cpp |
| index 47d9c817abe92f99d5994400413fcd7d15f2993e..1ef1d11ab3cad926f2f4719da4ec47ae1f4aa177 100644 |
| --- a/Source/platform/heap/ThreadState.cpp |
| +++ b/Source/platform/heap/ThreadState.cpp |
| @@ -850,6 +850,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()); |
| @@ -882,9 +889,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; |
|
sof
2015/05/28 12:15:13
Why are you doing this (way)?
haraken
2015/05/28 12:33:36
As commented above, if we call setGCState(NoGCSche
|
| + } |
| } |
| void ThreadState::preSweep() |
| @@ -1269,6 +1290,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) |
| { |