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

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: Only check for unaligned double case. Created 5 years, 7 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
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 1919 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 double aligned linear 1940 // Generic fast case allocation function that tries aligned linear allocation
1941 // allocation at the address denoted by top in allocation_info_. 1941 // at the address denoted by top in allocation_info_. Writes the aligned
1942 inline HeapObject* AllocateLinearlyAligned(int size_in_bytes, 1942 // allocation size, which includes the filler size, to size_in_bytes.
1943 inline HeapObject* AllocateLinearlyAligned(int* size_in_bytes,
1943 AllocationAlignment alignment); 1944 AllocationAlignment alignment);
1944 1945
1945 // If sweeping is still in progress try to sweep unswept pages. If that is 1946 // If sweeping is still in progress try to sweep unswept pages. If that is
1946 // not successful, wait for the sweeper threads and re-try free-list 1947 // not successful, wait for the sweeper threads and re-try free-list
1947 // allocation. 1948 // allocation.
1948 MUST_USE_RESULT HeapObject* WaitForSweeperThreadsAndRetryAllocation( 1949 MUST_USE_RESULT HeapObject* WaitForSweeperThreadsAndRetryAllocation(
1949 int size_in_bytes); 1950 int size_in_bytes);
1950 1951
1951 // Slow path of AllocateRaw. This function is space-dependent. 1952 // Slow path of AllocateRaw. This function is space-dependent.
1952 MUST_USE_RESULT HeapObject* SlowAllocateRaw(int size_in_bytes); 1953 MUST_USE_RESULT HeapObject* SlowAllocateRaw(int size_in_bytes);
(...skipping 937 matching lines...) Expand 10 before | Expand all | Expand 10 after
2890 count = 0; 2891 count = 0;
2891 } 2892 }
2892 // Must be small, since an iteration is used for lookup. 2893 // Must be small, since an iteration is used for lookup.
2893 static const int kMaxComments = 64; 2894 static const int kMaxComments = 64;
2894 }; 2895 };
2895 #endif 2896 #endif
2896 } 2897 }
2897 } // namespace v8::internal 2898 } // namespace v8::internal
2898 2899
2899 #endif // V8_HEAP_SPACES_H_ 2900 #endif // V8_HEAP_SPACES_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698