| Index: src/heap.h
|
| diff --git a/src/heap.h b/src/heap.h
|
| index 3b8a9eadb385bd92b9c0d29659bd01fccdd2fe3b..f3bcf33fbb542cf85bfb327a5bf53b3b45e4493b 100644
|
| --- a/src/heap.h
|
| +++ b/src/heap.h
|
| @@ -1524,10 +1524,22 @@ class Heap {
|
| return PromotedSpaceSizeOfObjects() + PromotedExternalMemorySize();
|
| }
|
|
|
| + // TODO(hpayer): When we provide pretenuring support for all kinds of
|
| + // objects we can change this heuristic and make it depend on the high
|
| + // promotion mode.
|
| + inline bool AggressivePromotionMode() {
|
| + return PretenuredSizeOfObjects() > 0;
|
| + }
|
| +
|
| + inline int OldGenerationHighPromotionFactor() {
|
| + return AggressivePromotionMode() ? 2 : 1;
|
| + }
|
| +
|
| // 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() {
|
| - return PromotedTotalSize() > old_gen_promotion_limit_;
|
| + return PromotedTotalSize() >
|
| + old_gen_promotion_limit_ * OldGenerationHighPromotionFactor();
|
| }
|
|
|
| inline intptr_t OldGenerationSpaceAvailable() {
|
| @@ -1631,12 +1643,14 @@ class Heap {
|
| intptr_t total_promoted = PromotedTotalSize();
|
|
|
| intptr_t adjusted_promotion_limit =
|
| - old_gen_promotion_limit_ - new_space_.Capacity();
|
| + old_gen_promotion_limit_ * OldGenerationHighPromotionFactor() -
|
| + new_space_.Capacity();
|
|
|
| if (total_promoted >= adjusted_promotion_limit) return true;
|
|
|
| intptr_t adjusted_allocation_limit =
|
| - old_gen_allocation_limit_ - new_space_.Capacity() / 5;
|
| + old_gen_allocation_limit_ * OldGenerationHighPromotionFactor() -
|
| + new_space_.Capacity() / 5;
|
|
|
| if (PromotedSpaceSizeOfObjects() >= adjusted_allocation_limit) return true;
|
|
|
| @@ -1671,6 +1685,10 @@ class Heap {
|
| // Returns the size of objects residing in non new spaces.
|
| intptr_t PromotedSpaceSizeOfObjects();
|
|
|
| + // TODO(hpayer): We can remove PretenuredSizeOfObjects() when
|
| + // we provide pretenuring support for all kinds of objects.
|
| + intptr_t PretenuredSizeOfObjects();
|
| +
|
| double total_regexp_code_generated() { return total_regexp_code_generated_; }
|
| void IncreaseTotalRegexpCodeGenerated(int size) {
|
| total_regexp_code_generated_ += size;
|
|
|