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

Unified Diff: src/heap/spaces.h

Issue 1127993002: Move double alignment logic into memory allocator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap/heap.cc ('k') | src/heap/spaces.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/spaces.h
diff --git a/src/heap/spaces.h b/src/heap/spaces.h
index 2df28c04c07ff4cb662c105a6b7c25b8cb726fcd..de8e4b051fc62d6062a766063940d034037e2b6f 100644
--- a/src/heap/spaces.h
+++ b/src/heap/spaces.h
@@ -1759,6 +1759,11 @@ class PagedSpace : public Space {
// failure object if not.
MUST_USE_RESULT inline AllocationResult AllocateRaw(int size_in_bytes);
+ // Allocate the requested number of bytes in the space double aligned if
+ // possible, return a failure object if not.
+ MUST_USE_RESULT inline AllocationResult AllocateRawDoubleAligned(
+ int size_in_bytes);
+
// Give a block of memory to the space's free list. It might be added to
// the free list or accounted as waste.
// If add_to_freelist is false then just accounting stats are updated and
@@ -1919,6 +1924,10 @@ class PagedSpace : public Space {
// address denoted by top in allocation_info_.
inline HeapObject* AllocateLinearly(int size_in_bytes);
+ // Generic fast case allocation function that tries double aligned linear
+ // allocation at the address denoted by top in allocation_info_.
+ inline HeapObject* AllocateLinearlyDoubleAlign(int size_in_bytes);
+
// If sweeping is still in progress try to sweep unswept pages. If that is
// not successful, wait for the sweeper threads and re-try free-list
// allocation.
@@ -2484,6 +2493,9 @@ class NewSpace : public Space {
return allocation_info_.limit_address();
}
+ MUST_USE_RESULT INLINE(
+ AllocationResult AllocateRawDoubleAligned(int size_in_bytes));
+
MUST_USE_RESULT INLINE(AllocationResult AllocateRaw(int size_in_bytes));
// Reset the allocation pointer to the beginning of the active semispace.
@@ -2601,7 +2613,8 @@ class NewSpace : public Space {
HistogramInfo* allocated_histogram_;
HistogramInfo* promoted_histogram_;
- MUST_USE_RESULT AllocationResult SlowAllocateRaw(int size_in_bytes);
+ MUST_USE_RESULT AllocationResult
+ SlowAllocateRaw(int size_in_bytes, bool double_aligned);
friend class SemiSpaceIterator;
« 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