Chromium Code Reviews| Index: src/heap.h |
| diff --git a/src/heap.h b/src/heap.h |
| index fbe0531014e6c7a7adae10c6ffd03bfde43ff826..0bfc6ce949134ddff3caaec219908a2d631005ed 100644 |
| --- a/src/heap.h |
| +++ b/src/heap.h |
| @@ -482,6 +482,10 @@ enum ArrayStorageAllocationMode { |
| INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE |
| }; |
| + |
| +enum AllocationMode { NEW_SPACE_ALLOCATION, OLD_SPACE_ALLOCATION }; |
|
Michael Starzinger
2013/07/31 16:43:16
Why not use the existing PretenureFlag instead?
Hannes Payer (out of office)
2013/08/01 07:30:57
Done.
|
| + |
| + |
| class Heap { |
| public: |
| // Configure heap size before setup. Return false if the heap has been |
| @@ -1398,7 +1402,7 @@ class Heap { |
| // Finds out which space an object should get promoted to based on its type. |
| inline OldSpace* TargetSpace(HeapObject* object); |
| - inline AllocationSpace TargetSpaceId(InstanceType type); |
| + static inline AllocationSpace TargetSpaceId(InstanceType type); |
| // Sets the stub_cache_ (only used when expanding the dictionary). |
| void public_set_code_stubs(UnseededNumberDictionary* value) { |
| @@ -1545,10 +1549,11 @@ class Heap { |
| MUST_USE_RESULT MaybeObject* AllocateRawFixedArray(int length, |
| PretenureFlag pretenure); |
| - // Predicate that governs global pre-tenuring decisions based on observed |
| - // promotion rates of previous collections. |
| - inline bool ShouldGloballyPretenure() { |
| - return FLAG_pretenuring && new_space_high_promotion_mode_active_; |
| + // Returns the allocation mode (pre-tenuring) based on observed promotion |
| + // rates of previous collections. |
| + inline AllocationMode GetAllocationMode() { |
|
Michael Starzinger
2013/07/31 16:43:16
suggestion: s/GetAllocationMode/GetGlobalPretenure
Hannes Payer (out of office)
2013/08/01 07:30:57
Done.
|
| + return FLAG_pretenuring && new_space_high_promotion_mode_active_ ? |
| + OLD_SPACE_ALLOCATION : NEW_SPACE_ALLOCATION; |
| } |
| // This is only needed for testing high promotion mode. |