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