| Index: src/heap.h
|
| diff --git a/src/heap.h b/src/heap.h
|
| index 672b490ff479ea8e09e0293aef56694d9a3c34c2..b1c805e167676d75f8bde1d2faa8db7e98f57195 100644
|
| --- a/src/heap.h
|
| +++ b/src/heap.h
|
| @@ -1337,6 +1337,10 @@ class Heap {
|
| return PromotedSpaceSize() + PromotedExternalMemorySize();
|
| }
|
|
|
| + inline intptr_t PromotedTotalSizeOfObjects() {
|
| + return PromotedSpaceSizeOfObjects() + PromotedExternalMemorySize();
|
| + }
|
| +
|
| // True if we have reached the allocation limit in the old generation that
|
| // should force the next GC (caused normally) to be a full one.
|
| inline bool OldGenerationPromotionLimitReached() {
|
| @@ -1440,8 +1444,15 @@ class Heap {
|
| }
|
|
|
| inline bool NextGCIsLikelyToBeFull() {
|
| + const int kPromotionFraction = 8;
|
| +
|
| if (FLAG_gc_global) return true;
|
|
|
| + intptr_t promoted_at_gc = total_promoted_at_last_old_space_gc_;
|
| + intptr_t promoted_since_gc = PromotedTotalSizeOfObjects() - promoted_at_gc;
|
| +
|
| + if (promoted_since_gc < promoted_at_gc / kPromotionFraction) return false;
|
| +
|
| intptr_t total_promoted = PromotedTotalSize();
|
|
|
| intptr_t adjusted_promotion_limit =
|
| @@ -1690,6 +1701,8 @@ class Heap {
|
| // Used to adjust the limits that control the timing of the next GC.
|
| intptr_t size_of_old_gen_at_last_old_space_gc_;
|
|
|
| + intptr_t total_promoted_at_last_old_space_gc_;
|
| +
|
| // Limit on the amount of externally allocated memory allowed
|
| // between global GCs. If reached a global GC is forced.
|
| intptr_t external_allocation_limit_;
|
|
|