Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(230)

Side by Side Diff: src/heap/spaces.h

Issue 1150593003: Clean up aligned allocation code in preparation for SIMD alignments. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix DoubleAlignForDeserialization, fix test when top is misaligned. Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/heap/heap.cc ('k') | src/heap/spaces.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « src/heap/heap.cc ('k') | src/heap/spaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698