Index: src/heap.h |
diff --git a/src/heap.h b/src/heap.h |
index df3717e4faee7bb650dfb006fcdd32742a14c7e4..afc068942a205954501823bb0ac6833501c7da34 100644 |
--- a/src/heap.h |
+++ b/src/heap.h |
@@ -1960,9 +1960,25 @@ class Heap { |
return incremental_marking()->WorthActivating(); |
} |
+ // Estimates how many milliseconds a Mark-Sweep would take to complete. |
+ // In idle notification handler we assume that this function will return: |
+ // - a number less than 1000 for any heap size. |
Erik Corry
2012/03/20 08:16:00
We should either make sure that this is true, or m
|
+ // - a number less than 10 for small heaps, which are less than 8Mb. |
+ // - a number greater than 10 for large heaps, which are greater than 32Mb. |
+ int TimeMarkSweepWouldTakeInMs() { |
+ // Rough estimate of how many megabytes of heap can be processed in 1 ms. |
+ static const int kMbPerMs = 2; |
+ |
+ int heap_size_mb = static_cast<int>(SizeOfObjects() / MB); |
+ return heap_size_mb / kMbPerMs; |
+ } |
+ |
// Returns true if no more GC work is left. |
bool IdleGlobalGC(); |
+ void AdvanceIdleIncrementalMarking(intptr_t step_size); |
+ |
+ |
static const int kInitialSymbolTableSize = 2048; |
static const int kInitialEvalCacheSize = 64; |
static const int kInitialNumberStringCacheSize = 256; |