Index: Source/platform/heap/ThreadState.cpp |
diff --git a/Source/platform/heap/ThreadState.cpp b/Source/platform/heap/ThreadState.cpp |
index ee4371b6feb516b13100408854cb651b9fcffd96..5b256b690e4996540d2e76705f25d737d0b8948b 100644 |
--- a/Source/platform/heap/ThreadState.cpp |
+++ b/Source/platform/heap/ThreadState.cpp |
@@ -591,7 +591,9 @@ void ThreadState::performIdleGC(double deadlineSeconds) |
return; |
double idleDeltaInSeconds = deadlineSeconds - Platform::current()->monotonicallyIncreasingTime(); |
- if (idleDeltaInSeconds <= Heap::estimatedMarkingTime()) { |
+ if (idleDeltaInSeconds <= Heap::estimatedMarkingTime() && !Scheduler::shared()->canExceedIdleDeadlineIfRequired()) { |
+ // If marking is estimated to take longer than the deadline and we can't |
+ // exceed the deadline, then reschedule for the next idle period. |
scheduleIdleGC(); |
return; |
} |