Chromium Code Reviews| Index: Source/platform/heap/ThreadState.cpp |
| diff --git a/Source/platform/heap/ThreadState.cpp b/Source/platform/heap/ThreadState.cpp |
| index 4478fbb6b52e085cbaa16a1b2a2ead7318debdd2..0ec8230b157c023ae6da77a249378ce349eb9e29 100644 |
| --- a/Source/platform/heap/ThreadState.cpp |
| +++ b/Source/platform/heap/ThreadState.cpp |
| @@ -718,6 +718,10 @@ bool ThreadState::shouldSchedulePreciseGC() |
| // These heuristics affect performance significantly. |
| bool ThreadState::shouldForceConservativeGC() |
| { |
| + if (Heap::isGCUrgentlyRequested()) { |
| + Heap::clearUrgentGC(); |
|
haraken
2015/02/10 01:23:17
We should call Heap::clearUrgentGC() in Heap::coll
|
| + return true; |
| + } |
| size_t newSize = Heap::allocatedObjectSize(); |
| if (newSize >= 300 * 1024 * 1024) { |
| // If we consume too much memory, trigger a conservative GC |
| @@ -743,8 +747,12 @@ void ThreadState::scheduleGCIfNeeded() |
| checkThread(); |
| // Allocation is allowed during sweeping, but those allocations should not |
| // trigger nested GCs |
| - if (isSweepingInProgress()) |
| - return; |
| + if (isSweepingInProgress()) { |
| + if (!Heap::isGCUrgentlyRequested() || !isSweepingScheduled()) |
|
haraken
2015/02/10 01:23:17
If an urgent GC is scheduled, I think we can just
sof
2015/02/11 15:58:25
That would happen on entering "StoppingOtherThread
|
| + return; |
| + // Urgent GC requested with only a GC scheduled; fall through |
| + // and have it be serviced by a conservative GC. |
| + } |
| ASSERT(!sweepForbidden()); |
| if (shouldForceConservativeGC()) |