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 "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/base/atomicops.h" | 9 #include "src/base/atomicops.h" |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 1913 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1924 | 1924 |
1925 // Expands the space by allocating a fixed number of pages. Returns false if | 1925 // Expands the space by allocating a fixed number of pages. Returns false if |
1926 // it cannot allocate requested number of pages from OS, or if the hard heap | 1926 // it cannot allocate requested number of pages from OS, or if the hard heap |
1927 // size limit has been hit. | 1927 // size limit has been hit. |
1928 bool Expand(); | 1928 bool Expand(); |
1929 | 1929 |
1930 // Generic fast case allocation function that tries linear allocation at the | 1930 // Generic fast case allocation function that tries linear allocation at the |
1931 // address denoted by top in allocation_info_. | 1931 // address denoted by top in allocation_info_. |
1932 inline HeapObject* AllocateLinearly(int size_in_bytes); | 1932 inline HeapObject* AllocateLinearly(int size_in_bytes); |
1933 | 1933 |
1934 // Generic fast case allocation function that tries double aligned linear | 1934 // Generic fast case allocation function that tries aligned linear allocation |
1935 // allocation at the address denoted by top in allocation_info_. | 1935 // at the address denoted by top in allocation_info_. Writes the aligned |
1936 inline HeapObject* AllocateLinearlyAligned(int size_in_bytes, | 1936 // allocation size, which includes the filler size, to size_in_bytes. |
| 1937 inline HeapObject* AllocateLinearlyAligned(int* size_in_bytes, |
1937 AllocationAlignment alignment); | 1938 AllocationAlignment alignment); |
1938 | 1939 |
1939 // If sweeping is still in progress try to sweep unswept pages. If that is | 1940 // If sweeping is still in progress try to sweep unswept pages. If that is |
1940 // not successful, wait for the sweeper threads and re-try free-list | 1941 // not successful, wait for the sweeper threads and re-try free-list |
1941 // allocation. | 1942 // allocation. |
1942 MUST_USE_RESULT HeapObject* WaitForSweeperThreadsAndRetryAllocation( | 1943 MUST_USE_RESULT HeapObject* WaitForSweeperThreadsAndRetryAllocation( |
1943 int size_in_bytes); | 1944 int size_in_bytes); |
1944 | 1945 |
1945 // Slow path of AllocateRaw. This function is space-dependent. | 1946 // Slow path of AllocateRaw. This function is space-dependent. |
1946 MUST_USE_RESULT HeapObject* SlowAllocateRaw(int size_in_bytes); | 1947 MUST_USE_RESULT HeapObject* SlowAllocateRaw(int size_in_bytes); |
(...skipping 937 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2884 count = 0; | 2885 count = 0; |
2885 } | 2886 } |
2886 // Must be small, since an iteration is used for lookup. | 2887 // Must be small, since an iteration is used for lookup. |
2887 static const int kMaxComments = 64; | 2888 static const int kMaxComments = 64; |
2888 }; | 2889 }; |
2889 #endif | 2890 #endif |
2890 } | 2891 } |
2891 } // namespace v8::internal | 2892 } // namespace v8::internal |
2892 | 2893 |
2893 #endif // V8_HEAP_SPACES_H_ | 2894 #endif // V8_HEAP_SPACES_H_ |
OLD | NEW |