Chromium Code Reviews| Index: src/heap.h |
| diff --git a/src/heap.h b/src/heap.h |
| index e0ffa63e9abdf8678925b12cef99b154ef76163a..4afbdefa0c8e6699ad10b9d762f791ab7b527574 100644 |
| --- a/src/heap.h |
| +++ b/src/heap.h |
| @@ -885,14 +885,9 @@ class Heap { |
| // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation |
| // failed. |
| // Please note this does not perform a garbage collection. |
| - MUST_USE_RESULT MaybeObject* AllocateByteArray(int length, |
| - PretenureFlag pretenure); |
| - |
| - // Allocate a non-tenured byte array of the specified length |
| - // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation |
| - // failed. |
| - // Please note this does not perform a garbage collection. |
| - MUST_USE_RESULT MaybeObject* AllocateByteArray(int length); |
| + MUST_USE_RESULT MaybeObject* AllocateByteArray( |
| + int length, |
| + PretenureFlag pretenure = NOT_TENURED); |
| // Allocates an external array of the specified length and type. |
| // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation |
| @@ -2085,6 +2080,17 @@ class Heap { |
| inline void UpdateOldSpaceLimits(); |
| + // Selects the proper allocation space depending on the given object |
| + // size and the given pretenuring decision. |
|
Hannes Payer (out of office)
2013/08/20 09:49:19
... and the given preferred old space if old data
Michael Starzinger
2013/09/23 11:35:05
Done.
|
| + static AllocationSpace SelectSpace(int object_size, |
| + AllocationSpace preferred_old_space, |
| + PretenureFlag pretenure) { |
| + ASSERT(preferred_old_space == OLD_POINTER_SPACE || |
| + preferred_old_space == OLD_DATA_SPACE); |
| + if (object_size > Page::kMaxNonCodeHeapObjectSize) return LO_SPACE; |
| + return (pretenure == TENURED) ? preferred_old_space : NEW_SPACE; |
| + } |
| + |
| // Allocate an uninitialized object in map space. The behavior is identical |
| // to Heap::AllocateRaw(size_in_bytes, MAP_SPACE), except that (a) it doesn't |
| // have to test the allocation space argument and (b) can reduce code size |