| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_HEAP_SPACES_H_ | 5 #ifndef V8_HEAP_SPACES_H_ |
| 6 #define V8_HEAP_SPACES_H_ | 6 #define V8_HEAP_SPACES_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 682 (1 << MemoryChunk::POINTERS_TO_HERE_ARE_INTERESTING) | | 682 (1 << MemoryChunk::POINTERS_TO_HERE_ARE_INTERESTING) | |
| 683 (1 << MemoryChunk::POINTERS_FROM_HERE_ARE_INTERESTING); | 683 (1 << MemoryChunk::POINTERS_FROM_HERE_ARE_INTERESTING); |
| 684 | 684 |
| 685 // Maximum object size that gets allocated into regular pages. Objects larger | 685 // Maximum object size that gets allocated into regular pages. Objects larger |
| 686 // than that size are allocated in large object space and are never moved in | 686 // than that size are allocated in large object space and are never moved in |
| 687 // memory. This also applies to new space allocation, since objects are never | 687 // memory. This also applies to new space allocation, since objects are never |
| 688 // migrated from new space to large object space. Takes double alignment into | 688 // migrated from new space to large object space. Takes double alignment into |
| 689 // account. | 689 // account. |
| 690 // TODO(hpayer): This limit should be way smaller but we currently have | 690 // TODO(hpayer): This limit should be way smaller but we currently have |
| 691 // short living objects >256K. | 691 // short living objects >256K. |
| 692 static const int kMaxRegularHeapObjectSize = 600 * KB; | 692 static const int kMaxRegularHeapObjectSize = 300 * KB; |
| 693 | 693 |
| 694 static inline Page* ConvertNewToOld(Page* old_page, PagedSpace* new_owner); | 694 static inline Page* ConvertNewToOld(Page* old_page, PagedSpace* new_owner); |
| 695 | 695 |
| 696 // Returns the page containing a given address. The address ranges | 696 // Returns the page containing a given address. The address ranges |
| 697 // from [page_addr .. page_addr + kPageSize[. This only works if the object | 697 // from [page_addr .. page_addr + kPageSize[. This only works if the object |
| 698 // is in fact in a page. | 698 // is in fact in a page. |
| 699 static Page* FromAddress(Address addr) { | 699 static Page* FromAddress(Address addr) { |
| 700 return reinterpret_cast<Page*>(OffsetFrom(addr) & ~kPageAlignmentMask); | 700 return reinterpret_cast<Page*>(OffsetFrom(addr) & ~kPageAlignmentMask); |
| 701 } | 701 } |
| 702 | 702 |
| (...skipping 1446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2149 | 2149 |
| 2150 // Cleans up the space, frees all pages in this space except those belonging | 2150 // Cleans up the space, frees all pages in this space except those belonging |
| 2151 // to the initial chunk, uncommits addresses in the initial chunk. | 2151 // to the initial chunk, uncommits addresses in the initial chunk. |
| 2152 void TearDown(); | 2152 void TearDown(); |
| 2153 | 2153 |
| 2154 // Expands the space by allocating a fixed number of pages. Returns false if | 2154 // Expands the space by allocating a fixed number of pages. Returns false if |
| 2155 // it cannot allocate requested number of pages from OS, or if the hard heap | 2155 // it cannot allocate requested number of pages from OS, or if the hard heap |
| 2156 // size limit has been hit. | 2156 // size limit has been hit. |
| 2157 bool Expand(); | 2157 bool Expand(); |
| 2158 | 2158 |
| 2159 int AreaSizeDuringDeserialization(); |
| 2160 |
| 2159 // Generic fast case allocation function that tries linear allocation at the | 2161 // Generic fast case allocation function that tries linear allocation at the |
| 2160 // address denoted by top in allocation_info_. | 2162 // address denoted by top in allocation_info_. |
| 2161 inline HeapObject* AllocateLinearly(int size_in_bytes); | 2163 inline HeapObject* AllocateLinearly(int size_in_bytes); |
| 2162 | 2164 |
| 2163 // Generic fast case allocation function that tries aligned linear allocation | 2165 // Generic fast case allocation function that tries aligned linear allocation |
| 2164 // at the address denoted by top in allocation_info_. Writes the aligned | 2166 // at the address denoted by top in allocation_info_. Writes the aligned |
| 2165 // allocation size, which includes the filler size, to size_in_bytes. | 2167 // allocation size, which includes the filler size, to size_in_bytes. |
| 2166 inline HeapObject* AllocateLinearlyAligned(int* size_in_bytes, | 2168 inline HeapObject* AllocateLinearlyAligned(int* size_in_bytes, |
| 2167 AllocationAlignment alignment); | 2169 AllocationAlignment alignment); |
| 2168 | 2170 |
| (...skipping 816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2985 count = 0; | 2987 count = 0; |
| 2986 } | 2988 } |
| 2987 // Must be small, since an iteration is used for lookup. | 2989 // Must be small, since an iteration is used for lookup. |
| 2988 static const int kMaxComments = 64; | 2990 static const int kMaxComments = 64; |
| 2989 }; | 2991 }; |
| 2990 #endif | 2992 #endif |
| 2991 } // namespace internal | 2993 } // namespace internal |
| 2992 } // namespace v8 | 2994 } // namespace v8 |
| 2993 | 2995 |
| 2994 #endif // V8_HEAP_SPACES_H_ | 2996 #endif // V8_HEAP_SPACES_H_ |
| OLD | NEW |